Disclosure of Invention
The invention aims to solve the problems of low transmission rate, insufficient safety, difficult compatibility and the like in the conventional short-wave radio fax communication, and provides a short-wave radio fax communication module and a method for realizing the short-wave radio fax communication.
The specific technical scheme is as follows:
A short-wave radio fax communication module comprises a central control unit, a storage unit, a user line interface circuit, an initialization module, a configuration module, a log module, a fax communication state machine module, a G3 fax machine fax communication module, a fax data encryption and decryption module and a waveform protocol processing module, wherein the central control unit is respectively and electrically connected with the storage unit, the user line interface circuit and an embedded Modem, the initialization module, the configuration module, the log module, the fax communication state machine module, the G3 fax machine fax communication module, the fax data encryption and decryption module and the waveform protocol processing module are stored in a Flash memory in the central control unit in the form of software binary codes, the module is connected with the G3 fax machine in a special line or an external line mode through a two-wire telephone line to realize fax communication between the G3 fax machine and the short-wave radio, fax data is communicated with a waveform module according to a protocol, a LwIP protocol and a waveform module protocol are realized, and the waveform module and the fax communication module adopts UDP transmission.
In the above short-wave radio fax communication module, the storage unit includes an SRAM memory CY62157 with a capacity of 1MB and a Flash memory W25X80 with a capacity of 1MB, and is configured to store fax data, fax capability analysis information, and buffer data after encryption and decryption processing, and support on-demand dynamic allocation of at most 10 pages of fax data.
The short-wave radio fax communication module is characterized in that the subscriber line interface circuit is an SLIC circuit Ag1170 and is used for detecting an off-hook signal, feeding a line and generating a ringing signal, supporting a special line or an external line connection mode of a two-line telephone line, and being compatible with an information security laser special fax machine and a warship secret fax machine type G3 fax machine.
The short-wave radio station fax communication module is characterized in that the fax communication state machine module realizes real-time scheduling of services such as PSTN fax communication, waveform protocol processing, off-hook detection, dual tone multi-frequency DTMF signal identification, ringing signal generation and the like through a state machine, and the system is powered on and then sequentially goes through an Initial state and an Idle monitoring state, state transition complies with specific conditions and routes, and network receiving is realized through interrupt callback.
The short-wave radio station fax communication module comprises the embedded Modem MT9234, the embedded Modem MT9234 communicates with the Modem through a UART in the central control unit, fax transmission and fax reception are achieved according to a T.30 fax communication protocol, the complete and reliable transmission of the whole fax data frame is achieved by adopting a stop equation flow control mechanism in a stage C of the T.30 fax protocol, stop equation flow control is achieved by monitoring (XON/XOFF) characters on a Modem line in a software mode, UART baud rate is set to 19200bps, line rate is set to 9600bps or 11400bps, and flow control is not needed in a mode of setting UART to 57600bps baud rate for receiving and setting a large buffer area when receiving fax. The method realizes a plurality of time-limited response processes of G3 fax machine call establishment, message pre-preparation process and message post-release process, and reliable and complete receiving and transmitting of fax coding data frames in the message. Fax coding data supports MH\MHR\MMR coding modes.
According to the short-wave radio station fax communication module, the fax data encryption and decryption module encrypts and decrypts the fax image data, and the symmetric block cipher algorithm with the variable key length of the Blowfish is adopted to encrypt and decrypt the fax page coded data, so that the fax data transmitted by the radio station cannot be decrypted, and the communication safety is improved.
The waveform protocol processing module realizes protocol communication with the waveform module of the short-wave radio station, the data packet format definition comprises version, length, source module code, target module code, type, checksum and message payload, UDP protocol transmission is adopted, a data confirmation mechanism and a communication mechanism are provided, and waiting time and retransmission of the data packet are regulated.
The short-wave radio fax communication module further comprises an LM3S9B96 of the ARMCortex-M3 inner core of the main controller, an embedded Modem MT9234, a latch 7416373, a DTMF signal identification circuit HT9172 and a power supply circuit, wherein all the hardware components work cooperatively to realize the hardware function support of the fax communication module.
The short-wave radio fax communication module comprises a software system, wherein the software system comprises a HAL hardware abstraction layer based on a circuit layer, an OS operating system layer and a logic function application layer, the HAL hardware abstraction layer comprises UART, timer, GPIO, SRAM, FLASH, SLIC, modem driving programs, and the logic function application layer comprises an initialization module, a state machine, a fax data encryption and decryption module, a configuration module, a log module, a PSTN calling and sending module, a PSTN called receiving module and a waveform protocol receiving and sending processing module.
According to the short-wave radio station fax communication module, the simulation debugging software supports the waveform protocol to transmit and receive communication, fax data can be conveniently received and sent through a network, fax image data can be browsed in a Tiff file mode, and the data display window displays communication data in real time.
The short-wave radio fax communication module comprises an initialization module, a configuration module and a log module, wherein the initialization module is used for detecting and initializing the power-on of system resources, the configuration module is used for configuring network parameters and a line connection mode, and the log module is used for recording the system activity state in real time and generating a communication report.
In the above short-wave radio fax communication module, the PSTN calling transmission module t.30 fax communication procedure C stage adopts a stop-and-go flow control method, and the waveform protocol processing module uses a request-acknowledge protocol type flow control and retransmission error control method.
The short-wave radio fax communication module is characterized in that a LwIP protocol is realized by the waveform protocol processing module, and the waveform protocol is programmed and realized in a Raw/CallbackAPI callback mode.
The invention also provides a method for realizing the fax communication of the short-wave radio station, which comprises the steps of sending fax and receiving fax, wherein when the fax is sent, the fax communication module receives the fax sent by the G3 fax machine, communicates and stores data through a T.30 fax communication protocol, encrypts the data and transmits the data to a service unit through a network, and is transmitted by the short-wave radio station, when the fax is received, the short-wave radio station sends the encrypted fax data to the fax communication module, and after decryption, starts a fax sending flow, and communicates with the fax machine at the G3 receiving end according to the T.30 fax communication protocol.
The method for realizing the fax communication of the short-wave radio station comprises the steps of starting a receiving process by using an off-hook dialing # of a calling G3 fax machine when a fax is sent in an external mode, calling and establishing an A-stage according to a T.30 fax communication procedure, sending by pressing a start button, directly connecting and receiving a fax message after the G3 fax machine presses the start button when the fax is configured in a special mode, detecting an off-hook state of a line in the external mode when the fax is received, sending a ringing signal to inform a receiver of the off-hook state of the line in the special mode, directly trying the A-stage connection, and communicating according to a T.30 fax communication procedure protocol after the connection is successful.
The invention has the following beneficial effects:
The short-wave radio fax communication module realizes the special line or external line connection with the G3 fax machine through the cooperative work of the modules, supports various fax coding modes, encrypts and decrypts the fax data, improves the communication safety, realizes the real-time service scheduling through a state machine, and ensures the efficient and reliable operation of the system. The method for realizing the fax communication of the short-wave radio station specifies the flow of sending and receiving the fax in detail, is compatible with different configuration modes, solves the problems in the prior art, and is suitable for the fields of emergency communication, offshore communication, military communication and the like.
Detailed Description
The technical scheme of the invention is further described below by the specific embodiments with reference to the accompanying drawings.
Wherein the drawings are for illustrative purposes only and are schematic representations, not intended to be limiting of the application, and wherein certain components of the drawings are omitted, enlarged or reduced in order to better illustrate embodiments of the application, and do not represent actual product dimensions.
In the description of the present application, it should be understood that, if the terms "upper", "lower", "left", "right", "inner", "outer", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, it is merely for convenience in describing the present application and simplifying the description, and it is not indicated or implied that the devices or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, so that the terms describing the positional relationships in the drawings are merely for illustration and are not to be construed as limitations of the present application, and that the specific meanings of the terms described above may be understood by those skilled in the art according to specific circumstances.
In the description of the present invention, unless explicitly stated or limited otherwise, the term "coupled" or the like should be interpreted broadly, as referring to a connection between two components, for example, a fixed connection, a removable connection, or a combination, a mechanical connection, an electrical connection, a direct connection, an indirect connection via an intermediary, a communication between two components, or an interaction between two components. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
The first embodiment of the invention provides a short-wave radio fax communication module, as shown in fig. 1-25, comprising a central control unit, a storage unit, a user line interface circuit, an initialization module, a configuration module, a log module, a fax communication state machine module, a G3 fax machine fax communication module, a fax data encryption and decryption module and a waveform protocol processing module, wherein the central control unit is respectively and electrically connected with the storage unit, the user line interface circuit and an embedded Modem, the initialization module, the configuration module, the log module, the fax communication state machine module, the G3 fax machine fax communication module, the fax data encryption and decryption module and the waveform protocol processing module are stored in a Flash memory in the central control unit in the form of software binary codes, the modules are connected with the G3 fax machine in a special line or an external line mode through two-line telephone lines, so that the fax communication between the G3 fax machine and the short-wave radio fax is realized, the fax data is communicated with the waveform module according to the protocol, the waveform module realizes LwIP protocols and the waveform module protocols, and the waveform module adopts UDP transmission.
By adopting the technical scheme, the short-wave radio fax communication module is connected with each module through the central control unit, so that the cooperative work among the modules is realized, and a complete short-wave radio fax communication system is constructed. The two-wire telephone line is connected with the G3 fax machine, so that fax communication between the G3 fax machine and a short-wave radio station can be realized, and LwIP protocol and waveform module protocol are utilized for communication, thereby ensuring reliability and stability of data transmission and providing an infrastructure for fax communication.
Specifically, in this embodiment, the storage unit includes an SRAM memory CY62157 with a capacity of 1MB and a Flash memory W25X80 with a capacity of 1MB, which are used to store fax data, fax capability analysis information, and buffer data after encryption and decryption processing, and support on-demand dynamic allocation of at most 10 pages of fax data.
By adopting the technical scheme, the storage unit is provided with the SRAM memory and the Flash memory with certain capacity, and can effectively store fax data, fax capability analysis information and buffer data after encryption and decryption processing. Dynamic allocation according to needs is supported, storage requirements of fax data of different quantities can be met, and flexibility and high efficiency of data storage are guaranteed.
Specifically, in this embodiment, the subscriber line interface is a SLIC circuit Ag1170, which is used to perform on-hook signal detection, line feeding and ringing signal generation, and support a dedicated or external connection mode of a two-line telephone line, so that the subscriber line interface is compatible with an information security laser dedicated fax machine and a warship secret fax machine type G3 fax machine.
By adopting the technical scheme, the subscriber line interface adopts the SLIC circuit Ag1170, and can accurately detect the off-hook signal, feed the line and generate the ringing signal. The system supports multiple connection modes, is compatible with all types of G3 fax machines, enhances the universality and the adaptability of the module, and can meet the use requirements of different users and different fax machines.
Specifically, in this embodiment, the fax communication state machine module implements real-time scheduling of services such as PSTN fax communication, waveform protocol processing, hook-off detection, dual tone multi-frequency DTMF signal identification, ring signal generation, etc. through a state machine, after the system is powered on, the system sequentially goes through an Initial state and an Idle monitoring state, state transitions follow specific conditions and routes, and network reception is implemented through interrupt callback.
By adopting the technical scheme, the fax communication state machine module realizes real-time scheduling of multiple services through a state machine, so that the system can orderly process tasks such as PSTN fax communication, waveform protocol processing, off-hook and on-hook detection and the like. After the system is powered on, the system operates according to a specific state transition rule, network receiving is realized through interrupt callback, the operation efficiency and response speed of the system are improved, and smooth operation of various services is ensured.
Specifically, in this embodiment, the fax communication module of the G3 fax machine includes an embedded Modem MT9234, and communicates with the Modem through a UART inside the central control unit, fax transmission and fax reception are implemented according to a t.30 fax communication protocol, and in a stage C of the t.30 fax protocol, a (XON/XOFF) character on a Modem line is monitored by software to implement stop equation flow control, a UART baud rate is set to 19200bps, a line rate supports 9600bps or 11400bps, and when receiving a fax, flow control is not required by setting a UART to 57600bps baud rate for receiving and setting a large buffer. The method realizes a plurality of time-limited response processes of G3 fax machine call establishment, message pre-preparation process and message post-release process, and reliable and complete receiving and transmitting of fax coding data frames in the message. Fax coding data supports MH\MHR\MMR coding modes.
By adopting the technical scheme, the balance of data throughput between the Modem and the UART is maintained through the stop equation flow control, the complete and reliable transmission and reception of the fax data message are realized, the fax data message supports a plurality of coding modes, and the coding mode with higher compression rate is selected to be beneficial to shortening the fax message data transmission time of a short wave channel.
Specifically, in this embodiment, the fax data encryption and decryption module encrypts and decrypts the fax image data, and uses a Blowfish variable-key-length symmetric block cipher algorithm to encrypt and decrypt the fax page encoded data, so as to ensure that the fax data transmitted by the radio station cannot be decrypted, so as to improve communication security.
By adopting the technical scheme, the fax data encryption and decryption module encrypts and decrypts the fax image data, and the symmetric block cipher algorithm with the variable key length of the Blowfish is adopted to encrypt and decrypt the fax page coded data, so that the fax data transmitted by a radio station can not be easily decrypted, the communication safety is greatly improved, and the fax information is prevented from being stolen or tampered in the transmission process.
Specifically, in this embodiment, the waveform protocol processing module implements protocol communication with the short-wave radio waveform module, where the packet format definition includes version, length, source module code, destination module code, type, checksum, and message payload, and UDP protocol is used for transmission, and the packet format definition includes a data acknowledgement mechanism and a communication mechanism, and specifies a waiting time and retransmission of a packet.
By adopting the technical scheme, the waveform protocol processing module realizes protocol communication with the short-wave radio waveform module, through definite data packet format definition, UDP protocol transmission is adopted, and the data packet waiting time and retransmission are regulated by a data confirmation mechanism and a communication mechanism, so that the accuracy and reliability of fax data in the communication process with the short-wave radio are ensured, and the data loss and transmission errors are reduced.
Specifically, in this embodiment, the hardware portion further includes an LM3S9B96 of the armcotex-M3 core, an embedded Modem MT9234, a latch 7416373, a DTMF signal identification circuit HT9172, and a power supply circuit, where each hardware component cooperates to implement hardware function support of the facsimile communication module.
By adopting the technical scheme, the components of the hardware part work cooperatively, the main controller is used as a core for coordination, the embedded Modem realizes signal modulation and demodulation, the storage unit provides a data storage function for fax data storage and encryption and decryption processing of cache data, the user line interface circuit, the DTMF signal identification circuit, the power supply circuit and other auxiliary components provide support, and the stable hardware function support is provided for the fax communication module together, so that the normal operation of the whole module is ensured.
Specifically, in this embodiment, the software system includes a HAL hardware abstraction layer based on a circuit layer, an OS operating system layer and a logic function application layer, where the HAL hardware abstraction layer includes UART, timer, GPIO, SRAM, FLASH, SLIC, modem drivers, and the logic function application layer includes PSTN calling sending, PSTN called receiving, a state machine, a waveform protocol transceiving processing module, an initialization module and a fax data encryption and decryption module.
Specifically, in this embodiment, the initialization module performs power-up detection and initialization on system resources, the configuration module configures network parameters and a line connection mode, and the log module records the system activity state in real time to generate a communication report.
Specifically, in this embodiment, the PSTN caller sending module t.30 fax communication procedure stage C adopts a stop-equation flow control method, and the waveform protocol processing module uses a request-acknowledgement protocol type flow control and retransmission error control method, so that the communication is efficient, reliable and complete.
Specifically, in this embodiment, the waveform protocol processing module implements LwIP protocols, and the waveform protocols are implemented by programming in a way of Raw/CallbackAPI callback, so that the performance of the system is improved.
By adopting the technical scheme, the software system adopts a layered architecture, and each layer has definite division. The logical function application layer comprises a plurality of functional modules, realizes various business logics of fax communication, improves the maintainability and expandability of the software, and is convenient for upgrading and optimizing the system.
The second embodiment provides a method for realizing fax communication of a short-wave radio station, which is applied to the fax communication module of the short-wave radio station in the embodiment 1 and comprises the steps of transmitting fax and receiving fax, wherein when the fax is transmitted, the fax communication module receives the fax transmitted by a G3 fax machine, communicates and stores data through a T.30 fax communication protocol, transmits the encrypted data to a service unit through a network, and is transmitted by the short-wave radio station, when the fax is received, the short-wave radio station transmits the encrypted fax data to the fax communication module, and after decryption, starts a fax transmission flow, and communicates with the fax machine at a G3 receiving end according to the T.30 fax communication protocol.
The method specifies the flow of transmitting and receiving the fax in detail, realizes the fax communication between the G3 fax machine and the short-wave radio station, ensures that the fax data can be accurately and safely transmitted between different devices, and solves the problems of the fax communication of the existing short-wave radio station.
The method comprises the steps of when a fax is sent, when the fax is configured to be in an external mode, starting a receiving flow by an off-hook dialing of a calling G3 fax machine, sending according to a T.30 fax communication procedure call establishment A stage by pressing a starting button, when the fax is configured to be in a special line mode, directly connecting and receiving a fax message after the G3 fax machine presses the starting button, when the fax is received, detecting an off-hook state of a line in the external mode, sending a ringing signal to inform a receiver of off-hook, always off-hook the line in the special line mode, directly trying for A stage connection, and communicating according to a T.30 fax communication procedure protocol after the connection is successful. Specific operation flows for sending and receiving faxes are respectively provided for different configuration modes (an external mode and a special line mode), so that the module can be better adapted to different use scenes, the flexibility and compatibility of the system are improved, and diversified user requirements are met.
In summary, the short-wave radio fax communication module provided in this embodiment has the following advantages:
the short-wave radio fax communication module of the embodiment realizes special line or external line connection with the G3 fax machine through the cooperative work of the modules, supports various fax coding modes, encrypts and decrypts fax data, improves communication safety, realizes real-time service scheduling through a state machine, and ensures efficient and reliable operation of the system. The method for realizing the fax communication of the short-wave radio station specifies the flow of sending and receiving the fax in detail, is compatible with different configuration modes, solves the problems in the prior art, and is suitable for the fields of emergency communication, offshore communication, military communication and the like.
The short-wave radio fax communication module provided in this embodiment mainly comprises module hardware and a software system, wherein:
Modular hardware composition
And the LM3S9B96 of the ARMCortex-M3 kernel of the main controller is used as a central control unit to coordinate the work of each hardware component. The embedded Modem MT9234 realizes the modulation and demodulation of signals, and the SLIC circuit Ag1170 is used as a subscriber line interface to perform off-hook signal detection, line feeding and ringing signal generation. The DTMF signal recognition circuit HT9172 performs recognition of a dual tone multi-frequency signal. The SRAM memory CY62157, the Flash memory W25X80 and the latch 7416373 form a storage system for storing fax message related data. Auxiliary components such as a power circuit and the like ensure the stable operation of the hardware system.
Software system operation
After the system is powered on, the initialization is completed in the Initial state, and if the initialization is successful, the Idle monitoring state is entered. In Idle state, off-hook signals or network reception data are monitored. When the fax machine is detected to be off-hook, the dialing number of the DTMF signal recognition circuit judges whether the fax machine enters a voice call state or a PSTN receiving fax state. And in the PSTN receiving fax state, receiving fax data according to a T.30 fax communication protocol, storing, encrypting, and starting a network sending flow. And after the network transmission is completed, reporting the state and returning to the Idle state. When receiving the fax, the data is received from the waveform module, decrypted and then sent to the G3 fax machine according to the T.30 fax communication protocol, and the whole process is scheduled in real time by the fax communication state machine module.
The overall working principle flow of the short-wave radio station fax communication module is divided into two main processes of fax sending and fax receiving:
Transmitting faxes
1. And the connection and data receiving are that the G3 fax machine and the fax communication module are connected in a special line or an external line mode through a two-line telephone line. If the mode is the external line mode, the calling G3 fax machine starts the receiving flow, and the starting button is pressed to send in the phase A of the call establishment of the T.30 fax communication protocol, if the mode is the special line mode, the G3 fax machine is directly connected and receives the fax message after pressing the starting button. The fax communication module receives fax data sent by the G3 fax machine through the user line interface.
2. And data storage and processing, namely storing the received fax data in a storage system, and analyzing fax capacity by a fax communication state machine module. The fax data encryption and decryption module encrypts the data, so that the security of the data is ensured.
3. And the encrypted fax data is transmitted to a service unit by adopting a UDP protocol according to the protocol communication rule of the waveform module of the short-wave radio station by the waveform protocol processing module, and finally transmitted by the short-wave radio station.
Receiving faxes
1. And the data receiving step of sending the received encrypted fax data to the fax communication module by the short-wave radio station and receiving the data by the waveform protocol processing module.
2. And the data decryption, namely the fax data encryption and decryption module decrypts the encrypted fax data and recovers the original fax data.
3. And (3) data transmission and communication, namely starting a fax transmission flow after the decryption of the fax data is finished, and communicating the fax communication module with the G3 receiving-end fax machine according to a T.30 fax communication protocol. And in the special line mode, the line is always off-hook, the A-stage connection is directly tried, and fax data is sent to the G3 receiving end fax machine after the connection is successful.
In the whole process, the central control unit coordinates the work of each module, and the fax communication state machine module schedules each service in real time through the state machine, so that the high efficiency, accuracy and safety of fax communication are ensured.
Condition 1, detecting the off-hook signal, receiving the signal by the DTMF signal recognition circuit, and blocking the circuit to indicate that the line is busy, if the fax machine is off-hook at the moment, prompting busy tone and returning busy tone signal. The condition 1 satisfies the condition of entering the PSTN to receive the fax, completing the PSTN to receive the fax flow, and entering the Idle state if the receiving process is abnormally terminated or is in error.
And 2, smoothly completing the PSTN receiving process, and starting the network to send fax. Namely, if the PSTN receiving process is successfully completed (namely, the PSTN receives OK), the network fax sending state is entered. And (3) finishing the flow of network fax transmission, wherein the flow is abnormally terminated or smoothly completed to be in an Idle monitoring state.
And 3, the network sending fax flow is abnormally terminated or the switching to the Idle monitoring state is smoothly completed.
And 4, detecting an off-hook signal, receiving the digital number through a DTMF signal recognition circuit, and establishing a voice link to an incoming service unit (short wave module), namely connecting a physical connection. The voice channel is provided by a short wave module. Condition 4 satisfies the enter voice call state.
And 5, monitoring that the network port receives data, wherein the message content is request transmission (effective) and line configuration, and handshaking the message to indicate that the data is transmitted later, namely, connection is established, and the network can receive a large amount of data after successful handshaking.
And 6, initializing OK, namely transferring to an Idle monitoring state. And initializing failed FAIL, and entering an abnormal error state.
Condition 7, if the receiving process is aborted or in error. The fax receiving state from PSTN goes to Idle monitoring state.
And 8, ending the PSTN to send fax normally or abnormally, and switching to an Idle monitoring state.
And 9, completing error exception handling, namely completing exception or error repair, and switching to an Idle monitoring state. Serious anomalies automatically restart the system through the watchdog circuit.
And the condition 10 is that the error or problem of hardware or software occurs in the idle monitoring state, and the abnormal error state is entered.
Condition 11, network receives fax OK (normal end), automatically starts PSTN to send fax process (flow). The condition is network receiving OK.
And (12) entering an Idle monitoring state after the voice call is finished.
Condition 13, network reception aborts or makes an error. The fax receiving state from the network goes to the Idle monitoring state.
The foregoing is merely illustrative of the preferred embodiments of the present invention and is not intended to limit the embodiments and scope of the present invention, and it should be appreciated by those skilled in the art that equivalent substitutions and obvious variations may be made using the description and illustrations of the present invention, and are intended to be included in the scope of the present invention.