Communication channel multiplexer, system and method
Technical field
The present invention relates to communication technique field, particularly relate to a kind of communication channel multiplexer, system and method.
Background technology
Prior art passes through PSTN (Public Switched Telephone Network in process POS terminal, when PSTN) carrying out speech communication with net control device, all adopt at different PSTN-E1 passages by configuration, process MODEM voice messaging and shift keying modulation (Frequency-shift keying, FSK) voice messaging respectively.
But, different POS terminal, when adopting different MODEM and FSK voice to send, just must configure different call numbers, add the possibility of makeing mistakes, in addition, POS terminal user also must apply for different PSTN-E1 passages, add operation cost, and the utilance of PSTN-E1 passage is reduced.
Summary of the invention
Embodiment of the present invention technical problem to be solved is, provides a kind of communication channel multiplexer, system and method, reduces the possibility of makeing mistakes, cuts operating costs, and improves the utilance of PSTN-E1 passage.
In order to solve the problems of the technologies described above, the embodiment of the present invention proposes a kind of communication channel multiplexing method, comprising:
Incoming call receiving step: the incoming signal being received the request connection that requesting party sends by a communication channel;
Mode decision step: confirm that current is the first mode of operation or the second mode of operation, if the first mode of operation then enters the first job step, if the second mode of operation then enters the second job step;
First job step: adopt the first mode of operation to dock with requesting party, docks and successfully then receives the first formatted data and be sent to the first backstage; And
Second job step: adopt the second mode of operation to dock with requesting party, docks and successfully then receives the second formatted data and be sent to the second backstage.
Further, the first mode of operation is MODEM pattern, and the first job step comprises:
First sends sub-step: send MODEM audio signal to requesting party;
First docking judges sub-step: if receive the MODEM signal of requesting party's feedback, then dock successfully; And
First communicator step: receive the first formatted data and be sent to MODEM finance backstage.
Further, the second mode of operation is FSK pattern, and the second job step comprises:
Second sends sub-step: send fsk data tone signal 0x81 to requesting party;
Second docking judges sub-step: if receive the fsk data tone signal 0x82 of requesting party's feedback, then dock successfully; And
Second communication sub-step: receive the second formatted data and be sent to FSK finance backstage.
Further, timeout treatment step is also comprised after described first job step and the second job step: docking exceedes the scheduled time still unsuccessful then process ends.
Further, the first formatted data is MODEM packet, and form is " indexed variable+destination address+source address+data ".
Further, the second formatted data is fsk data bag, and form is " type of message+data length+random number+synchronous sequence number+data ".
The embodiment of the present invention additionally provides a kind of communication channel multiplexer, and it comprises:
The incoming call receiver module of the incoming signal of the request connection that requesting party sends is received by a communication channel;
Confirm that current is the mode decision module of the first mode of operation or the second mode of operation;
Adopt the first mode of operation to dock with requesting party, dock and successfully then receive the first formatted data and the first operational module being sent to the first backstage; And
Adopt the second mode of operation to dock with requesting party, dock and successfully then receive the second formatted data and the second operational module being sent to the second backstage.
Further, described communication channel multiplexer also comprises: docking exceedes the timeout treatment module of the scheduled time still unsuccessful then process ends.
The embodiment of the present invention additionally provides a kind of communication channel multiplex system, and described system comprises:
Produce and send request the incoming signal of connection, and carrying out the requesting party of communication when successful connection;
Communication channel multiplexer as above, described communication channel multiplexer is connected to requesting party by PSTN-E1 communication channel; And
The first backstage and second backstage of communication channel multiplexer is connected to by TCP/IP.
Further, described request side is POS terminal, and described communication channel multiplexer is net control device, and the first backstage is MODEM finance backstage, and the second backstage is FSK finance backstage.
The embodiment of the present invention judges by adopting advanced row current operation mode, then carries out the technological means of corresponding docking communication according to current operation mode, and reach fallibility little, operation cost is low, the technique effect that PSTN-E1 channel utilization index is high.
Accompanying drawing explanation
Fig. 1 is the structural representation of the communication channel multiplex system of the embodiment of the present invention.
Fig. 2 is the communication channel multiplex system theory diagram of the embodiment of the present invention.
Fig. 3 is the schematic flow sheet of the communication channel multiplexing method of the embodiment of the present invention.
Fig. 4 is a kind of preferred MODEM data packet format of the embodiment of the present invention.
Fig. 5 is a kind of preferred fsk data packet format of the embodiment of the present invention.
Fig. 6 is the schematic flow sheet of the first job step of the embodiment of the present invention.
Fig. 7 is the schematic flow sheet of the second job step of the embodiment of the present invention.
Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can be combined with each other, and are described in further detail the present invention below in conjunction with the drawings and specific embodiments.
The embodiment of the present invention uses same PSTN-E1 passage to process different MODEM and FSK voice messagings, thus different POS terminal, just can configure identical call number, reduce the possibility of makeing mistakes, in addition, POS terminal user can reduce the application quantity of PSTN-E1 passage, reduces operation cost, improves the utilance of PSTN-E1 passage.
Refer to Fig. 1 and Fig. 2, embodiments provide a kind of communication channel multiplexer 10 and system, described communication channel multiplexer 10 is preferably net control device, comprising: incoming call receiver module 11, mode decision module 12, first operational module 13 and the second operational module 14.
The incoming signal that incoming call receiver module 11 is connected for the request sent by a communication channel reception requesting party 20.Preferably, described communication channel is PSTN-E1 passage; Adopt the mode of pstn telephone incoming call to set up passage, and use same message structure to carry out transfer of data.
Mode decision module 12 is for confirming that current is the first mode of operation or the second mode of operation.
First operational module 13 adopts the first mode of operation to dock with requesting party 20, docks and successfully then receives the first formatted data and be sent to the first backstage 30.Preferably, the first mode of operation is MODEM pattern.
Second operational module 14 adopts the second mode of operation to dock with requesting party 20, docks and successfully then receives the second formatted data and be sent to the second backstage 40.Preferably, the second mode of operation is FSK pattern.
As a kind of execution mode, described communication channel multiplexer 10 also comprises: docking exceedes the timeout treatment module 15 of the scheduled time still unsuccessful then process ends.Wherein, the scheduled time can be 1 second to 20 seconds, is preferably 5 seconds.
The communication channel multiplex system of the embodiment of the present invention, comprises requesting party 20, communication channel multiplexer 10, first backstage 30 and the second backstage 40.
Requesting party 20 produces and sends request the incoming signal of connection, and carries out communication when successful connection.Preferably, requesting party 20 is POS terminal.
The structure of communication channel multiplexer 10 is described above, and is connected to requesting party 20 by PSTN-E1 communication channel.
First backstage 30 and the second backstage 40 are connected to communication channel multiplexer 10 by TCP/IP, namely carry out data communication by TCP/IP.Preferably, the first backstage 30 is MODEM finance backstage, and the second backstage 40 is FSK finance backstage.
Refer to Fig. 3, the embodiment of the present invention additionally provides a kind of communication channel multiplexing method, and described communication channel multiplexing method comprises following several step.
Incoming call receiving step S1: the incoming signal being received the request connection that requesting party 20 sends by a communication channel.
Mode decision step S2: confirm that current is the first mode of operation or the second mode of operation, if the first mode of operation then enters the first job step, if the second mode of operation then enters the second job step.
First job step S3: adopt the first mode of operation to dock with requesting party 20, docks and successfully then receives the first formatted data and be sent to the first backstage 30.Preferably, the first formatted data is MODEM packet, and form is " indexed variable+destination address+source address+data ", and Fig. 4 is just a kind of preferred MODEM data packet format.
Second job step S4: adopt the second mode of operation to dock with requesting party 20, docks and successfully then receives the second formatted data and be sent to the second backstage 40.Preferably, the second formatted data is fsk data bag, and form is " type of message+data length+random number+synchronous sequence number+data ", and Fig. 5 is just a kind of preferred fsk data packet format.
As a kind of execution mode, after described first job step S3 and the second job step S4, also comprise timeout treatment step S5: docking exceedes the scheduled time still unsuccessful then process ends, disconnects, wait for the incoming call of next pstn telephone with POS terminal.
Refer to Fig. 6, the first mode of operation is MODEM pattern, and the first job step S3 comprises following sub-step.
First sends sub-step S31: send MODEM audio signal to requesting party 20;
First docking judges sub-step S32: if receive the MODEM signal of requesting party 20 feedback, then dock successfully;
First communicator step S33: receive the first formatted data and be sent to MODEM finance backstage.
Refer to Fig. 7, the second mode of operation is FSK pattern, and the second job step S4 comprises following sub-step.
Second sends sub-step S41: send fsk data tone signal 0x81 to requesting party 20;
Second docking judges sub-step S42: if receive the fsk data tone signal 0x82 of requesting party 20 feedback, then dock successfully;
Second communication sub-step S43: receive the second formatted data and be sent to FSK finance backstage.
Art technology people be also understandable that, described first mode of operation also can be FSK pattern, and accordingly, the second mode of operation is MODEM pattern.
As a kind of execution mode, the flow process of described communication channel multiplexing method is: when receiving incoming signal, judge currently whether be in MODEM mode of operation, if then send MODEM audio signal to requesting party, if received the MODEM signal of requesting party's feedback in 5 seconds, then dock successfully, carry out MODEM modulation signal, otherwise turn to FSK mode of operation, MODEM mode of operation is not in if current, then send fsk data tone signal 0x81, if received the fsk data tone signal 0x82 of requesting party's feedback in 5 seconds, then representing docks successfully, carry out the second format data transmission, otherwise by time-out failure, terminate this flow process, wait for the incoming call of next pstn telephone.
The above is the specific embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.