CN103378931A - Data transmission method, data receiving method and signal processing module - Google Patents

Data transmission method, data receiving method and signal processing module Download PDF

Info

Publication number
CN103378931A
CN103378931A CN 201210126577 CN201210126577A CN103378931A CN 103378931 A CN103378931 A CN 103378931A CN 201210126577 CN201210126577 CN 201210126577 CN 201210126577 A CN201210126577 A CN 201210126577A CN 103378931 A CN103378931 A CN 103378931A
Authority
CN
China
Prior art keywords
data
module
audio
pole
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 201210126577
Other languages
Chinese (zh)
Inventor
王倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nationz Technologies Inc
Original Assignee
Nationz Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nationz Technologies Inc filed Critical Nationz Technologies Inc
Priority to CN 201210126577 priority Critical patent/CN103378931A/en
Publication of CN103378931A publication Critical patent/CN103378931A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data transmission method, a data receiving method and a signal processing module. Data to be sent are divided into a plurality of data packages, a control domain is added for each data package, and after values of first verification fields included by control domains of the data packages are configured directly according to the information of the data packages, the data packages and the control domains of the data packages are framed and data frames are obtained; after a receiver receives the data frames sent by a sender, the data packages and the control domains can be resolved from the received data frames, then first verification values can be obtained directly according to the information, obtained through resolving, of the data packages; the obtained first verification values are compared with the values of first check fields included by the control domains, and whether the verification is passed is judged; if the verification is not passed, a transmission error is confirmed, the sender needs to send the data frames again, and therefore the accuracy of data transmission can be improved.

Description

Data sending method, data receiving method and signal processing module
Technical Field
The present invention relates to the field of communications, and in particular, to a data transmission method, a data reception method, and a signal processing module.
Background
At present, a password key is communicated with a personal computer based on a USB interface to realize digital signature and identity authentication. With the rapid development of mobile terminals such as smart phones and tablet computers in recent years, due to the limitation of USB interfaces and the inconsistency of the common specifications of the USB interfaces of the smart phones and tablet computers, a secret key based on the USB interface cannot well meet the requirement of people for trading by using the mobile terminals anytime and anywhere, and an audio interface has a more uniform standard, so it is necessary to provide a data transmission method based on the audio interface to meet the requirement.
Disclosure of Invention
The invention aims to provide a data sending method, a data receiving method and a signal processing module, which can improve the accuracy of data transmission.
In order to solve the above technical problem, the present invention provides a data transmission method, including:
a sender sets a control domain, wherein the control domain comprises a first check field;
dividing data to be sent into a plurality of data packets, and adding the control domain to each data packet;
configuring the value of a first check field of each data packet according to the information of each data packet;
framing each data packet and the control field of each data packet to obtain a plurality of data frames to be sent;
and sending the obtained multiple data frames to a receiving party.
In an embodiment of the present invention, the first check field is a parity check field, and configuring a value of the first check field of each data packet according to information of each data packet includes: and acquiring the data length information of each data packet, and configuring the value of the first check field of each data packet according to the acquired data length information of each data packet.
In an embodiment of the present invention, the control field further includes a data length control field, and dividing the data to be sent into a plurality of data packets includes:
configuring a value of the data length control field;
and dividing the data to be sent according to the configured value of the data length control field to obtain a plurality of data packets.
In one embodiment of the present invention, the control domain further comprises a reserved field; before framing each data packet and the control field of each data packet, configuring the value of the reserved field.
In one embodiment of the invention, the control domain further comprises an address field; before framing each data packet and the control domain of each data packet, configuring the value of an address field for each data packet according to the address information of a receiver.
In one embodiment of the invention, the control domain further comprises a preamble field; before framing each data packet and the control field of each data packet, configuring the value of a preamble field for each data packet.
In one embodiment of the invention, the control domain further comprises a second check field; after configuring the value of the first check field of each data packet according to the information of each data packet, before framing the control fields of each data packet and each data packet, configuring the value of the second check field for each data packet according to the control field information of each data packet and each data packet.
In an embodiment of the present invention, the sending party is a signal processing module, the receiving party is an audio device with an audio interface, the sending party and the receiving party are in communication connection through the audio interface, and the sending party sends the obtained multiple data frames to the receiving party includes: the sender encodes the obtained data frame and converts the encoded data frame into an audio signal, and an audio signal sending module of the sender sends the obtained audio signal to a receiver through an audio interface; before the audio signal sending module of the sender sends the obtained audio signal to the receiver through the audio interface, the method further includes:
the signal processing module identifies a microphone pole and a ground pole in an audio interface of the audio equipment, the audio signal sending module is in butt joint with the identified microphone pole, the ground potential is in butt joint with the identified ground pole, and the audio signal receiving module is in butt joint with a sound channel pole of the audio interface.
In an embodiment of the present invention, a method for identifying a microphone pole and a ground pole in an audio interface by a signal processing module, butting an audio signal transmitting module against the identified microphone pole, and butting a ground potential against the identified ground pole includes:
acquiring electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment after the audio equipment starts a recording channel;
identifying the microphone pole and the ground pole from the electrical signal of each of the pair of audio input poles;
and the audio signal sending module is butted with the microphone pole, and the ground potential is butted with the ground pole.
In one embodiment of the present invention, the method for obtaining the electrical signal of each of the pair of audio input poles comprises: and establishing a current channel between the pair of audio input poles, connecting a reference ground potential into a node of the current channel, and acquiring the voltage relative value of each pole of the pair of audio input poles relative to the reference ground potential.
The invention also provides a data receiving method, which comprises the following steps:
a receiving party receives a data frame sent by a sending party;
analyzing a data packet and a control field from a received data frame, wherein the control field comprises a first check field;
obtaining a first check value according to the information of the data packet;
comparing the obtained first check value with a value of a first check field contained in the control domain; judging whether the verification passes; if not, the transmission is wrong; and if so, extracting the data packet.
In an embodiment of the present invention, the first check value is a parity check value, and obtaining the first check value according to the information of the data packet specifically obtains the first check value according to the length information of the data packet.
In an embodiment of the present invention, the control field further includes an address field, and before obtaining the first check value according to the information of the data packet, the method further includes: and judging whether the value of the address field contained in the control domain of the received data frame corresponds to the address information of the data frame, if so, obtaining a first check value according to the information of the data packet.
In an embodiment of the present invention, the control field further includes a preamble field, and before obtaining the first check value according to the information of the data packet, the method further includes: and judging whether the value of a preamble field contained in a control field of the received data frame is in a preset range, and if not, judging that the transmission is wrong.
In an embodiment of the present invention, before obtaining the first check value according to the information of the data packet, the control domain further includes a second check field, where: obtaining a second check value according to the data packet of the received data frame and the information of the control domain, and comparing the obtained second check value with the value of a second check field contained in the control domain; judging whether the verification passes; if not, the transmission error is judged.
In an embodiment of the present invention, the receiving party is a signal processing module, the sending party is an audio device with an audio interface, the receiving party and the sending party are connected in communication through the audio interface, and the receiving of the data frame sent by the sending party by the receiving party includes: the receiving party receives the audio signal sent by the sending party, converts the audio signal into a data signal and then decodes the data signal to obtain a data frame sent by the sending party; before the receiving side receives the audio signal sent by the sending side, the method further comprises the following steps: the signal processing module identifies a microphone pole and a ground pole in an audio interface of the audio equipment, the audio signal sending module is in butt joint with the identified microphone pole, the ground potential is in butt joint with the identified ground pole, and the audio signal receiving module is in butt joint with a sound channel pole of the audio interface.
In an embodiment of the present invention, a method for identifying a microphone pole and a ground pole in an audio interface by a signal processing module, butting an audio signal transmitting module against the identified microphone pole, and butting a ground potential against the identified ground pole includes:
acquiring electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment after the audio equipment starts a recording channel;
identifying the microphone pole and the ground pole from the electrical signal of each of the pair of audio input poles;
and the audio signal sending module is butted with the microphone pole, and the ground potential is butted with the ground pole.
In one embodiment of the present invention, the method for obtaining the electrical signal of each of the pair of audio input poles comprises: and establishing a current channel between the pair of audio input poles, connecting a reference ground potential into a node of the current channel, and acquiring the voltage relative value of each pole of the pair of audio input poles relative to the reference ground potential.
The invention also provides a signal processing module, which comprises a framing module and a data sending module; the framing module comprises a setting submodule, a dividing submodule, a configuration submodule and a framing submodule;
the setting submodule is used for setting a control domain, and the set control domain comprises a first check field;
the dividing submodule is used for dividing data to be sent into a plurality of data packets;
the configuration submodule is used for adding the control domain for each data packet and configuring the value of the first check field of each data packet according to the information of each data packet;
the framing submodule is used for framing each data packet and the control domain of each data packet to obtain a plurality of data frames;
and the data sending module is used for sending the plurality of data frames obtained by the framing submodule to a receiving party.
In an embodiment of the present invention, the signal processing module further includes a frame decoding module and a data receiving module, where the data receiving module is configured to receive a data frame from a sender; the de-framing module comprises a parsing submodule, a judging submodule and a data extracting submodule;
the analysis submodule is used for analyzing the data frame received by the data receiving module to obtain a data packet and a control field of the data frame, and the control field comprises a first check field;
the judgment submodule is used for obtaining a first check value according to the information of the data packet and comparing the obtained first check value with a value of a first check field contained in the control domain; judging whether the verification passes; if not, judging the transmission error; and if the data packet passes the data extraction sub-module, informing the data extraction sub-module to extract the data packet.
In an embodiment of the present invention, the signal processing module performs data interaction with an audio device through an audio interface of the audio device, the data receiving module is an audio signal receiving module, the audio signal receiving module is in butt joint with a sound channel pole of the audio interface, the data sending module is an audio signal sending module, and the signal processing module further includes a control module of an audio interface microphone pole and a ground pole; the control module of the audio interface microphone pole and the ground pole is used for identifying the microphone pole and the ground pole of the audio interface, butting the audio signal sending module with the identified microphone pole and butting the ground potential with the identified ground pole.
In an embodiment of the present invention, the control module of the audio interface microphone pole and the ground pole includes:
the acquisition module is used for acquiring the electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment after the audio equipment starts a recording channel;
the identification module is used for identifying the microphone pole and the earth pole according to the electric signals of each pole in the pair of audio input poles;
and the port switching module is used for butting the audio signal sending module with the microphone electrode and butting the ground potential with the ground electrode after the identification module identifies the microphone electrode and the ground electrode.
In an embodiment of the present invention, the obtaining module is a voltage detecting module, and is configured to directly detect a voltage of each of a pair of audio input poles in an audio interface of the audio device after the audio device starts a recording channel.
In an embodiment of the present invention, the obtaining module is a voltage domain converting module, configured to establish a current channel between the pair of audio input poles, connect a reference ground to a node of the current channel, and obtain a voltage relative value of each of the pair of audio input poles with respect to the reference ground.
In one embodiment of the invention, the identification module includes a first identification submodule for detecting positive and negative characteristics of a voltage relative value of each of the pair of audio input poles, and identifying the microphone pole and the ground pole according to the detection result.
In one embodiment of the invention, the identification module comprises:
the second identification submodule is used for comparing the voltage relative value of each of the pair of audio input poles with the reference ground potential and outputting a digital level signal according to the comparison result of each voltage relative value;
and the logic judgment module is used for identifying the microphone pole and the earth pole according to the two digital level signals output by the second identification submodule.
The invention has the beneficial effects that:
according to the method, data to be sent are divided into a plurality of data packets, a control field is added to each data packet, and after the control field of each data packet is configured with a value containing a first check field according to information of each data packet, each data packet and the control field of each data packet are framed to obtain a data frame; after receiving the data frame of the sender, the receiver can analyze the data packet and the control field from the received data frame, and then directly obtain a first check value according to the information of the data packet obtained by analysis; comparing the obtained first check value with a value of a first check field contained in a control domain, and judging whether the check is passed; if not, the data frame is considered to be transmitted in error, and the sender is required to retransmit the data frame; if the data packet passes, the data packet is directly extracted. The invention directly sets the first check value in the transmitted data frame according to the information of the data packet, and after the receiver receives the data frame, the invention can directly judge whether the received data frame is correct according to the analyzed information of the data packet, thereby improving the accuracy of data transmission.
Drawings
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a data receiving method according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a data frame in a data transmission method according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of dual-channel transmission in a data sending and receiving method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a signal processing module according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a control module of the audio interface MIC pole and GND pole in the signal processing module shown in FIG. 5;
FIG. 7 is another schematic diagram of a control module of the audio interface MIC pole and GND pole of the signal processing module shown in FIG. 5;
FIG. 8 is a schematic diagram of another structure of a control module of the audio interface MIC pole and GND pole in the signal processing module shown in FIG. 5;
fig. 9 is a schematic diagram of an equivalent circuit configuration of a control module of the MIC pole and the GND pole of the audio interface shown in fig. 8;
FIG. 10a is a schematic diagram of a voltage domain conversion module in the circuit configuration shown in FIG. 9;
FIG. 10b is another schematic diagram of a voltage domain conversion module in the circuit configuration shown in FIG. 9;
FIG. 10c is another schematic diagram of a voltage domain conversion module in the circuit configuration shown in FIG. 9;
FIG. 10d is another schematic diagram of a voltage domain conversion module in the circuit configuration shown in FIG. 9;
FIG. 11 is a diagram of a first audio signal conversion module of the signal processing module shown in FIG. 5;
FIG. 12 is a diagram of a second audio signal conversion module of the signal processing module shown in FIG. 5;
fig. 13 is a schematic structural diagram of a signal processing module according to an embodiment of the present disclosure;
fig. 14 is a schematic structural diagram of a signal processing module according to an embodiment of the present disclosure;
fig. 15 is a schematic structural diagram of a signal processing module according to an embodiment of the present disclosure;
fig. 16 is a flowchart of a signal processing method of the signal processing module shown in fig. 15.
Detailed Description
According to the technical scheme, the value of the first check field is set in the data frame according to the information of the data packet of the data frame, so that after the data frame is received by the receiver, the first check value can be directly obtained according to the data packet information of the data frame to be compared with the value of the first check field set in the data frame by the sender, whether the transmission of the data frame is correct or not is judged, and the accuracy of data transmission can be improved. The technical solution is further explained in detail by the following embodiments with reference to the accompanying drawings.
Referring to fig. 1, the sending party in this embodiment may include the following steps when sending data:
step 101: a sender sets a control domain, and the set control domain comprises a first check field;
step 102: dividing data to be sent into a plurality of data packets, and adding a control domain to each data packet;
step 103: configuring the value of a first check field of each data packet according to the information of each data packet;
step 104: then framing each data packet and the control field of each data packet to obtain a plurality of data frames to be sent;
step 105: and sending the obtained multiple data frames to a receiving party.
In step 102, when the data to be sent is divided into a plurality of data packets, the length of each data packet may be specifically selected and set according to the requirements of the current communication, and a specific division manner may also be selected according to the actual situation, for example, the data to be sent may be divided into a plurality of data packets with equal lengths; the data to be transmitted can also be divided into a plurality of data packets according to a preset division length, and the length of the last data packet obtained by division is less than or equal to the set division length. The control field in this embodiment may further include a data length control field, a value of the data length control field is set according to the actual length of the data packet, and after the receiver parses the value of the data length control field, the actual length of the data packet of the data frame may be obtained.
In step 103, a specific implementation manner of configuring the value of the first check field of each data packet according to the information of each data packet may also be selected according to an actual situation, for example, the value of the first check field may be obtained by performing an accumulation calculation on all fields included in the data packet, and using the obtained accumulation sum as the value of the first check field; the value of the first check field corresponding to the data packet may also be directly configured according to the data length information of the data packet, the first check field at this time may be set as a parity field, and the value of the parity field may be directly set according to whether the value of the data length of the data packet is an odd number or an even number, for example, when the value of the data length of the data packet is an odd number, the value of the parity field is set as 1, and when the value of the data length of the data packet is an even number, the value of the parity field is set as 0, and in this embodiment, it is preferable that the first check field is a parity field. It should be noted that, in this embodiment, the number of the first check fields corresponding to each data packet is not limited to one, and multiple first check fields may be optionally set according to actual situations, for example, if the data packet includes 0 to 9 bytes, a first check field may be set corresponding to 0 to 5 bytes of the data packet, and a second first check field may be set corresponding to 6 to 9 bytes of the data packet; when a plurality of first check fields are set, the accuracy of data transmission can be further improved.
Referring to fig. 2, the receiving side in this embodiment may include the following steps when receiving data sent by the sending side:
step 201: a receiving party receives a data frame sent by a sending party;
step 202: analyzing a data packet and a control field from a received data frame, wherein the analyzed control field comprises a first check field, namely a value of the first check field set by a sender;
step 203: obtaining a first check value according to the analyzed information of the data packet;
step 204: comparing the obtained first check value with the value of a first check field contained in the control domain; judging whether the check is passed or not, if the judgment result is that the check is not passed, judging that the transmission of the data frame is wrong and requiring the retransmission of a sender; if the judgment result is that the data frame passes, extracting the data packet of the data frame; the condition of judging whether the verification passes can be that whether the obtained first check value is the same as the value of the first check field contained in the control domain, if so, the verification passes, otherwise, the verification fails, and the received data is in error.
In step 202, when the first check field set in the control field of the data frame by the sender is a parity field, the value of the first check field included in the control field parsed by the receiver is a parity value. Correspondingly, the first check value obtained according to the analyzed information of the data packet in step 203 is also a parity check value, and in step 203, the parity check value can be obtained according to the analyzed length information of the data packet; when the first check field set in the control field of the data frame by the sender is the accumulated sum obtained by performing accumulated calculation on all fields included in the data packet, the value of the first check field included in the control field analyzed by the receiver is the accumulated sum, in step 203, the accumulated sum is obtained by specifically performing accumulated calculation on all fields of the data packet, and the obtained accumulated sum and the analyzed accumulated sum are compared and verified.
As can be seen from the above, in the communication process of data transmission between two parties, the data to be transmitted can be assembled into a data frame, and the value of the first check field can be directly set according to the information of the data packet of the data frame, so that after the receiving party receives the data frame, the first check value can be directly obtained according to the information of the data packet of the data frame to be compared with the value of the first check field set in the data frame by the sending party, so as to determine whether the transmission of the data frame is correct, and the accuracy of data transmission can be improved
The control field included in the data frame may further include a reserved field, which may be used as a spare field of the data frame, so as to facilitate the user to perform function expansion according to the actual situation, and the length of the reserved field may also be set according to the actual situation. When the control field of the data frame further includes a reserved field, a step of configuring a value of the control field reserved field may be further included before step 104 shown in fig. 1. The step of configuring the value of the reserved field may be performed in any step prior to step 104. The specific value of the configured reserved field can also be defined according to the function selection of the specific implementation. For example, when it is required to be clear that the currently transmitted or received data frame is the second data frame in the data transmission process, the reserved field may be enabled, and the value of the reserved field may be set as the sequence number of the data frame.
For a communication environment with large signal interference, the control field of the data frame may further include a preamble field; therefore, before step 104 shown in fig. 1, a step of configuring a value of the control domain preamble field may be further included; the step of configuring the value of the preamble field may be performed in any step before step 104, and there is no strict timing limitation with the step of configuring the reserved field, and both may be performed simultaneously or in different steps.
The preamble field of the control field is used for setting the preamble of the data frame, and the length N of the preamble field can also be selectively set according to the strength of the signal interference caused by the communication environment, and the specific setting mode of the preamble can also be set according to actual selection, as long as the signal interference can be prevented, and the receiver can realize the bit synchronization and the frame synchronization of the data frame when receiving the data frame. For example, the preamble is specifically set to be formed by consecutive M bits 0 plus 1 bit 1, where bit 1 is a preamble end identifier; when the signal interference is strong, the length N of the preamble field may be optionally set to a larger value, for example, the value of N is set to 33 bits, the value of the configured preamble field (i.e., the preamble) is 000000000000000000000000000000001, and the value of M is 32; when the signal interference is weak, N may be set to a small value, for example, the value of N is set to 9 bits, the value of the configured preamble field is 000000001, and the value of M is 8. Obviously, the length N of the preamble field set in the present embodiment is not limited to the above two types, but may be adjusted adaptively according to the degree of signal interference, and preferably, the value of N may be set to 9 bits, 17 bits, 25 bits, or 33 bits according to the specific application environment. By setting the lead code, data transmission errors caused by signal interference can be avoided, and the bit synchronization of the data frame is realized.
Correspondingly, before step 203 shown in fig. 2, the method may further include determining whether a value of a preamble field included in a control field of the received data frame is within a preset range, and if not, determining that the transmission is erroneous; if the range is within the preset range, it indicates that the preamble of the frame is found, and the bit synchronization and the frame synchronization of the data frame are achieved, and then step 203 is performed. It should be understood that the preset range in this embodiment also changes with a change in the length N of the preamble field, for example, when the selected value N is 9 bits (i.e. 8 bits 0 plus 1 bit), the preset range may be that the number of consecutive bits 0 included in the value of the preamble field is greater than 4, that is, it is determined that there are at least 4 consecutive bits 0 in the value of the preamble field included in the control field of the received data frame, that is, it may be determined that the preamble of the data frame is found, and therefore bit synchronization of the data frame is achieved, and when a bit 1 is found after the consecutive 0 bits, it is determined that the preamble end identifier is found, and therefore frame synchronization of the data frame is achieved; when the selected N value is 33 bits (i.e., 32 bits 0 plus one bit 1), the preset range may be that the number of consecutive bits 0 included in the value of the preamble field is greater than 10, that is, it is determined that there are at least 10 consecutive bits 0 in the value of the preamble field included in the control field of the received data frame, that is, it is determined that the preamble of the data frame is found, and bit synchronization of the data frame is achieved.
Further, the control field of the data frame may further include an address field; therefore, before step 104 shown in fig. 1, a step of configuring a value of an address field of a control domain may be further included; the step of configuring the value of the address field may be performed in any step prior to step 104, and there is no strict timing restriction with the step of configuring the reserved field and the step of configuring the preamble field. The address field can be used for configuring the address information of a receiver, and the length of the address field can also be selected and configured according to the actual situation, for example, when the length of the address field is configured to be 0 bit, the address field is equivalently forbidden to be used, and at the moment, two communication parties can directly communicate without appointing addresses; when the address field is used, the length of the address field is configured to be larger than 0 bit, the specific value of the address field can be specifically agreed by both communication parties, and the subsequent processing process can be started only when the receiver receives the address information which is configured to be the same as the address information of the receiver; otherwise the received data is ignored.
Correspondingly, when both communication parties use the address field, before step 203 shown in fig. 2, the method may further include determining whether a value of the address field included in the control field of the received data frame corresponds to the own address information, and if so, performing a subsequent processing procedure; and if not, ignoring the received data frame and not carrying out subsequent processing on the data frame. That is, the receiver in this embodiment may agree with the sender for the address, and after receiving the data frame, the receiver may directly determine whether to perform subsequent processing on the data frame according to whether the value of the address field of the data frame control field corresponds to its own address, so that the efficiency of data transmission and processing may be improved.
It should be noted that the step of determining whether the value of the address field included in the control field of the received data frame corresponds to the self address information in this embodiment may be performed after the step of determining whether the value of the preamble field included in the control field of the received data frame is within the preset range.
In the above embodiment, each data frame is only a first check value obtained according to the data packet information of the data frame to verify whether the data packet of the received data frame is correct, and in order to further improve the accuracy of data transmission and improve the efficiency of data transmission, the control field of the data frame may further include a second check field; therefore, after the step 103 and before the step 104 shown in fig. 1, configuring the value of the second check field for each data packet according to each data packet and the control domain information of each data packet; when the value of the second check field is configured for each packet based on the control field information of each packet and each packet, specifically, the value of the second check field is configured based on the information of the other fields except the preamble field included in the control field of each packet and each packet. The value of the second check field may be set in the same manner as the value of the first check field described above. Preferably, the accumulated sum obtained by performing accumulated calculation with a carry-in function on the data packets and other fields except the preamble field included in the control field of each data packet is used as the value of the second check field, the value of the second check field can be set to be 8-bit mode or 16-bit mode, and when the value is selected to be 8-bit mode, the accumulated sum exceeding 8 bits is discarded; when the 16-bit mode is selected, the accumulated sum exceeds the lower 8-bit part to carry to the upper 8 bits, and the exceeding upper 8-bit part is discarded.
Correspondingly, before step 203 shown in fig. 2, after the step of determining whether the value of the preamble field included in the control field of the received data frame is within the preset range and the step of determining whether the value of the address field included in the control field of the received data frame corresponds to the own address information, the method may further include: obtaining a second check value according to the data packet of the received data frame and the information of the control domain, and comparing the obtained second check value with the value of a second check field contained in the control domain; judging whether the verification passes; if not, judging that the transmission is wrong, and waiting for the sender to retransmit the data frame; if the check is passed, the subsequent processing is continued.
That is, in this embodiment, the method includes the step of performing two different checks on the received data frame, so as to further ensure the accuracy of data transmission.
The signal processing module provided by the invention is described in detail below with reference to embodiments and drawings.
The signal processing module disclosed by the embodiment of the invention comprises a framing module and a data sending module; the framing module comprises a setting submodule, a dividing submodule, a configuration submodule and a framing submodule; wherein,
the setting submodule is used for setting a control domain, and the set control domain comprises the first check field;
a dividing submodule for dividing the data to be transmitted into a plurality of data packets according to the method;
the configuration submodule is used for adding a control domain for each data packet and configuring the value of a first check field of each data packet according to the information of each data packet by the method;
the framing submodule is used for framing each data packet and the control domain of each data packet according to the method to obtain a plurality of data frames;
the data sending module is used for sending the plurality of data frames obtained by the framing submodule to a receiving party; in this embodiment, the data sending module may specifically select a mode of modulating a plurality of data frames obtained by the framing submodule into an audio signal and send the audio signal to the receiving party.
The configuration submodule in this embodiment may be further configured to configure a value of the reserved field and/or a value of the preamble field and/or a value of the address field for the control field of the data frame according to the above-mentioned method.
The signal processing module in this embodiment may further include a deframing module and a data receiving module; the de-framing module comprises an analysis submodule, a judgment submodule and a data extraction submodule; wherein,
the data receiving module is used for receiving data frames from a sender;
the analysis submodule is used for analyzing the data frame received by the data receiving module according to the method to obtain a data packet and a control field of the data frame, and the control field obtained by analysis contains a first check field configured by sending;
the judging submodule is used for obtaining a first check value according to the information of the data packet according to the method, and comparing the obtained first check value with the value of a first check field contained in the control domain; judging whether the verification passes; if not, judging the transmission error; and if the data packet passes the data extraction sub-module, informing the data extraction sub-module to extract the data packet.
The determining sub-module in this embodiment is further configured to determine, according to the above-mentioned method, whether a value of a preamble field of the received data frame is within a preset range, and/or whether a value of an address field of the received data frame corresponds to address information of the receiving party itself, and/or determine whether a second check value obtained according to the data packet of the received data frame and the control field information is the same as a value of a second check code set by the sending party.
When the signal processing module provided by the technical scheme is applied to a communication system consisting of audio equipment with an audio interface and the signal processing module working in cooperation with the audio equipment, the audio equipment and the signal processing module are two communication parties, the two communication parties exchange data through the audio interface, the signal processing module is used as a sending end when sending data to the audio equipment, and is used as a receiving end when receiving the data sent by the audio equipment; likewise, the audio devices may also act as a sender and a receiver. In order to better understand the technical solution, the following further describes the technical solution by taking the signal processing module as a sender and the audio device as a receiver as an example.
In this embodiment, after dividing data to be transmitted into data packets and configuring a control field for each data packet to form a data frame, the formed data frame includes, as shown in fig. 3, a preamble field, an address field, a reserved field, a first check field, a data length control field, a data packet, and a second check field, where except for the data packet, other fields all belong to the control field of the data frame. In addition, the preamble field, the address field, the reserved field, and the second check field in this embodiment may be selectively configured, and the position of each field in the data frame is not unique and may be adjusted according to actual needs. The following specific configurations of the fields included in the data frame are respectively illustrated:
1. a preamble field:
the preamble in this embodiment is formed by adding 1 bit 1 to M consecutive bits 0, for example:
9-bit pattern: 00000000_1
17 bit pattern: 00000000_00000000_1
25-bit pattern: 00000000_00000000_00000000_1
33-bit mode: 00000000_00000000_00000000_00000000_1
Bit 0 in the preamble field may be interfered, and the receiving side can receive enough bit 0 by selecting different data lengths of the preamble field, so as to realize the bit synchronization of the frame; bit 1 is a preamble end field of the preamble, and when the receiver finds bit 1 after a plurality of consecutive bits 0, the preamble is considered to be ended, thereby realizing frame synchronization of the data frame.
2. An address field:
the address field can also implement differentiation of different devices in addition to the four described functions of the above embodiment, so as to implement a bus connection mode by fixing an address for each device.
3. A reserved field:
the length of the reserved field in this embodiment is 4 bits, and the user can set the value of the reserved field to customize some expansion functions specifically required for current communication.
4. A first check field:
the first check field in this embodiment includes two, each field includes one bit, and the two fields respectively correspond to the high 4 bits and the low 6 bits of the data length control field; the first check field is set according to the actual length of the data packet with 4 high bits and 6 low bits.
5. Data length control field:
the data length field in this embodiment includes 10 bits, which are sequentially bit 0 to bit 9, bit 9 to bit 6 are high 4 bits, bit 0 to bit 5 are low 6 bits, and the value of the data length control field may be set as:
when the data length control field value is 001H, the length of the divided data packet is 1 byte;
when the data length control field value is 0FFH, the length of the divided data packet is 255 bytes;
when the data length control field value is 3FFH, the length of the divided data packet is 1023 bytes;
when the data length control field value is 000H, it means that the length of the divided packet is 1024 bytes.
6. Data packet:
a data packet is the actual data that needs to be transmitted, and its maximum data length (in bytes) may be 1 kbyte. When data in the data packet is extracted for transmission, a big-end mode, namely first-in first-out, can be adopted for transmission, and a small-end mode, namely first-in last-out, can also be adopted for transmission. When data is transmitted through the audio interface, single channel transmission may be performed, or dual channel transmission may be performed, for example, left and right channels are simultaneously used for transmission, please refer to fig. 4, where the left channel (AFL channel) is used for transmitting odd bytes, the right channel (AFR channel) is used for transmitting even bytes, when the total length of the data packet bytes is odd, the last valid byte B2n-1 is transmitted through the AFL channel, and at this time, the AFR channel transmission B2n is invalid (NULL) bytes, and should be discarded.
7. Second check field
The second check field may be configured in 0/8/16 bit mode, with a 0 bit mode indicating that use of the second check function is prohibited.
The check field in this embodiment is a result obtained by performing an accumulation calculation (CheckSum) with a carry-in function on all bytes of the data frame from the address field to the data packet. In the 8-bit mode, the accumulated sum is discarded beyond 8 bits; in the 16-bit mode, the accumulated sum exceeds the lower 8-bit portion to carry to the upper 8 bits, and the exceeding upper 8-bit portion is discarded.
Based on the above data frame structure, the following describes the flow of framing at the transmitting side and deframing at the receiving side in further detail:
and a sending party framing flow:
a) providing data to be transmitted by a transmission layer of a signal processing module;
b) in a link layer, dividing data to be transmitted into a plurality of data packets according to a data length control field value, configuring a first check value, a reserved field value and a value of an address field for each data packet, and forming a frame fragment of 'address field + reserved field + first check field + data length control field + data packet' in the link layer;
c) carrying out carry accumulation calculation on all bytes of the frame segment, and loading a calculation result to the back of the frame segment to form the frame segment of 'address field + reserved field + first check field + data length control field + data packet + second check field';
d) setting a lead code field for the frame segment in the last step to form a whole frame consisting of the lead code field, the address field, the reserved field, the first check field, the data length control field, the data packet and the second check field;
e) the whole frame data is signal modulated to form a physical layer bit sequence, and it is noted that, in the modulation process, when differential manchester coding is used, one bit on the link layer corresponds to two bits on the physical layer, i.e., two bits on the physical layer constitute one bit on the link layer.
The receiving side deframing flow:
a1) at the physical layer of the audio device, demodulating the received data (when using differential Manchester coding, two bits on the physical layer constitute one bit on the link layer) to form a link layer bit sequence, and performing bit synchronization and frame synchronization on the bit sequence of the data frame according to the preamble field of the data frame;
b1) at a link layer of the audio equipment, analyzing a lead code field, an address field, a reserved bit field, a first check field, a data length control field, a data packet and a second check field from the whole frame;
c1) carrying out accumulation carry calculation on an address field, a reserved bit field, a first check field, a data length control field and all bytes of a data packet, and comparing an obtained result with a value of a second check field; if the data is inconsistent, the data is considered to be transmitted wrongly, and the decoding is finished; if the transmission is correct, the transmission is considered to be correct, and the following steps are continued;
d1) judging whether the address information represented by the value of the address field is matched with the address information of the receiver; if not, discarding the data frame; if so, continuing the following steps;
e1) obtaining a first check value according to the length information of the data packet, comparing the first check value with the value of the first check field, and if the first check value is inconsistent with the value of the first check field, determining that the transmission is wrong; if the transmission is consistent with the transmission standard, the transmission is considered to be correct, and the following steps are continued;
f1) and extracting data of the response length from the data packet to the transport layer according to the value of the data length control field.
According to the technical scheme, data to be sent are divided into a plurality of data packets, a control field is added to each data packet, the control field of each data packet is configured with a value containing a first check field according to information of each data packet, and then framing is carried out on each data packet and the control field of each data packet to obtain a data frame; after the receiving party receives the data frame, whether the received data frame is correct can be directly judged according to the analyzed information of the data packet, and the accuracy of data transmission can be improved.
According to the technical scheme, the second check field can be further configured, and the data frame can be checked through the configured second check field before the data frame is checked according to the first check field, namely, the technical scheme can check the agreed data frame twice according to different check conditions, and the accuracy of data transmission can be further improved.
When the signal processing module provided by the invention communicates with the audio equipment based on the audio interface, the positions of a Microphone (MIC) pole and a Ground (GND) pole in the audio interface are different from each other for different audio equipment, such as a samsung mobile phone and an apple mobile phone, and the positions of the MIC pole and the GND pole in the audio interface are opposite. Only by butting the GND electrode of the audio equipment with the ground potential of the external equipment, the ground potential can be uniformly referenced, signal analysis can be normally carried out, and meanwhile, only by butting the MIC electrode of the audio equipment with the audio output end of the external equipment, the external equipment can obtain a sending channel. In view of this, for the problem that the MIC pole and the GND pole in the audio interface are not fixed in the prior art, which results in that data communication cannot be performed, the signal processing module provided in this embodiment further includes a control module 1 of the MIC pole and the GND pole of the audio interface, an audio signal receiving module 2, a first audio signal conversion module 3, a second audio signal conversion module 4, and an audio signal sending module 5. The signal processing module can be arranged in external equipment, and can also be used as an intermediate structure between audio equipment and the external equipment to perform data interaction with the audio equipment through an audio interface of the audio equipment.
The control module 1 of the MIC pole and the GND pole of the audio interface is used for identifying the MIC pole and the GND pole of the audio interface, after identification, the ground potential of the signal processing module self equipment is butted with the identified GND pole, so that the signal processing module is unified with the reference ground potential of the audio equipment, and the audio signal sending module 5 is butted with the identified MIC pole, so that a sending channel for sending data to the audio equipment by the signal processing module is established. Because the position of the audio channel pole (including the left/right/MOMO channel) in the audio interface is usually fixed, the audio signal receiving module in the external device and the audio channel pole of the audio interface can automatically complete the butt joint after the audio device starts the recording channel, and a receiving channel for the signal processing module to receive data from the audio device is established. The audio signal receiving module 2 is configured to receive an audio signal from an audio device through a channel pole of an audio interface and transmit the received audio signal to the first audio signal conversion module 3, the first audio signal conversion module 3 is configured to convert the audio signal from the audio device into a digital signal, the second audio signal conversion module 4 is configured to convert the digital signal to be sent to the audio device into an audio signal, and the audio signal sending unit 5 is configured to send the audio signal converted by the second audio signal conversion module 4 to the audio device through a MIC pole of the audio interface.
Fig. 6 shows an implementation of the control module 1 of the signal processing module of fig. 5 with the MIC pole and the GND pole of the audio interface. Comprises an acquisition module 121, an identification module 122 and a port switching module 123. The acquiring module 121 is configured to acquire an electrical signal of each pole of a pair of audio input poles in an audio interface of the audio device after the audio device starts a recording channel, the identifying module 122 is configured to identify an MIC pole and a GND pole according to the electrical signals of the two poles acquired by the acquiring module 121, and the port switching module 123 is configured to automatically dock the ground potential of the signal processing module itself with the identified GND pole after the identifying module 122 identifies the MIC pole and the GND pole, so as to unify the reference ground potential of the signal processing module and the audio device, and automatically send the audio signal to the module 5 and the identified MIC pole.
In an embodiment of the present invention, the obtaining module 121 is a voltage detecting module, and by means of the precondition that after the existing audio device starts the recording channel, the MIC pole has a voltage higher than that of the GND pole, the voltage detecting module directly detects the voltage of each of a pair of audio input poles in the audio interface of the audio device after the audio device starts the recording channel, and the identifying module 122 identifies the MIC pole and the GND pole according to two voltage values detected by the voltage detecting module.
Fig. 7 shows another implementation of the control module 1 of the signal processing module of fig. 5 with the MIC pole and the GND pole of the audio interface. Including a voltage domain conversion module 141 and a first identification submodule 142. The voltage domain converting module 141 establishes a current channel between the pair of audio input poles in the audio interface by using the precondition that the MIC pole has a voltage higher than the GND pole after the existing audio device starts the recording channel, connects a reference ground potential into a node of the current channel, and obtains a voltage relative value of each pole of the pair of audio input poles with respect to the reference ground potential, wherein the reference ground potential refers to a common ground potential of the external device and the control module, and since the MIC pole has a voltage higher than the GND pole after the audio device starts the recording channel, on the current channel established by the voltage domain converting module 141, a current must flow from the MIC pole to the GND pole, the reference ground potential is 0, then the voltage relative value of the MIC pole with respect to the reference ground potential must be a positive value, and the voltage relative value of the GND pole with respect to the reference ground potential must be a negative value, therefore, the voltage domain converting module 141 outputs a positive voltage relative value and a negative voltage relative value. The first identification sub-module 142 identifies the MIC pole and the GND pole by detecting positive and negative characteristics of the relative values of the voltages, the positive pole being the MIC pole and the negative pole being the GND pole.
Fig. 8 shows another implementation of the control module 1 of the signal processing module of fig. 5 with the MIC pole and the GND pole of the audio interface. This embodiment differs from the embodiment shown in fig. 7 in that the first identification submodule 142 of the embodiment shown in fig. 7 is replaced by a second identification submodule 151 and a logic determination module 152, i.e. the control module 1 of the audio interface MIC pole and GND pole in this embodiment comprises a voltage domain conversion module 141, a second identification submodule 151 and a logic determination module 152. The voltage domain converting module 141 still uses the precondition that after the recording channel is opened by the existing audio device, the MIC pole has a voltage higher than the GND pole, a current channel is established between the pair of audio input poles in the audio interface, a reference ground potential is connected to a node of the current channel, and a voltage relative value of each pole of the pair of audio input poles with respect to the reference ground potential is obtained. The second identification sub-module 151 includes two comparison modules, a first comparison module 151a and a second comparison module 151b, the first comparison module 151a is configured to compare a voltage relative value output by the voltage domain conversion module 141 with a reference ground potential, and output a digital level signal according to a comparison result; the second comparing module 151b is configured to compare the other voltage relative value output by the voltage domain converting module 141 with the reference ground potential, and output another digital level signal according to the comparison result. The logic judgment module 152 is configured to identify the MIC pole and the GND pole according to the digital level signals output by the first comparison module 151a and the second comparison module 151 b. Assuming that the comparison rule of the first comparing module 151a and the second comparing module 151b is that when the voltage relative value is greater than the reference ground, a level 1 is output, and when the voltage relative value is less than the reference ground, a level 0 is output (in practical application, the opposite is also possible), when the outputs of the first comparing module 151a and the second comparing module 151b are both level 0, it indicates that the audio device has not opened the recording channel or the plug of the external device has not been inserted into the audio interface, and when any one of the outputs is level 1, it indicates that the audio device has opened the recording channel, the logic determining module 152 identifies the pole corresponding to the level 1 as the MIC pole, and identifies the pole corresponding to the level 0 as the GND pole.
The identification module 1 of the MIC pole and the GND pole of the audio interface shown in fig. 8 may be implemented in the form of a circuit. As shown in fig. 9, an equivalent circuit configuration is shown. Comprises a voltage domain conversion module 191, a first comparator 192, a second comparator 193, a logic judgment module 194 and a port switch 195. The voltage domain conversion module 191 is connected to an electrical signal of each of a pair of audio input poles of the audio device through corresponding ring segments (a segment and B segment) of the plug, the voltage domain conversion module 191 adopts a form of resistance voltage division, as shown in fig. 10a, the voltage domain conversion module includes a first resistor R1 and a second resistor R2 connected in series between a pair of audio input poles (corresponding to the a segment and the B segment of the plug) in the audio interface, an intermediate node of the first resistor R1 and the second resistor R2 is connected to a reference ground potential AFG, and R1 is R2, and AFG is 0. Since the MIC pole has a voltage higher than the GND pole after the recording channel is opened by the conventional audio device, assuming that the voltage difference between the MIC pole and the GND pole is Δ V, the two voltage relative values output by the voltage domain converting module 120 with respect to the reference ground are 1/2 Δ V and-1/2 Δ V, respectively. The first comparator 192 has an input terminal connected to a voltage relative value output by the voltage domain converting module 191, another input terminal connected to the reference ground AFG, and an output terminal outputting a digital level signal according to the comparison result, wherein if the voltage relative value is greater than the reference ground AFG, a level 1 is output, otherwise, a level is output. The second comparator 193 has an input terminal connected to the other voltage relative value output by the voltage domain converting module 191, another input terminal connected to the reference ground AFG, and an output terminal outputting another digital level signal according to the comparison result, and if the voltage relative value is greater than the reference ground AFG, outputs a level 1, otherwise outputs a level. The logic determination module 194 has an input connected to the output end of the first comparator 192, and another input connected to the output end of the second comparator 193, and when the outputs of the first comparator 192 and the second comparator 193 are both level 0, it indicates that the audio device has not started the recording channel or the plug externally connected to the signal processing module has not been inserted into the audio interface, and when any one of the outputs is level 1, it indicates that the audio device has started the recording channel, identifies the pole corresponding to the level 1 as the MIC pole, identifies the pole corresponding to the level 0 as the GND pole, and outputs the identification result to the port switch 195. The port switch 195 automatically connects the ground potential (AFG) of the signal processing module itself to the recognized GND terminal, so as to unify the reference ground potentials of the signal processing module and the audio device, and connects the audio signal transmitting module 5(AFG) to the recognized MIC terminal, so as to establish a channel for transmitting data to the audio device.
The voltage domain converting module 191 may also adopt a form of capacitive voltage division, as shown in fig. 10b, and includes a first capacitor C1 and a second capacitor C2 connected in series between a pair of audio input electrodes in the audio interface, an intermediate node between the first capacitor C1 and the second capacitor C2 is connected to a reference ground potential AFG, and the first capacitor C1 and the second capacitor C2 have the same functions as the R1 and R2 in fig. 10 a.
The voltage domain converting module 191 may also adopt a MOS transistor voltage dividing form, as shown in fig. 10c, including a first MOS transistor N1 and a second MOS transistor N2 connected in series between a pair of audio input electrodes in the audio interface, where an intermediate node between the first MOS transistor N1 and the second MOS transistor N2 is connected to a reference ground AFG, and further including a current source I and a third MOS transistor N3 for providing gate currents for the first MOS transistor N1 and the second MOS transistor N2. The gate voltages of the first MOS transistor N1, the second MOS transistor N2 and the third MOS transistor N3 are connected to form a current mirror, the current source I flows through the third MOS transistor N3, and the drain-source resistance RDS of the first MOS transistor N1 and the second MOS transistor N2 have the same functions as those of R1 and R2 in fig. 10 a. Referring to fig. 10d, which is a further improvement of the voltage domain converting module 191 shown in fig. 10c, as shown in the voltage domain converting module 191 shown in fig. 10d, a protection resistor R1 ', R2', R1 'and R2' are respectively connected between the audio input electrode and the first MOS transistor N1 and the second MOS transistor N2 to respectively perform the function of electrostatic protection.
Fig. 11 shows an embodiment of the first audio signal conversion module 3 in the signal processing module shown in fig. 5. Comprising a dc conversion module 31 and a comparison module 32. This embodiment is suitable for transmitting data in one channel and also suitable for transmitting data in two channels simultaneously, and when data is transmitted using two channels simultaneously, the amount of data transmitted in the same time period is twice that transmitted using one channel. Corresponding to the number of the sound channels in the audio interface, the comparison module 32 is configured with a corresponding number of sub-comparison modules, which in this embodiment is configured with a sub-comparison module 32a corresponding to the left sound channel and a sub-comparison module 32b corresponding to the right sound channel. Since the audio signal output from the channel pole of the audio interface is usually an ac voltage signal, the dc conversion module 31 is configured to convert the audio signal received by the audio signal receiving module 2 from the channel pole of the audio interface into a dc signal in the form of an ac voltage. Preferably, the dc conversion module 31 has a function of clamping a central level of an input signal, so that original ac signals of left and right channels are changed into signals having a certain dc component, and the specific manner may be: a positive dc voltage VDC _ a, preferably half the supply voltage VDD, is superimposed on the ac voltage signal output by the channel poles, and both channel poles of the audio interface are connected to a resistor, preferably 32 Ω or 16 Ω, to ground. The sub-comparing module 32a and the sub-comparing module 32b corresponding to the right channel are configured to compare the dc signal converted by the dc converting module 31 with the superimposed dc voltage VDC _ a, and send a comparison result, if the dc signal converted by the dc converting module 31 is greater than VDC _ a, a high level is output, otherwise, a low level is output.
The signal processing module shown in fig. 5 may also include a spur filtering module. The digital signal processing circuit is used for carrying out burr filtering processing on the digital signal obtained after the conversion of the first audio signal conversion module 3 and filtering out signal burrs of the first audio signal conversion module 3 caused by circuit and signal noise.
Fig. 12 shows an embodiment of the second audio signal conversion module 4 in the signal processing module shown in fig. 5. The second audio signal conversion module 4 employs a current-mode DAC, which extracts a varying current from the MIC pole of the audio interface according to a digital signal to be transmitted to the audio device, because a resistor is usually connected to the MIC pole in the existing audio interface, when the extracted current varies, the voltage on the MIC pole varies, and by changing the voltage on the MIC pole, the conversion from the digital signal to the audio signal is realized, and at the same time, the audio signal is input to the audio device from the MIC pole.
In an embodiment of the present invention, the signal processing module shown in fig. 5 further includes an amplitude/center level control module, where the amplitude/center level control module is configured to control the amplitude and the center level of the audio signal output by the second audio signal conversion module 4, and since the amplitude and the center level of the audio signal matched with the audio interface of different audio devices are different, the audio interface can be better compatible with the audio interfaces of different audio devices through the control of the amplitude/center level control module.
In an embodiment of the present invention, as shown in fig. 13, the signal processing module includes, in addition to the control module 1 including the MIC pole and the GND pole of the audio interface, the audio signal receiving module 2, the first audio signal conversion module 3, the second audio signal conversion module 4, and the audio signal transmitting module 5, an encoding module 6 and a decoding module 7, where the decoding module 7 may be the above-mentioned decoding module based on differential manchester encoding, and decodes the received signal after performing corresponding conversion by using the above-mentioned method, so as to obtain original data transmitted by the audio device. The encoding module 6 is configured to encode a digital signal to be sent to an audio device, where the encoding mode may be differential manchester encoding or other encoding modes, and only needs to correspond to a decoding mode adopted by an audio device in communication with the encoding module 6, the encoding module 6 inputs the encoded digital signal to the second audio signal conversion module 4 for conversion, the audio device receives audio data converted by the second audio signal conversion module 4, converts the audio data into a digital signal, and then decodes the digital signal according to a decoding rule corresponding to the encoding module 6, and when the encoding module 6 adopts differential manchester encoding, the decoding module of the audio device may be the same as the decoding module 7. Similarly, before the audio device transmits audio data through the audio channel pole, the digital signal to be sent to the outside is encoded, the encoding rule adopted by the digital signal corresponds to the decoding module 7, and the encoded digital signal is converted into the audio signal, so that the decoding module 7 is used for decoding the digital signal converted from the audio signal of the audio device.
In order to further enhance the reliability of data transmission, referring to fig. 14, the data receiving module and the data transmitting module of the signal processing module provided in an embodiment of the present invention are the audio signal receiving module 2 and the audio signal transmitting module 5, respectively. The signal processing module also has a control module 1, an audio signal receiving module 2, a first audio signal conversion module 3, a second audio signal conversion module 4, an audio signal transmitting module 5, an encoding module 6, and a decoding module 7 of the MIC pole and the GND pole of the audio interface shown in fig. 13. Before the encoding module 6 encodes the digital signal to be transmitted to the audio device, the framing module 8 frames the digital signal to be transmitted to the audio device according to the method, and inputs the framed digital signal to the encoding module 6 for encoding. Similarly, before the audio device transmits audio data through the channel pole, the digital signal to be sent outside is framed and encoded, and the encoded digital signal is converted into an audio signal, so that after the decoding module 7 decodes the digital signal converted from the audio signal of the audio device, the deframing module 9 deframing the decoded digital signal according to the above method.
As shown in fig. 15, the signal processing module according to an embodiment of the present invention further includes a connection checking module 10, configured to check voltages of the MIC and the GND poles in the audio interface, and output a connection indication signal after a voltage difference between the MIC and the GND poles exceeds a set threshold, which is beneficial to implementing a low power consumption mode of the system.
As shown in fig. 16, a signal processing method of the signal processing module shown in fig. 14 includes:
s00, after the audio device starts the recording channel, the audio signal receiving module 2 is in butt joint with the sound channel pole of the audio interface, the MIC pole and the GND pole of the audio interface are identified by the control module 1 of the MIC pole and the GND pole of the audio interface, after identification, the ground potential of the device of the signal processing module is in butt joint with the identified GND pole, the signal processing module is unified with the reference ground potential of the audio device, and the audio signal sending module 5 is in butt joint with the identified MIC pole, so that a channel for sending data to the audio device is established.
On the receiving channel:
s01, the audio signal receiving module 2 receives the audio signal from the audio device through the channel pole of the audio interface, and transmits the received audio signal to the first audio signal conversion module 3. The audio signal from the audio device is obtained by audio device framing, encoding and digital-to-analog conversion.
S02, the first audio signal conversion module 3 converts the audio signal from the audio device into a digital signal, and outputs the converted digital signal to the decoding module 7. The converted digital signal is preferably passed through a spur filtering module before being transmitted to the decoding module 7.
S03, the decoding module 7 decodes the digital signal converted from the audio signal from the audio device, and transmits the decoded digital signal to the deframing module 9.
S04, the deframing module 9 deframes the digital signal decoded by the decoding module 7, and buffers the deframed data, or sends the deframed data to another processing module for service processing.
On the sending channel:
s11, the framing module 8 extracts from the buffer or obtains the digital signal to be sent to the audio device from other processing modules, frames the digital signal to be sent to the audio device, and inputs the framed digital signal to the encoding module 6.
S12, the encoding module 6 encodes the framed digital signal output by the framing module 8 and to be sent to the audio device, and inputs the encoded digital signal to the second audio signal conversion module 4.
S13, the second audio signal conversion module 4 converts the encoded digital signal to be sent to the audio device into an audio signal, and transmits the audio signal to the audio signal sending module 5.
S14, the audio signal transmitting module 5 transmits the audio signal converted by the second audio signal converting module 4 to the audio device through the MIC pole of the audio interface. After receiving the audio signal, the audio device performs analog-to-digital conversion, decoding and frame decoding.
In this embodiment, before data communication is performed using the audio interface, the MIC pole and the GND pole in the audio interface are identified, then the audio signal sending module in the external device is docked with the identified MIC pole, the ground potential of the external device is docked with the identified GND pole, and the audio signal receiving module in the external device is docked with the sound channel pole of the audio interface, so as to provide a precondition for data communication based on the audio interface. Furthermore, in the process of performing data communication by using the audio interface, the technical scheme adopts the current type digital-to-analog conversion module to convert the digital signal to be sent to the audio equipment into the audio signal, and simulates the working principle that the existing microphone interface receives the audio signal in a current pumping mode, so that the signal processing module and the method in the technical scheme can be better compatible with the existing microphone interface. Any external device can automatically identify the MIC pole and the GND pole of the audio interface of any audio device through the signal processing module as long as the signal processing module provided by the invention is included, so that the communication efficiency is improved.
The above description is further detailed for the present invention with reference to specific embodiments, and it should not be construed that the specific implementations of the present invention are limited to these descriptions. For those skilled in the art to which the present invention pertains, several simple deductions or substitutions can be made without departing from the concept of the present invention, and all of them should be considered as belonging to the protection scope of the present invention.

Claims (27)

1. A method of data transmission, comprising:
a sender sets a control domain, wherein the control domain comprises a first check field;
dividing data to be sent into a plurality of data packets, and adding the control domain to each data packet;
configuring the value of a first check field of each data packet according to the information of each data packet;
framing each data packet and the control field of each data packet to obtain a plurality of data frames to be sent;
and sending the obtained multiple data frames to a receiving party.
2. The data transmission method according to claim 1, wherein the first check field is a parity check field, and configuring a value of the first check field of each data packet according to information of each data packet includes: and acquiring the data length information of each data packet, and configuring the value of the first check field of each data packet according to the acquired data length information of each data packet.
3. The data transmission method of claim 1, wherein the control field further comprises a data length control field, and a value of the data length control field is configured according to data length information of the data packet.
4. The data transmission method of claim 1, wherein the control field further comprises a reserved field; before framing each data packet and the control field of each data packet, configuring the value of the reserved field.
5. The data transmission method according to any one of claims 1 to 4, wherein the control field further includes an address field; before framing each data packet and the control domain of each data packet, configuring the value of an address field for each data packet according to the address information of a receiver.
6. The data transmission method according to any one of claims 1 to 4, wherein the control field further includes a preamble field; before framing each data packet and the control field of each data packet, configuring the value of a preamble field for each data packet.
7. The data transmission method according to any one of claims 1 to 4, wherein the control domain further comprises a second check field; after configuring the value of the first check field of each data packet according to the information of each data packet, before framing the control fields of each data packet and each data packet, configuring the value of the second check field for each data packet according to the control field information of each data packet and each data packet.
8. The data transmission method according to any one of claims 1 to 4, wherein the sender is a signal processing module, the receiver is an audio device with an audio interface, the sender and the receiver are communicatively connected via the audio interface, and the sending the obtained multiple data frames to the receiver by the sender comprises: the sender encodes the obtained data frame and converts the encoded data frame into an audio signal; the signal processing module identifies a microphone pole and a ground pole in an audio interface of the audio equipment, the audio signal sending module is in butt joint with the identified microphone pole, the ground potential is in butt joint with the identified ground pole, and the audio signal receiving module is in butt joint with a sound channel pole of the audio interface; and the audio signal sending module of the sender sends the obtained audio signal to the receiver through the audio interface.
9. The data transmission method of claim 8, wherein the signal processing module identifies a microphone pole and a ground pole in the audio interface, the audio signal transmission module is docked with the identified microphone pole, and the method for docking the ground potential with the identified ground pole comprises:
after the audio equipment starts a recording channel, acquiring electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment;
identifying the microphone pole and the ground pole from the electrical signal of each of the pair of audio input poles;
and the audio signal sending module is butted with the microphone pole, and the ground potential is butted with the ground pole.
10. The data transmission method of claim 9, wherein the method of obtaining the electrical signal of each of the pair of audio input poles is: and establishing a current channel between the pair of audio input poles, connecting a reference ground potential into a node of the current channel, and acquiring the voltage relative value of each pole of the pair of audio input poles relative to the reference ground potential.
11. A data receiving method, comprising:
a receiving party receives a data frame sent by a sending party;
analyzing a data packet and a control field from a received data frame, wherein the control field comprises a first check field;
obtaining a first check value according to the information of the data packet;
comparing the obtained first check value with a value of a first check field contained in the control domain; judging whether the verification passes; if not, the transmission is wrong; and if so, extracting the data in the data packet.
12. The data receiving method according to claim 11, wherein the first check value is a parity check value, and the obtaining of the first check value according to the information of the data packet is specifically obtaining the first check value according to the length information of the data packet.
13. The data receiving method according to claim 11 or 12, wherein the control field further comprises an address field, and before obtaining the first check value according to the information of the data packet, the method further comprises: and judging whether the value of the address field contained in the control domain of the received data frame corresponds to the address information of the data frame, if so, obtaining a first check value according to the information of the data packet.
14. The data receiving method as claimed in claim 11 or 12, wherein the control field further includes a preamble field, and before obtaining the first check value according to the information of the data packet, the method further includes: and judging whether the value of a preamble field contained in a control field of the received data frame is in a preset range, and if not, judging that the transmission is wrong.
15. The data receiving method as claimed in claim 11 or 12, wherein the control field further comprises a second check field, and before obtaining the first check value according to the information of the data packet, the method further comprises: obtaining a second check value according to the data packet of the received data frame and the information of the control domain, and comparing the obtained second check value with the value of a second check field contained in the control domain; judging whether the verification passes; if not, the transmission error is judged.
16. The data receiving method as claimed in claim 11 or 12, wherein the control field further comprises a data length control field, and when data in the data packet is extracted, the data in the data packet is extracted according to a value of the data length control field.
17. The data receiving method according to claim 11 or 12, wherein the receiving side is a signal processing module, the sending side is an audio device with an audio interface, the receiving side and the sending side are communicatively connected through the audio interface, and the receiving side receives a data frame sent by the sending side, and the receiving side includes: the receiving party receives the audio signal sent by the sending party, converts the audio signal into a data signal and then decodes the data signal to obtain a data frame sent by the sending party; before the receiving side receives the audio signal sent by the sending side, the method further comprises the following steps: the signal processing module identifies a microphone pole and a ground pole in an audio interface of the audio equipment, the audio signal sending module is in butt joint with the identified microphone pole, the ground potential is in butt joint with the identified ground pole, and the audio signal receiving module is in butt joint with a sound channel pole of the audio interface.
18. The data receiving method of claim 17, wherein the signal processing module identifies a microphone pole and a ground pole in the audio interface, the audio signal transmitting module is interfaced with the identified microphone pole, and the method of interfacing the ground potential with the identified ground pole comprises:
acquiring electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment after the audio equipment starts a recording channel;
identifying the microphone pole and the ground pole from the electrical signal of each of the pair of audio input poles;
and the audio signal sending module is butted with the microphone pole, and the ground potential is butted with the ground pole.
19. The data receiving method of claim 18, wherein the electrical signal for each of the pair of audio input poles is obtained by: and establishing a current channel between the pair of audio input poles, connecting a reference ground potential into a node of the current channel, and acquiring the voltage relative value of each pole of the pair of audio input poles relative to the reference ground potential.
20. A signal processing module comprises a framing module and a data sending module; the framing module comprises a setting submodule, a dividing submodule, a configuration submodule and a framing submodule;
the setting submodule is used for setting a control domain, and the set control domain comprises a first check field;
the dividing submodule is used for dividing data to be sent into a plurality of data packets;
the configuration submodule is used for adding the control domain for each data packet and configuring the value of the first check field of each data packet according to the information of each data packet;
the framing submodule is used for framing each data packet and the control domain of each data packet to obtain a plurality of data frames;
and the data sending module is used for sending the plurality of data frames obtained by the framing submodule to a receiving party.
21. The signal processing module of claim 20, wherein the signal processing module further comprises a deframing module and a data receiving module, the data receiving module being configured to receive a data frame from a sender; the de-framing module comprises a parsing submodule, a judging submodule and a data extracting submodule;
the analysis submodule is used for analyzing the data frame received by the data receiving module to obtain a data packet and a control field of the data frame, and the control field comprises a first check field;
the judgment submodule is used for obtaining a first check value according to the information of the data packet and comparing the obtained first check value with a value of a first check field contained in the control domain; judging whether the verification passes; if not, judging the transmission error; and if the data packet passes the data extraction sub-module, informing the data extraction sub-module to extract the data packet.
22. The signal processing module of claim 21, wherein the signal processing module performs data interaction with an audio device through an audio interface of the audio device, the data receiving module is an audio signal receiving module, the audio signal receiving module is in butt joint with a sound channel pole of the audio interface, the data sending module is an audio signal sending module, and the signal processing module further comprises a control module of an audio interface microphone pole and a ground pole; the control module of the audio interface microphone pole and the ground pole is used for identifying the microphone pole and the ground pole of the audio interface, butting the audio signal sending module with the identified microphone pole and butting the ground potential with the identified ground pole.
23. The signal processing module of claim 22, wherein the control module for the audio interface microphone pole and the ground pole comprises:
the acquisition module is used for acquiring the electric signals of each pole of a pair of audio input poles in an audio interface of the audio equipment after the audio equipment starts a recording channel;
the identification module is used for identifying the microphone pole and the earth pole according to the electric signals of each pole in the pair of audio input poles;
and the port switching module is used for butting the audio signal sending module with the microphone electrode and butting the ground potential with the ground electrode after the identification module identifies the microphone electrode and the ground electrode.
24. The signal processing module of claim 23, wherein the obtaining module is a voltage detecting module for directly detecting a voltage of each of a pair of audio input poles in an audio interface of the audio device after the audio device starts a recording channel.
25. The signal processing module of claim 23, wherein the obtaining module is a voltage domain converting module configured to establish a current path between the pair of audio input poles, connect a reference ground to a node of the current path, and obtain a voltage relative value of each of the pair of audio input poles with respect to the reference ground.
26. The signal processing module of claim 25 wherein the identification module includes a first identification submodule for detecting positive and negative characteristics of the relative voltage of each of the pair of audio input poles and identifying the microphone pole and the ground pole based on the detection.
27. The signal processing module of claim 25, wherein the identification module comprises:
the second identification submodule is used for comparing the voltage relative value of each of the pair of audio input poles with the reference ground potential and outputting a digital level signal according to the comparison result of each voltage relative value;
and the logic judgment module is used for identifying the microphone pole and the earth pole according to the two digital level signals output by the second identification submodule.
CN 201210126577 2012-04-26 2012-04-26 Data transmission method, data receiving method and signal processing module Pending CN103378931A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201210126577 CN103378931A (en) 2012-04-26 2012-04-26 Data transmission method, data receiving method and signal processing module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201210126577 CN103378931A (en) 2012-04-26 2012-04-26 Data transmission method, data receiving method and signal processing module

Publications (1)

Publication Number Publication Date
CN103378931A true CN103378931A (en) 2013-10-30

Family

ID=49463524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201210126577 Pending CN103378931A (en) 2012-04-26 2012-04-26 Data transmission method, data receiving method and signal processing module

Country Status (1)

Country Link
CN (1) CN103378931A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103596002A (en) * 2013-11-28 2014-02-19 广东威创视讯科技股份有限公司 Coding method for cascading transmission system and unit
WO2015139551A1 (en) * 2014-03-21 2015-09-24 天地融科技股份有限公司 Method for implementing data transmission by means of audio interface
CN105356947A (en) * 2014-08-19 2016-02-24 国民技术股份有限公司 Audio sending and receiving terminal, and method for sending and receiving target data
CN105471516A (en) * 2014-08-19 2016-04-06 国民技术股份有限公司 Audio transmitting and receiving terminal and target data transmitting and receiving method
CN107046541A (en) * 2017-04-18 2017-08-15 深圳市法马新智能设备有限公司 A kind of wireless receiving and dispatching encryption communication method and its device
CN108039938A (en) * 2017-12-21 2018-05-15 国网浙江省电力有限公司电力科学研究院 Electric power Internet of Things low-power consumption concurrent data frame coding method and system
CN110084971A (en) * 2019-04-25 2019-08-02 益逻触控系统公司 The operating method and self-service terminal of self-service terminal
CN110198202A (en) * 2019-06-03 2019-09-03 北京润科通用技术有限公司 A kind of method of calibration and device of AFDX bus message data source
CN111258295A (en) * 2020-01-15 2020-06-09 重庆长安汽车股份有限公司 System and method for verifying big data acquisition and uploading accuracy
CN114696944A (en) * 2020-12-25 2022-07-01 深圳Tcl新技术有限公司 Data packet processing method and device, intelligent terminal and computer readable storage medium
CN114844597A (en) * 2022-03-28 2022-08-02 苏州英威腾电力电子有限公司 Communication method and device of frequency converter and electronic equipment
CN116366206A (en) * 2023-06-01 2023-06-30 三未信安科技股份有限公司 Method and system for enhancing reliability of password card

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103596002A (en) * 2013-11-28 2014-02-19 广东威创视讯科技股份有限公司 Coding method for cascading transmission system and unit
WO2015139551A1 (en) * 2014-03-21 2015-09-24 天地融科技股份有限公司 Method for implementing data transmission by means of audio interface
CN105356947A (en) * 2014-08-19 2016-02-24 国民技术股份有限公司 Audio sending and receiving terminal, and method for sending and receiving target data
CN105471516A (en) * 2014-08-19 2016-04-06 国民技术股份有限公司 Audio transmitting and receiving terminal and target data transmitting and receiving method
CN105471516B (en) * 2014-08-19 2019-05-07 国民技术股份有限公司 Audio sends and receives the sending and receiving method of terminal, target data
CN105356947B (en) * 2014-08-19 2019-05-07 国民技术股份有限公司 Audio sends and receives the sending and receiving method of terminal, target data
CN107046541B (en) * 2017-04-18 2023-02-03 深圳市法马新智能设备有限公司 Wireless transceiving encryption communication method and device thereof
CN107046541A (en) * 2017-04-18 2017-08-15 深圳市法马新智能设备有限公司 A kind of wireless receiving and dispatching encryption communication method and its device
CN108039938A (en) * 2017-12-21 2018-05-15 国网浙江省电力有限公司电力科学研究院 Electric power Internet of Things low-power consumption concurrent data frame coding method and system
CN110084971A (en) * 2019-04-25 2019-08-02 益逻触控系统公司 The operating method and self-service terminal of self-service terminal
CN110198202B (en) * 2019-06-03 2022-01-28 北京润科通用技术有限公司 Method and device for checking AFDX (avionics full Duplex switched Ethernet) bus message data source
CN110198202A (en) * 2019-06-03 2019-09-03 北京润科通用技术有限公司 A kind of method of calibration and device of AFDX bus message data source
CN111258295A (en) * 2020-01-15 2020-06-09 重庆长安汽车股份有限公司 System and method for verifying big data acquisition and uploading accuracy
CN114696944A (en) * 2020-12-25 2022-07-01 深圳Tcl新技术有限公司 Data packet processing method and device, intelligent terminal and computer readable storage medium
CN114844597A (en) * 2022-03-28 2022-08-02 苏州英威腾电力电子有限公司 Communication method and device of frequency converter and electronic equipment
CN114844597B (en) * 2022-03-28 2024-07-19 苏州英威腾电力电子有限公司 Communication method and device of frequency converter and electronic equipment
CN116366206A (en) * 2023-06-01 2023-06-30 三未信安科技股份有限公司 Method and system for enhancing reliability of password card
CN116366206B (en) * 2023-06-01 2023-08-25 三未信安科技股份有限公司 Method and system for enhancing reliability of password card

Similar Documents

Publication Publication Date Title
CN103378931A (en) Data transmission method, data receiving method and signal processing module
CN103379214B (en) A kind of audio communication system
JP6721768B2 (en) Robust cable type detection for USB power transfer
US20130087614A1 (en) Audio jack coupled secure magnetic card reader
CN103327030B (en) A kind of Wi-Fi of utilization message length carries out the method for information transmission
RU2322761C1 (en) Transmitter and receiver for data packet in wireless communication system
US20180302755A1 (en) Multicast transmission method, information extraction method and corresponding terminal and device
CN1518322A (en) Device for connecting eqrphone on mobile phone through interface connector
CN104683994A (en) Wireless network configuration method and wireless network devices
CN103379397B (en) Data transfer, treatment, the signal processing method based on COBBAIF and module
CN110138635B (en) Protocol conversion function verification device and method supporting FC and Ethernet
CN105517111A (en) Methods and apparatuses for connecting devices with network
JP4988544B2 (en) Data processing apparatus, data processing method, and program
US20180063297A1 (en) Method and apparatus for control frame extension
CN209471447U (en) Bus interface circuit capable of self-adapting logic level
EP3026953A1 (en) Method of connecting to a wireless data network and wireless connection system through tethering
CN103812574B (en) Method, device and system for improving recognition rate of photon identity authentication system
CN103199953A (en) Method and device for data transmission and communication equipment
CN112437484B (en) Networking method for underground engineering geological exploration wireless seismograph and wireless seismograph
CN110034858B (en) Data packet retransmission method and device, mobile terminal and storage medium
KR101476908B1 (en) Transmitter, receiver and communication system using earphone port of mobile terminal
CN1770132A (en) Connector between processor and user recognition card
CN105049129A (en) Wi-Fi configuration system and method based on acoustic waves
CA2723818C (en) System and method for receiving call signals in a communication system
KR20140027595A (en) Network access device and method for processing data thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20131030