CN106549748B - A kind of data transmission method and data processing equipment - Google Patents
A kind of data transmission method and data processing equipment Download PDFInfo
- Publication number
- CN106549748B CN106549748B CN201510604981.5A CN201510604981A CN106549748B CN 106549748 B CN106549748 B CN 106549748B CN 201510604981 A CN201510604981 A CN 201510604981A CN 106549748 B CN106549748 B CN 106549748B
- Authority
- CN
- China
- Prior art keywords
- time
- time interval
- data
- group
- signals
- 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.)
- Active
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 178
- 238000000034 method Methods 0.000 title claims abstract description 102
- 238000012545 processing Methods 0.000 title claims abstract description 94
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 4
- 230000008054 signal transmission Effects 0.000 claims description 4
- 238000004891 communication Methods 0.000 abstract description 19
- 238000005070 sampling Methods 0.000 abstract description 8
- 238000004364 calculation method Methods 0.000 description 99
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 230000008569 process Effects 0.000 description 8
- 230000000630 rising effect Effects 0.000 description 7
- 238000009825 accumulation Methods 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000001788 irregular Effects 0.000 description 4
- 230000001960 triggered effect Effects 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000000375 direct analysis in real time Methods 0.000 description 1
- 238000012063 dual-affinity re-targeting Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L25/00—Baseband systems
- H04L25/38—Synchronous or start-stop systems, e.g. for Baudot code
- H04L25/40—Transmitting circuits; Receiving circuits
- H04L25/49—Transmitting circuits; Receiving circuits using code conversion at the transmitter; using predistortion; using insertion of idle bits for obtaining a desired frequency spectrum; using three or more amplitude levels ; Baseband coding techniques specific to data transmission systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
Landscapes
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Communication Control (AREA)
- Dc Digital Transmission (AREA)
Abstract
The present invention provides a kind of data transmission method and data processing equipment, this method comprises: receiving K signal, detect the time interval in K signal between each adjacent two, judge whether meet preset relation between first time interval and the second time interval, determine first time interval group and/or the second time interval group, if meeting preset relation, the time parameter of present data transmission is determined according to first time interval group and/or the second time interval group;Data are received according to time parameter.Present invention can ensure that the technical issues of data are transmitted every time stability and accuracy, when effectively preventing clock when sending and too big receiving time parameter differences, cause receiving end sampling dislocation, cause to receive mistake, and communication efficiency reduces.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a data transmission method and a data processing device.
Background
The serial communication modes between electronic circuits are mainly classified into a synchronous communication mode and an asynchronous communication mode. The synchronous communication mode requires that two communication parties carry out the same clock frequency and are accurately coordinated, the accurate synchronization of a sender and a receiver is ensured by sharing a single clock or a timing pulse source, and the efficiency is high; the asynchronous communication mode does not require synchronization of both parties, the transmitting and receiving parties can adopt respective clock sources, the both parties follow an asynchronous communication protocol, characters are used as data transmission units, the time interval for transmitting the characters by the transmitting party is uncertain, and the transmitting efficiency is lower than the synchronous transmission efficiency.
The DART protocol is characterized in that one character is transmitted one by one, each character is transmitted one by one, and when one character is transmitted, the transmission always starts with a start bit and ends with a stop bit, and no fixed time interval is required between the characters. The frequency of the sending clock of the sending end and the receiving clock of the receiving end is allowed to have a certain difference, when the frequency difference is within a certain range, the receiving end cannot be detected and dislocated, and the receiving end can receive correctly. When the frequency difference between the sending clock and the receiving clock is too large, sampling dislocation of the receiving end can be caused, so that receiving errors are caused, and the communication efficiency is reduced.
Therefore, it is necessary to provide a new data transmission method and data processing apparatus to solve the above problems.
Disclosure of Invention
The present invention aims to solve one of the above problems.
The main purpose of the present invention is to provide a data transmission method, and to achieve the above purpose, the technical solution of the present invention is specifically realized as follows:
scheme 1, a data transmission method, characterized by, comprising:
receiving K signals, detecting a time interval between every two adjacent signals in the K signals, and judging whether a first time interval and a second time interval meet a preset relationship, wherein the first time interval is a time interval between the starting time of the ith signal and the starting time of the (i-1) th signal, the second time interval is a time interval between the starting time of the ith signal and the starting time of the (i + 1) th signal, i is 2,4, … …,2j, j is (K-1)/2, K is more than or equal to 3, and K is an odd number;
determining a first time interval group and/or a second time interval group, wherein the first time interval group comprises j first time intervals, and the second time interval group comprises j second time intervals;
if the first time interval and the second time interval meet a preset relationship, determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group;
and receiving data according to the time parameter.
Scheme 2, the method of scheme 1, wherein the receiving K signals comprises:
k low pulses are detected.
Scheme 3. the method according to scheme 1, wherein,
the receiving data according to the time parameter includes: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; receiving X signals, and determining the time interval between the starting moments of every two adjacent signals in the X signals to obtain X-1 time intervals, wherein X is a positive integer and is greater than 1; according to the determined time parameter, obtaining a numerical value corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals to obtain a numerical value transmitted by the S time intervals, wherein the numerical value transmitted by the S time intervals is the numerical value corresponding to the single time interval, and the numerical value is 2 included in the N-bit dataNOne of different values, wherein, when S is more than 1, the S time intervals are the same, wherein, X and S are positive integers, S is less than or equal to X-1, and N is more than or equal to 1.
Scheme 4, the method according to scheme 3, wherein X-1 ═ n × S, n ≧ 1 and n is an integer.
Scheme 5, the method of scheme 3 or 4, wherein the receiving X signals comprises: x low pulses are detected.
Scheme 6, the method of any of schemes 1 to 5, wherein receiving X signals comprises: and receiving Y +1 signals, and removing interference in the Y +1 signals to obtain the X signals, wherein Y +1 is more than or equal to X.
Scheme 7, the method according to scheme 1, further comprising, after the receiving data according to the time parameter: and transmitting data according to the time parameter.
The method according to claim 8 or 7, wherein the transmitting data according to the time parameter includes: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
Scheme 9, the method according to any of the schemes 1 to 8, characterized in that: and if the first time interval and the second time interval do not meet the preset relation, continuing to execute the step of receiving the K signals.
Scheme 10, a data transmission method, characterized by comprising: determining a time parameter; determining a first time interval group and a second time interval group according to the time parameter, wherein the first time interval group comprises j first time intervals, and the second time interval group comprises j second time intervals;
generating and transmitting K handshake signals, wherein the first time interval and the second time interval satisfy a preset relationship; the first time interval is a time interval between a start time of an ith handshake signal and a start time of an i-1 th handshake signal, the second time interval is a time interval between a start time of an ith handshake signal and a start time of an i +1 th handshake signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number.
Scheme 11 and the method according to scheme 10, wherein the generating K handshake signals includes: and generating K times of low-level pulses according to the first time interval and the second time interval.
Scheme 12, the method according to scheme 10 or 11, wherein after the generating and sending K handshake signals, the method further comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
Scheme 13, the method of claim 12, wherein for each group of data, sending the group of data comprises: and generating and transmitting M signals, wherein the time interval between the starting time of each signal and the starting time of the adjacent last signal is the time interval corresponding to the numerical value of the group of data, M is more than or equal to 1, and M is a natural number.
The method of claim 14 or 13, wherein the generating M signals comprises: and generating M times of low-level pulses according to the time interval.
Scheme 15, the method according to any of schemes 12 to 14, further comprising: replacing the currently used time parameter with a new time parameter according to a preset rule, and taking the new time parameter as the time parameter of the current data transmission; updating the corresponding relation according to the time parameter of the current data transmission; and carrying out data transmission by utilizing the updated corresponding relation.
A data processing apparatus according to claim 16, characterized by comprising: the device comprises a receiving module, a judging module, a time processing module and a data processing module, wherein the receiving module is used for receiving K signals; the judging module is configured to detect a time interval between every two adjacent signals in the K signals, and judge whether a first time interval and a second time interval satisfy a preset relationship, where the first time interval is a time interval between a start time of an ith signal and a start time of an i-1 th signal, the second time interval is a time interval between a start time of an ith signal and a start time of an i +1 th signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number; the time processing module is configured to determine a first time interval group and/or a second time interval group, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals; if the first time interval and the second time interval meet a preset relationship, determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group; and the data processing module is used for receiving data according to the time parameter.
The apparatus of claim 17 or 16, wherein the receiving module is configured to receive K signals, and includes: and the receiving module is used for detecting K times of low-level pulses.
The apparatus of claim 18 or 16, wherein the receiving module is further configured to receive X signals;
the data processing module is configured to receive data according to the time parameter, and includes: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; determining the time interval between the starting moments of every two adjacent signals in the X signals to obtain X-1 time intervals, wherein X is a positive integer and is greater than 1; obtaining the X according to the determined time parameter-obtaining values transmitted by S time intervals, the values transmitted by S time intervals being the values corresponding to the single time intervals, the values being 2 of the N bits of dataNOne of different values, wherein, when S is more than 1, the S time intervals are the same, wherein, X and S are positive integers, S is less than or equal to X-1, and N is more than or equal to 1.
Scheme 19 and the apparatus of claim 18, wherein X-1 is n X S, n is equal to or greater than 1 and n is an integer.
The apparatus of claim 20 or 18 or 19, wherein the receiving module is further configured to receive X signals, and includes: the receiving module is further configured to detect X times of low level pulses.
Scheme 21, the apparatus according to any of schemes 18 to 20, wherein the data processing module is further configured to: and receiving Y +1 signals, and removing interference in the Y +1 signals to obtain the X signals, wherein Y +1 is more than or equal to X.
Scheme 22, the apparatus according to any of schemes 16 to 21, further comprising: and the data sending module is used for sending data according to the time parameter after the data processing module receives the data according to the time parameter.
Scheme 23 and the device according to scheme 22, wherein the data sending module is configured to send data according to the time parameter, and includes: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
The apparatus of any of aspects 24, 16 to 23,
the time processing module is further configured to instruct the determining module to continue to execute the operation of receiving the K signals if the first time interval and the second time interval do not satisfy the preset relationship.
Scheme 25, a data processing apparatus, characterized by comprising: the second time parameter module, the second time processing module and the second signal generating and sending module; the second time parameter module is used for determining a time parameter; the second time processing module is configured to determine a first time interval group and a second time interval group according to the time parameter, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals; the second signal generating and sending module is configured to generate and send K handshake signals, where the first time interval and the second time interval satisfy a preset relationship; the first time interval is a time interval between a start time of an ith handshake signal and a start time of an i-1 th handshake signal, the second time interval is a time interval between a start time of an ith handshake signal and a start time of an i +1 th handshake signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number.
Scheme 26 and apparatus according to scheme 25, wherein the second signal generating and sending module, configured to generate the K handshake signals, includes: and the second signal generating and sending module generates K times of low-level pulses according to the first time interval and the second time interval.
The apparatus according to claim 27 or 25 or 26, wherein the second signal generating and sending module is further configured to, after generating and sending K handshake signals, obtain 2 bits included in the N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the different values correspond toThe time intervals are different, wherein N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
The apparatus of claim 28 or 27, wherein for each set of data, the second signal generating module is further configured to transmit the set of data, and the method comprises: the second signal generating and sending module is further configured to generate and send M signals, where a time interval between a start time of each signal and a start time of an adjacent previous signal is a time interval corresponding to a numerical value of the group of data, M is greater than or equal to 1, and M is a natural number.
The apparatus of claim 29 or 28, wherein the second signal generating and transmitting module is further configured to generate M signals, and includes: and the second signal generating and sending module is further used for generating M times of low-level pulses according to the time interval.
The apparatus according to claim 30 or any one of claims 27 to 19, wherein the second time parameter module is further configured to replace a currently used time parameter with a new time parameter according to a preset rule, and use the new time parameter as the time parameter of the current data transmission; the second signal generating and sending module is further configured to update the corresponding relationship according to the time parameter of the current data transmission; and carrying out data transmission by utilizing the updated corresponding relation.
It can be seen from the above technical solutions that the present invention provides a data transmission method and a data processing apparatus, wherein time parameters etu and pdt are determined by handshake signals, so as to ensure that values of the sending end and the receiving end are consistent with each other during each data transmission, ensure stability and accuracy of each data transmission, avoid error accumulation caused by continuous receiving of multiple characters due to frequency difference, and effectively prevent technical problems of receiving error and reduced communication efficiency caused by sampling misalignment of the receiving end when the difference between the sending clock and the receiving time parameter is too large, in addition, the sending end can represent data of a sending waveform according to a time interval of the sending waveform, the receiving end can determine data bits of the receiving waveform according to the time interval of the receiving waveform, can complete data reception by using only two lines, and is suitable for use in electronic devices, the volume of the electronic equipment can be effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a data transmission method according to embodiment 1 of the present invention;
fig. 2 is a flowchart of a data receiving method according to embodiment 2 of the present invention;
fig. 3 is a flowchart of a data transmission method according to embodiment 3 of the present invention;
fig. 4 is a flowchart of a data transmission method according to embodiment 4 of the present invention;
fig. 5 is a schematic waveform diagram of a transmitted data bit string 0011100100 when N is 2 according to embodiment 4 of the present invention;
fig. 6 is a schematic waveform diagram of a transmitted data bit string 0011100100 when N is 1 according to embodiment 4 of the present invention;
fig. 7 is a schematic waveform diagram of a transmitted data bit string 0011100100 when N is 3 according to embodiment 4 of the present invention;
fig. 8 is a schematic structural diagram of a data processing apparatus according to embodiment 5 of the present invention;
fig. 9 is a schematic structural diagram of another data processing apparatus according to embodiment 5 of the present invention;
fig. 10 is a schematic structural diagram of a data processing apparatus according to embodiment 6 of the present invention;
fig. 11 is a schematic structural diagram of a data sending module according to embodiment 5 and embodiment 6 provided in embodiment 6 of the present invention;
fig. 12 is a schematic structural diagram of another data sending module according to embodiment 5 and embodiment 6 provided in embodiment 6 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or quantity or location.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
Example 1
As shown in fig. 1, this embodiment provides a data transmission method, and to achieve the above object, the technical solution of the present invention is specifically implemented as follows:
step S101: receiving K signals;
k is a preset value, K ≧ 3 and K is an odd number, for example, K is preset to 5, then when 5 signals are received cumulatively, the received 5 signals are processed, the method provided by this embodiment can determine whether to start receiving data according to the relationship of time intervals between the K signals, that is, if the preset relationship is satisfied, data reception is started after the K signals, the K signals can be regarded as handshake signals indicating start of receiving data; the signal may be a pulse signal, that is, a high-level pulse signal (rising edge signal) or a low-level pulse signal (falling edge signal) is received, and the pulse signal may be a square wave, a sine wave, a triangular wave, or other irregular waveform, or a combination of the above different waveforms.
In this embodiment, receiving K signals includes at least one of the following:
the first method is as follows: detecting K times of low level pulses;
in this manner, the terminal may detect the low level pulses K times in the consecutive high levels, for example, detect the low level pulses 1 time after detecting the high level for a certain period of time, and then resume the state of detecting the high level, and detect the low level pulses 1 time after a certain period of time elapses, in such a manner that the low level pulses K times may be detected consecutively;
the second method comprises the following steps: detecting K times of high level pulses;
in this manner, the terminal may detect the high level pulses K times in the consecutive low levels, for example, detect the high level pulses 1 time after detecting the low level for a certain period of time, and then resume the state of detecting the low level, and detect the high level pulses 1 time again after a certain period of time elapses, in such a manner that the high level pulses K times may be detected consecutively;
in the above manner, the K signals belong to the hopping signal, and the hopping amplitude is significant, so that the K signals are conveniently distinguished from the noise signal.
Step S102: detecting a time interval between every two adjacent ones of the K signals;
in this embodiment, after the K signals are continuously received, detecting a time interval between every two adjacent signals in the K signals, and optionally, when the K signals are K low-level signals in continuous high levels, determining a time duration from a starting time of a p-th low-level signal to a starting time of a p + 1-th low-level signal as a time interval between the p-th and p + 1-th signals; similarly, when the K signals are K high-level signals in continuous low levels, determining the time length from the starting time of the p high-level signal to the starting time of the p +1 high-level signal as the time interval between the p signal and the p +1 signal; wherein p is more than or equal to 1 and less than or equal to K-1, and p is a natural number; as an alternative embodiment, the time interval between the start time of two adjacent signals can be accurately and rapidly obtained by detecting the start time of each pulse signal.
Step S103: judging whether the first time interval and the second time interval meet a preset relation or not;
as an optional implementation manner of this embodiment, in step S103, the first time interval may be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval may be a time interval between a start time of an ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j is (K-1)/2, K ≧ 3 and K is an odd number; illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start of the fourth signal, denoted t2, and the second time interval is the time interval between the fourth signal and the start of the 5 th signal, denoted t 3. The judgment of whether the first time interval and the second time interval satisfy a preset relationship means that whether the preset relationship is satisfied simultaneously between t0 and t1 and between t2 and t3 is judged, the preset relationship can be determined according to the experience of technicians or according to parameters in actual operation, and as long as the preset relationship is satisfied, the K signals can be determined as handshake signals indicating that data reception starts. As an alternative, the preset relationship may be t1 ═ a × t0 and t3 ═ a × t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers ≧ 1, for example, a ═ 2, and this predetermined relationship may be various and will not be described herein again.
Step S104: determining a first time interval group and/or a second time interval group;
the first time interval group comprises j first time intervals, the second time interval group comprises j second time intervals, j is (K-1)/2, K is larger than or equal to 3, and K is an odd number. When the values of i are different, a series of first time intervals and second time intervals are generated according to K-1 time intervals generated by the K signals, at least 1 time interval may be selected from a plurality of different first time intervals to form a first time interval group, and similarly, at least 1 time interval may be selected from a plurality of different second time intervals to form a second time interval group, for example, when K is 5, the first time intervals t0 and t2 and the second time intervals t1 and t3 are generated in 5 signals, at this time, t0 and t2 may be taken as the first time interval group and t1 and t3 may be taken as the second time interval group, in this embodiment, the number of time intervals in the first time interval group and the second time interval group is not limited, at least one time may be used, and by this way, the first time interval group and/or the second time interval group may be determined, the time intervals are conveniently classified.
Step S105: if the first time interval and the second time interval meet a preset relation, determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group;
in step S105, according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group, specifically: determining a time parameter of current data transmission according to at least two first time intervals in the first time interval group, determining a time parameter of current data transmission according to at least two second time intervals in the second time interval group, or determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group, wherein the first time interval and the second time interval are not adjacent
In this embodiment, in the determined first time interval group and the second time interval group, when both a first time interval between the ith signal and the (i-1) th signal and a second time interval between the ith signal and the (i + 1) th signal satisfy a preset relationship, it may be determined that the K signals are valid handshake signals, and at this time, a time parameter for current data transmission is determined according to the first time interval group, or according to the second time interval group, or according to the first time interval group and the second time interval group, and according to a time parameter generation rule agreed in advance with the data transmitting end, where the agreed in advance time parameter generation rule may select any kind of mode to determine the time parameter on the premise that each data bit encoding mode is unique;
for example, when K is 5, 4 time intervals are generated between two adjacent signals in 5 signals, when i is 2, the first time interval is the time interval between the start time of the first signal and the start time of the second signal, which is labeled as t0, and the second time interval is the time interval between the start time of the second signal and the start time of the third signal, which is labeled as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, denoted as t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, denoted as t 3; taking this as an example, a detailed description is given below of a manner of determining a time parameter of a current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group.
As an optional implementation manner of this embodiment, t0 and t2 are selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t0 and t2, the value of etu and pdt can be obtained by any calculation manner according to the values of t0 and t2, exemplarily, etu and pdt can be obtained by any one of the following calculation manners, and of course, the following calculation manners are not limited:
etu=t0,pdt=(t0-t2)/5;
etu=t0+t2,pdt=(t0+t2)/10;
etu=t0+t2/2,pdt=(t0-t2)/5;
etu=t2,pdt=(t0-t2)/15;
........
as another alternative to this embodiment, t0 is selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group, the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0, the values of etu and pdt can be obtained by any calculation method according to the value of t0, and for example, etu and pdt can be obtained by any one of the following calculation methods, and of course, the following calculation methods are not limited:
etu=t0,pdt=t0/5;
etu=2*t0,pdt=t0/10;
etu=t0/2,pdt=t0/5;
etu=t0/3,pdt=t0/15;
........
as another alternative to this embodiment, t1 and t3 are selected as the second time interval group, the time parameter of the current data transmission is determined according to the second time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1 and t3, the value of etu and pdt can be obtained by any calculation method according to the values of t1 and t3, and for example, etu and pdt can be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=(t1-t3)/5;
etu=t1+t3,pdt=(t1+t3)/10;
etu=t1+t3/2,pdt=(t1-t3)/5;
etu=t3,pdt=(t1-t3)/15;
........
as another alternative to this embodiment, t1 is selected as the second time interval group, the time parameter of the current data transmission is determined according to the second time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1, the values of etu and pdt can be obtained by any calculation method according to the value of t1, and for example, etu and pdt can be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=t1/5;
etu=2*t1,pdt=t1/10;
etu=t1/2,pdt=t1/5;
etu=t1/3,pdt=t1/15;
........
as another alternative to this embodiment, t0 is selected as the first time interval group, t3 is selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group and the second time interval group, the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0 and t3, and the values of etu and pdt can be obtained by any calculation method according to the values of t0 and t3, for example, etu and pdt can be obtained by any calculation method, and certainly are not limited to the following calculation methods:
etu=t0,pdt=t3/5;
etu=2*t0,pdt=t3/10;
etu=t0/2,pdt=t3/5;
etu=t0/3,pdt=t3/15;
etu=t0+t3,pdt=t0+t3/5;
etu=t0/3+t3,pdt=t0+t3/15;
........
similarly, when K is 7, 6 time intervals are generated between two adjacent 7 signals, when i is 2, the first time interval is the time interval between the start time of the first signal and the start time of the second signal, and is marked as t0, and the second time interval is the time interval between the start time of the second signal and the start time of the third signal, and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start of the fourth signal, denoted t2, and the second time interval is the time interval between the fourth signal and the start of the fifth signal, denoted t 3; when i is 6, the first time interval is the time interval between the fifth signal and the start time of the sixth signal, denoted as t4, and the second time interval is the time interval between the sixth signal and the start time of the seventh signal, denoted as t 5; at this time, t0, t2 and t4 may be selected as the first time interval group, t1, t3 and t5 may also be selected as the second time interval group, the time parameter of the current data transmission is determined according to at least two first time intervals in the first time interval group, the time parameter of the current data transmission is determined according to at least two second time intervals in the second time interval group, the time parameter of the current data transmission may also be determined jointly according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group, and the first time interval and the second time interval are not adjacent, the obtaining manner of the time parameters etu and pdt is not unique, and may be obtained arbitrarily through the first time interval group and/or the second time interval group by using different calculation manners, and the specific obtaining manner may refer to the scheme when K is 5, are not described herein in detail;
when K is 3, 2 time intervals are generated between two adjacent signals in the 3 signals, when i is 2, the first time interval is the time interval between the starting time of the first signal and the starting time of the second signal and is marked as t0, and the second time interval is the time interval between the starting time of the second signal and the starting time of the third signal and is marked as t 1; taking this as an example, the following describes in detail a manner of determining a time parameter of a current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group,
as another alternative to this embodiment, t0 is selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group, the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0, the values of etu and pdt can be obtained by any calculation method according to the value of t0, and for example, etu and pdt can be obtained by any one of the following calculation methods, and of course, the following calculation methods are not limited:
etu=t0,pdt=t0/5;
etu=2*t0,pdt=t0/10;
etu=t0/2,pdt=t0/5;
etu=t0/3,pdt=t0/15;
........
as another alternative to this embodiment, t1 is selected as the second time interval group, the time parameter of the current data transmission is determined according to the second time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1, the values of etu and pdt can be obtained by any calculation method according to the value of t1, and for example, etu and pdt can be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=t1/5;
etu=2*t1,pdt=t1/10;
etu=t1/2,pdt=t1/5;
etu=t1/3,pdt=t1/15;
........
the above-mentioned specific implementation of determining the time parameter of the current data transmission in this embodiment is only an exemplary implementation, and the present invention does not exclude other implementations in which the time parameter generation rule is generated to determine the time parameter of the current data transmission according to at least two first time intervals in the first time interval group, or according to at least two second time intervals in the second time interval group, or according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group.
In this embodiment, the time parameters etu and pdt are determined by the first time interval group and/or the second time interval group, so that the values of the sending end and the receiving end to etu and pdt are kept consistent during each data transmission, and the stability and accuracy of each data transmission are ensured, because the receiving end re-determines the values of the time parameters etu and pdt according to handshake information sent by the sending end before each data transmission, the error accumulation caused by the continuous receiving and adding of a plurality of characters due to frequency difference is avoided, and the problems of receiving error and reduced communication efficiency caused by sampling dislocation of the receiving end due to too large difference between the sending clock and the receiving time parameter are effectively prevented.
As an optional implementation manner of this embodiment, if the first time interval and the second time interval satisfy the preset relationship and do not satisfy the preset relationship, the step of receiving the handshake signal is continuously performed, that is, the process returns to step S101.
Step S106: data is received according to the time parameter.
Specifically, in step S106, please refer to the specific flow of the data receiving method in embodiment 2 according to the implementation manner of receiving data according to the time parameter determined by the handshake signal.
Further, after receiving the data according to the time parameter, the method further includes: data transmission is performed according to the time parameter, please refer to a specific flow of the data transmission method in embodiment 4.
The data transmission method provided by the embodiment re-determines the time parameter according to the handshake information before receiving data each time, so that the time parameters of the sending end and the receiving end are always kept consistent, and the stability and the accuracy of data transmission are ensured; the signal is transmitted by adopting a pulse signal, so that the signal is conveniently distinguished from a noise signal; the method comprises the steps of detecting a rising edge or a falling edge triggered by each signal, easily obtaining the starting time of each signal, accurately and quickly obtaining a time interval between the starting times of two adjacent signals, judging whether the time interval between the signals meets a preset relation or not according to the obtained time interval, judging whether the received signals are effective handshake signals or not, enabling the judging process to be accurate and quick, enabling the success rate to be high, determining a first time interval group and/or a second time interval group according to the first time interval and/or the second time interval group, and determining time parameters etu and pdt according to the first time interval group and/or the second time interval group, so that the values of a sending end and a receiving end are kept consistent during each data transmission, the stability and the accuracy of each data transmission are guaranteed, and the receiving end can re-determine the time parameters etu and pdt according to handshake information sent by the sending end before each data transmission The value of (2) avoids error accumulation caused by continuous addition and reception of a plurality of characters due to frequency difference, and effectively prevents the technical problems of receiving error and reduced communication efficiency caused by sampling dislocation of a receiving end when the parameter difference between a sending clock and receiving time is too large.
Example 2
This embodiment provides a data receiving method, and fig. 2 is a flowchart of an alternative method for receiving data according to a time parameter determined by a handshake signal based on the data transmission shown in fig. 1 in this embodiment 1.
As shown in fig. 2, the receiving data according to the time parameter determined by the handshake signal includes the steps of:
step S201, receiving X signals, determining the time interval between the starting time of every two adjacent signals in the X signals, and obtaining X-1 time intervals, wherein X is a positive integer and is greater than 1.
In an optional implementation manner of this embodiment, the receiving X signals may be detecting X times of low level pulses, or detecting X times of high level pulses. The low level pulse/high level pulse may be represented by a waveform such as a square wave, a sine wave, a triangular wave, etc., which can distinguish between high and low level pulses, and is not limited herein. The method is preferably used for detecting low-level pulses, namely the transmitting end can generate the low-level pulses under the condition of providing high levels for the receiving end, and in this way, when the transmitting end communicates with the receiving end, the receiving end can use the high levels provided by the transmitting end as a power supply to provide electric energy for electric consumption parts of the receiving end.
In an optional implementation manner of this embodiment, before step S201, step S201a is further included, where K signals are received, and it is detected whether K signals satisfy a preset relationship, where K is greater than or equal to 2 and is an integer. Since only one time interval is generated between two adjacent signals, at least two handshake signals should be received to obtain at least one time interval. The receiving end can judge whether the K signals are handshake signals by judging whether the K signals meet the preset relationship. The receiving end receives the handshake signals, and can judge the starting position of data transmission according to the handshake signals, so that the data transmission efficiency is improved.
Alternatively, in step S201a, a time interval between K signals may be detected, and it may be determined whether a preset relationship is satisfied between a first time interval and a second time interval, where the first time interval is a time interval between a start time of an ith signal and a start time of an i-1 th signal, the second time interval is a time interval between a start time of an ith signal and a start time of an i +1 th signal, i is 2,4, … …,2j, j is (K-1)/2, K ≧ 3, and K is an odd number; if the first time interval and the second time interval satisfy a preset relationship, executing a step of receiving X signals, that is, determining that the received K signals are handshake signals and the signals after the K signals are data transmission signals, wherein the value of K may be predetermined in advance. Further, if the first time interval and the second time interval do not satisfy the preset relationship, the time interval between the subsequent K signals continues to be detected, and whether the first time interval and the second time interval of the subsequent K signals satisfy the preset relationship until the K signals conforming to the preset relationship are detected is determined. Further, the preset relationship that is satisfied between the first time interval and the second time interval may be a predetermined relationship between any transmitting end and any receiving end, for example, the second time interval is twice as long as the first time interval. The receiving end can judge whether the received signal is a handshake signal by judging whether the received data meets a preset relation. As an alternative, the preset relationship may be t1 ═ a × t0 and t3 ═ a × t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers ≧ 1, for example, a ═ 2, and this predetermined relationship may be various and will not be described herein again.
Further, the K signals received in step S201a may also carry a time parameter, and in the scheme of embodiment 1, the time parameter may be determined according to the K signals. Optionally, a first time interval group and a second time interval group may be determined first, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals, and then the time parameter may be determined according to the first time interval group and the second time interval group. For example, if 5 handshake signals are transmitted by the transmitting end, the first time interval t1 is etu, and the second time interval t2 is etu + pdt, the receiving end may determine values of the time parameters etu and pdt according to the first time interval and the second time interval. The time parameter is determined through the K signals, the condition that the theoretical time parameter of the receiving end is inconsistent with the actual time parameter can be overcome, and the accuracy of data transmission is guaranteed.
Similar to the signal for transmitting data, the receiving end may confirm reception of K signals in the case of detecting K low level pulses. Alternatively, K high pulses may be detected to confirm reception of K signals. The low level/high level pulse may be implemented in a square wave, sine wave, or the like. The method is characterized in that the low level pulse is preferably detected, namely the sending end provides the high level to the receiving end, and the K times of low level pulse is generated when K signals need to be sent, so that the receiving end can use the high level provided by the sending end as a power supply when the sending end communicates with the receiving end, or the receiving end is not internally provided with the power supply and directly uses the high level of the sending end as the power supply.
In an optional implementation manner of this embodiment, the receiving the X signals includes: and receiving Z signals, and removing interference in the Z signals to obtain X signals, wherein Z is larger than or equal to X.
Step S202, according to the time parameter of the current data transmission determined by the scheme in the embodiment 1, obtaining the numerical value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals to obtain the numerical value of S time interval transmission, wherein the numerical value is 2 included in the N-bit dataNOne of different values, wherein, when S is more than 1, S time intervals are the same, X and S are positive integers, S is less than or equal to X-1, and N is greater than or equal to 1. That is, in X-1 time intervals, in the case that S > 1, every S consecutive time intervals are the same, wherein the value of N bits of data corresponding to a single time interval is the value transmitted by the S time intervals. For example, when 7 signals are received, 6 time intervals are obtained, where 3 consecutive time intervals are the same, that is, the sending end uses a plurality of the same time intervals to represent the value of N-bit data, obtains N-bit data corresponding to a single time interval in the 3 time intervals, further obtains the value transmitted by the 3 time intervals, and obtains the value transmitted by 1 time interval when S is 1.
As an optional implementation manner of the embodiment of the present invention, according to the time parameter of current data transmission determined by the scheme in embodiment 1, a numerical value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals is obtained, and a numerical value transmitted in S time intervals is obtained, and a plurality of calculation manners may be adopted to calculate a numerical value corresponding to a single time interval, for example: the predetermined or negotiated value of m is calculated from etu and pdt, for example, if the value of m is received in a time interval corresponding to the time interval obtained in etu + m pdt. For example, when m is 1, if each set of preset or negotiated data is 1 bit, the value is 1, if each set of data is 2 bits, the value is 01, if each set of data is 3 bits, the value is 001, and if each set of data is 4 or more bits, the manner of obtaining the value is the same, which is not described herein again.
According to the first time parameter etu and the second time parameter pdt, according to the encoding and decoding rule predetermined with the data transmitting end, obtaining 2 contained in the N-bit dataNThe predetermined encoding and decoding rule may be any manner capable of ensuring that N data bits of different values correspond to a unique time interval, exemplarily:
when N is 1, N data bits of different values include: 0.1, at this time,
0 ═ etu, 1 ≠ etu + pdt, and etu ≠ etu + pdt, or,
0 ═ 2etu, 1 ≠ etu +2pdt, and 2etu ≠ etu +2pdt,
……
when N is 2, 2 bits of different values include: 00. 01,10,11, and at this time,
00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, 11 ≠ etu +3pdt, and etu ≠ etu + pdt ≠ etu +2pdt ≠ etu +3pdt, or,
00=2etu,01=etu+2pdt,10=etu+2.5pdt,11=1.3etu+3pdt,
and 2etu is not equal to etu +2pdt is not equal to etu +2.5pdt is not equal to 1.3etu +3pdt,
……
likewise, when N is 3, N data bits of different values include: 000. 001, 010, 011, 100, 101, 110, 111, at this time, according to the first time parameter etu and the second time parameter pdt, obtaining 2 bits included in the N-bit data according to the encoding and decoding rule agreed in advance with the data sending endNFor the time intervals corresponding to different values, the predetermined encoding and decoding rules can refer to the above examples, which are not described herein again,
obtaining 2 contained in the N bits of data according to the first time parameter etu and the second time parameter pdt in a manner predetermined with the data sending endNAnd time intervals corresponding to different values are different, so that different data bits corresponding to different received time intervals are distinguished, and the data sent by the sending end is obtained through the received time intervals.
As an optional implementation manner of the embodiment of the present invention, according to the determined time parameter of the current data transmission, a value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals is obtained, so as to obtain a value transmitted in S time intervals, where the value is 2 included in N-bit dataNOne of the different values, where, in the case of S > 1, S time intervals are the same, X and S are positive integers, and S ≦ X-1, N ≧ 1 can be understood as:
according to the determined time parameter of the current data transmission, obtaining a bit string corresponding to a single time interval in every continuous S time intervals in X-1 time intervals to obtain the bit string transmitted by S time intervals, wherein the transmitted value of S time intervals is the bit string corresponding to the single time interval, and when S is larger than 1, the S time intervals are the same, S is a positive integer, and S is smaller than or equal to X-1. For example, when X is 2 and S is 1, there is only one time interval, and a bit string corresponding to the time interval is obtained; when X is 3 or more and S is 1, a plurality of time intervals are provided, and a bit string corresponding to each time interval is obtained; when X is 3 and S is 2, there are two time intervals, which are the same and correspond to one bit string, and the two time intervals represent the bit string corresponding to the one time interval; when X is 5 or more, S ═ 2, there are four time intervals, one of the first two consecutive time intervals corresponds to one bit string, and one of the last two consecutive time intervals corresponds to the other bit string, that is, the first two time intervals represent one bit string, and the last two time intervals represent the other bit string. Of course, the above examples are only exemplary, and all the ways that the bit strings transmitted in S time intervals can be obtained are within the scope of the present invention.
In an optional implementation manner of this embodiment, before obtaining the values transmitted in the first consecutive S time intervals of the X-1 time intervals in step S202, step S202' may be further included to obtain 2 bits included in the N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, N is more than or equal to 1, and the pre-calculation of 2 contained in the N bits of data is adoptedNThe data bits of the received time interval are determined in different values and time intervals, so that the decoding time after the data is received can be further reduced. As an optional implementation manner of the embodiment of the present invention, 2 included in the N-bit data is obtained according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N ≧ 1 can be understood as: according to time parameter acquisition 2NThe corresponding relation between each bit string and the time interval in the bit strings with the length of N, wherein, 2NThe bit strings are different from each other, the time intervals corresponding to the different bit strings are different, and N is larger than or equal to 1.
In an alternative implementation of this embodiment, the N-bit data comprises 2NThe different values are understood to be: for example, when N is 1,1 bit data, which contains 21Different values, 0,1 respectively; when N is 2, 2-bit data, packet thereofContains 22The values are 00,01,10 and 11. Obtaining 2 contained in N-bit data according to time parameterNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 1, a time interval corresponding to 0 is obtained according to the time parameter, and a time interval corresponding to 1 is obtained according to the time parameter; when N is 2, acquiring a time interval corresponding to 00 according to the time parameter, acquiring a time interval corresponding to 01 according to the time parameter, acquiring a time interval corresponding to 10 according to the time parameter, and acquiring a time interval corresponding to 11 according to the time parameter. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again.
Optionally, the receiving end of the data may calculate the time interval of the data bit by using a calculation method preset or determined by negotiation with the transmitting end of the data, for example, when N is equal to N, the calculation method of the time interval of transmitting the data bit m is as follows: the time interval corresponding to the value m is etu + m pdt (where m is 0. ltoreq. m.ltoreq.2)n-1, etu is the first time parameter, pdt is the second time parameter, for example etu-10 μ s, pdt-30 μ s), i.e. the time interval calculation method corresponding to the value 11 may be 10 μ s + 3-30 μ s-100 μ s, and the time interval corresponding to the value may be calculated by this alternative embodiment. Of course, the present invention may also use other pre-negotiated calculation methods to determine the time interval, which is not limited in this embodiment. The time interval of the data bit is calculated by a pre-negotiated calculation method, so that the expandability of data transmission can be ensured, namely, the sending end and the receiving end can calculate the time interval of the data bit no matter what the value of N is. Then, the receiving end can compare the calculated time interval with the received time interval, so as to directly determine the value corresponding to the time interval, and improve the efficiency of determining data.
As another optional implementation manner of the embodiment of the present invention, the receiving end of the data may also determine the time interval corresponding to the value by using a list negotiated and stored with the sending end of the data in advance, and determine the time interval corresponding to the value by using a manner of looking up the list, so as to improve efficiency of obtaining the time interval corresponding to the value.
In an optional implementation manner of this embodiment, X-1 ═ n × S, n ≧ 1 and n are integers, and with this optional implementation manner, X signals can just transmit n × S data bits, and the problem of being unable to decode due to redundant signals does not occur.
In an optional implementation manner of this embodiment, in the data transmission process, the time parameter may also be replaced, that is, after step S202, step S203 may further be included: according to a preset rule, replacing a currently used time parameter with a new time parameter, taking the new time parameter as a time parameter of current data transmission, receiving X signals, determining a time interval between starting moments of every two adjacent signals in the X signals to obtain X-1 time intervals, then using the time parameter of current data transmission to obtain a numerical value corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals to obtain a numerical value transmitted by the S time intervals, wherein the numerical value transmitted by the S time intervals is the numerical value corresponding to the single time interval, and the numerical value is 2 contained in N-bit dataNOne of different values, wherein in case of S > 1, S time intervals are the same. In this embodiment, the determination of the new time parameter may be completed by negotiation between the sending end and the receiving end, or may be completed by searching a pre-stored time parameter table by the sending end and the receiving end, for example, when a certain type of data is sent, the table is searched to determine the time parameter that should be used by the type of data. The time parameter of the sending end can be changed, and can be matched with the receiving ends with different data processing capabilities or different types of data, so that the data processing efficiency can be further improved.
In an optional implementation manner of this embodiment, after the last data is received in step S202, the sending end may further send a number a of end signals (a is greater than or equal to 1 and is an integer), and the receiving end may further receive a number a of end signals, where the end signals may be the same as the handshake signals, or may be signals in other specific formats, and through the end signals, the receiving end may determine whether the data reception is ended.
In an optional implementation manner of this embodiment, after the receiving of the last data is completed in step S202, or after the receiving of the last data is completed and before the a end signals are received, the receiving end may further receive the check data sent by the sending end, and through the check data, the data receiving end may determine whether the received data is complete and correct. The check data includes check data calculated by check methods such as MAC check, parity check, and checksum check.
According to the technical scheme provided by the embodiment of the invention, the receiving end can determine the data bit of the received waveform according to the time interval of the received waveform, can receive data only by using two lines, and can effectively reduce the volume of the electronic equipment when being applied to the electronic equipment.
The following is a simple example of the data receiving method provided by the embodiment of the present invention, where the bit string to be received is 0011100100, and N is 2:
in the scheme of embodiment 1, the time parameter of the current data transmission is determined, and optionally, two time parameters, that is, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s and pdt is 30 μ s, and in the embodiment of the present invention, the time parameter is a time length occupied by data transmission. The number of the time parameters does not have a corresponding relationship with N, and only needs to be consistent with the negotiation of the sending end.
In step S201, 6 signals are received, and a time interval between start times of every two adjacent signals in the 6 signals is determined, so as to obtain 5 time intervals etu, etu +3pdt, etu +2pdt, etu + pdt, and etu.
In step S202, 2-bit data corresponding to the 5 time intervals are obtained, and in this embodiment, the calculation method m ═ etu + m × pdt pre-negotiated with the sending end of the data may be obtained according toIf a value corresponding to the time interval, for example, a received time interval of 100 μ s, then m is 3, i.e., the value transmitted in the time interval is 11. Before the step, 2 contained in the N-bit data can be obtained according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 2, the correspondence between 4 different values contained in the 2-bit data and the time interval is obtained according to the time parameter, that is, 00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, and 11 ═ etu +3pdt, that is, if the time interval of 100 μ s is received, the value transmitted in the time interval can be directly determined to be 11. Eventually completing the reception of bit string 0011100100.
In this embodiment, according to different sending strategies of the sending end, the receiving end may receive a group of data represented by one time interval, for example, 00 represented by one time etu time interval, and the data transmission speed is fast, or may receive a group of data represented by multiple times of the same time interval, for example, 00 represented by three times of etu time intervals, and the data transmission accuracy is high, so that misjudgment caused by time interval loss can be prevented.
In the following, a simple example of the data transmission method in the present invention is given as 0011100100, where N is 1:
in the scheme of embodiment 1, the time parameter of the current data transmission is determined, and optionally, two time parameters, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s, and pdt is 30 μ s. The number of the time parameters does not correspond to N, and the embodiment does not limit the specific number of the time parameters, as long as the time interval corresponding to the value of the data bit can be expressed.
In step S201, 11 signals are received, and a time interval between start times of every two adjacent signals in the 11 signals is determined, so as to obtain 10 time intervals etu, pdt, etu, pdt, etu, and etu;
step S202, obtaining 1-bit data corresponding to the 10 time intervals, obtaining a value 0 transmitted by the etu time interval, obtaining a value 1 transmitted by the pdt time interval, obtaining a value 1 … … transmitted by the pdt time interval, obtaining a value 0 transmitted by the etu data interval, and finally completing receiving the bit string 0011100100.
In this embodiment, according to different sending strategies of the sending end, the receiving end may receive the time interval representing 1-bit data once, for example, the time interval representing a value of 0 when etu is received only once, the data transmission speed is fast, or may receive the same time interval representing 1-bit data for multiple times, for example, the time interval representing a value of 0 when etu is received three times, the data transmission accuracy is high, and misjudgment caused by time interval loss can be prevented.
The following is a simple example of the data receiving method provided by the embodiment of the present invention, where the bit string to be received is 0011100100, and N is 3:
in the scheme of embodiment 1, the time parameter of the current transmission is determined, and optionally, two time parameters, that is, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s and pdt is 30 μ s. The number of the time parameters does not have a corresponding relationship with N, and only needs to be consistent with the negotiation of the sending end.
In step S201, 5 signals are received, and a time interval between start times of every two adjacent signals in the 5 signals is determined, so as to obtain 4 time intervals etu, etu +3pdt, etu +4pdt, and etu +4 pdt.
Step S202 is to obtain 2-bit data corresponding to the 4 time intervals, in this embodiment, a value corresponding to the obtained time interval according to the calculation method m ═ etu + m × pdt negotiated in advance with the sending end of the data, for example, a received oneFor a 100 μ s interval, m can be found to be 3, i.e. the set of data is 101. Before the step, 2 contained in the N-bit data can be obtained according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 3, the correspondence between 8 different values included in the 3-bit data and the time interval is obtained according to the time parameter, that is, 000 ═ etu, 001 ═ etu + pdt, 010 ═ etu +2pdt, 011 ═ etu +3pdt, 100 ═ etu +4pdt, 101 ═ etu +5pdt, 110 ═ etu +6pdt, and 111 ═ etu +7pdt, that is, the time interval in which 100 μ s is received, the data bit can be directly determined to be 101. And finally, deleting the zero padding position according to the data digit pre-negotiated with the data sending end to complete the reception of the bit string 0011100100.
In this embodiment, according to different sending strategies of the sending end, the receiving end may receive a group of data represented by one time interval, for example, 000 represented by a time interval of etu is received only once, the data transmission speed is fast, or may receive a group of data represented by the same time interval for multiple times, for example, 000 represented by a time interval of etu is received three times, the data transmission accuracy is high, and misjudgment caused by time interval loss can be prevented. When N ≧ 4, the data receiving method when N ═ 2 or N ═ 3 can be referred to, and data is received, which is not described herein again.
Example 3
As shown in fig. 3, this embodiment provides a data transmission method, and to achieve the above object, the technical solution of the present invention is specifically implemented as follows:
step S301: determining a time parameter;
as an optional implementation manner in this embodiment, the time parameter may include a first time parameter and/or a second time parameter, for convenience of illustration, in this embodiment, the first time parameter is denoted as etu, the second time parameter is denoted as pdt, and both the first time parameter etu and the second time parameter pdt represent a period of time, for example, etu is 0.1 second, pdt is 0.01 second, the value is determined by negotiation between the data transmitting end and the receiving end, the time interval for transmitting the handshake signals can be determined by using the time parameter, and the receiving end can be determined according to the received handshake signals, of course, there may be only one time parameter or multiple time parameters, which is for convenience of description in this embodiment, only 2 time parameters are taken as an example, and the first time interval group and the second time interval group are determined by using the 2 time parameters, but the case of multiple time parameters is not excluded.
Step S302: determining a first time interval group and a second time interval group according to the time parameter;
the first time interval group comprises j first time intervals, and the second time interval group comprises j second time intervals; as an optional implementation manner in this embodiment, the first time interval refers to a time interval between the starting time of the ith signal and the starting time of the (i-1) th signal when the K handshake signals are sent in step S202, and is denoted by Ti-1,iThe second time interval is the time interval between the starting time of the ith signal and the starting time of the (i + 1) th signal when the K handshake signals are transmitted, and is denoted as Ti,i+1Wherein i is 2,4, … …,2j, j is (K-1)/2, K is not less than 3 and K is odd number.
In this embodiment, it should be noted that, first, the first time interval T in the first time interval groupi-1,iWith a second time interval T of a second group of time intervalsi,i+1Satisfy certain predetermined relation, can guarantee the validity of the signal of shaking hands through this predetermined relation to make the receiving end after receiving this signal of shaking hands, can be according to first time interval Ti-1,iAnd a second time interval Ti,i+1Judging that the handshake signal is a signal for indicating the start of receiving data; secondly, each first time interval T in the first time interval groupi-1,iThe first time parameter etu and/or the second time parameter pdt satisfy a certain preset relationship, so that after the receiving end receives the handshake signal, the receiving end can calculate the first time parameter etu and/or the second time parameter by a plurality of received first time intervals according to the same preset relationshipPdt, so that the receiving end can calculate the bit data corresponding to the transmitted time interval according to the first time parameter etu and/or the second time parameter pdt.
In the present embodiment, the first time interval T in the first time interval groupi-1,iWith a second time interval T of a second group of time intervalsi,i+1The predetermined relationship may include a plurality of types, and each of the first time intervals T in the first time interval groupi-1,iSatisfying certain predetermined relationships with the first time parameter etu and/or the second time parameter pdt also includes a variety, as explained in detail below in an exemplary manner.
As an alternative to this embodiment, taking K equal to 5 as an example, a total of 4 time intervals are generated between every two adjacent 5 signals, and when i equal to 2, the first time interval T is the first time interval T1,2Is the time interval between the start of the first signal and the start of the second signal, denoted T0, the second time interval T2,3The time interval between the start of the second signal and the third signal, labeled t 1; when i is 4, the first time interval T3,4Is the time interval between the start of the third signal and the start of the fourth signal, denoted T2, and the second time interval T4,5The time interval between the start of the fourth signal and the 5 th signal is marked t 3. At this time, t0 and t2 are first time interval groups, t1 and t3 are second time interval groups, and the first time interval and the second time interval satisfy a preset relationship, that is, the preset relationship is satisfied between t0 and t1, and between t2 and t3, and the preset relationship may be determined according to experience of a technician, or according to parameters during actual operation. As an alternative, the preset relationship may be t1 ═ a × t0 and t3 ═ a × t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers ≧ 1, for example, a ═ 2, and this predetermined relationship may be various and will not be described herein again.
In the following, taking the first time intervals t0 and t2 of the first time interval group as an example, the first time interval isEach first time interval T in the interval groupi-1,it0, t2 and the first time parameter etu and/or the second time parameter pdt satisfy a certain preset relationship, which is explained in detail as follows:
the first time intervals t0 and t2 are generated according to a preset time parameter generation rule according to one of the first time parameter etu or the second time parameter pdt, where etu is taken as an example, t0 and t2 may be obtained by any one of the following calculation methods, and of course, the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu;
t2=x*a*etu;
wherein a is a natural number greater than or equal to 1, and x is a rational number, so that the receiving end can calculate etu by using t0 and t2 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0 and t2 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and the t0 and t2 may be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=x*a*etu+b*pdt;
wherein, a and b are natural numbers equal to or greater than 1, and x is a rational number, therefore, the receiving end can calculate etu and pdt by using t0 and t2 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0 and t2 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and the t0 and t2 may be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=a*etu+x*b*pdt;
wherein, a and b are natural numbers equal to or greater than 1, and x is a rational number, therefore, the receiving end can calculate etu and pdt by using t0 and t2 according to the same preset time parameter generation rule.
Similarly, when K is 7, 6 time intervals are generated between two adjacent 7 signals, and when i is 2, the first time interval T is generated1,2Is the time interval between the start of the first signal and the start of the second signal, denoted T0, the second time interval T2,3The time interval between the start of the second signal and the third signal, labeled t 1; when i is 4, the first time interval T3,4Is the time interval between the start of the third signal and the start of the fourth signal, denoted T2, and the second time interval T4,5The time interval between the start of the fourth signal and the fifth signal, labeled t 3; when i is 6, the first time interval T5,6Is the time interval between the start of the fifth signal and the sixth signal, denoted T4, and the second time interval T6,7The time interval between the start of the sixth signal and the seventh signal, labeled t 5; at this time, t0, t2 and t4 are first time interval groups, t1, t3 and t5 are second time interval groups, t1, t3 and t5 of the second time interval groups and t0, t2 and t4 of the first time interval groups respectively satisfy preset relations, that is, preset relations are satisfied between t0 and t0, and between t0 and t0, the values of the first time intervals t0, t0 and t0 of the first time interval groups are determined by a preset time parameter generation rule according to the first time parameter etu and/or the second time parameter 0, the preset time parameter generation rule may be adopted, for example, the first time intervals t0, t0 and t0, the value may be generated by the preset time parameter generation rule according to one of the first time parameter etu or the second time parameter 0, and any one of the following ways may be obtained by the preset time parameter generation rule, the preset time parameter generation rule is not limited to the following calculation manner:
t0=a*etu;
t2=x*a*etu;
t4=2x*a*etu;
wherein a is a natural number greater than or equal to 1, and x is a rational number, so that the receiving end can calculate etu by using t0, t2 and t4 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0, t2 and t4 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and t0, t2 and t4 can be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=x*a*etu+b*pdt;
t4=2x*a*etu+b*pdt;
wherein a and b are natural numbers equal to or greater than 1, and x is a rational number, so that the receiving end can calculate etu and pdt by using t0, t2 and t4 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0, t2 and t4 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and t0, t2 and t4 can be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=a*etu+x*b*pdt;
t4=a*etu+2x*b*pdt;
wherein a and b are natural numbers equal to or greater than 1, and x is a rational number, so that the receiving end can calculate etu and pdt by using t0, t2 and t4 according to the same preset time parameter generation rule.
The above-described specific implementation of determining the first time interval group and the second time interval group of the current data transmission in this embodiment is only an exemplary implementation, and the present invention does not exclude an implementation of other time parameter generation rules to determine the first time intervals of the first time interval group according to the first time parameter etu and/or the second time parameter pdt, nor exclude a preset relationship of other first time intervals and second time intervals.
In this embodiment, the first time interval group is determined by the time parameter etu and/or pdt, so that it is ensured that the values of the sending end and the receiving end to etu and pdt are consistent during each data transmission, and the stability and accuracy of each data transmission are ensured.
Step S303: generating and transmitting K handshake signals;
as an optional implementation manner of this embodiment, in a specific implementation, generating and sending K handshake signals includes: generating and sending K handshake signals according to the first time interval group and the second time interval group; the first time interval and the second time interval in the K handshake signals satisfy the preset relationship, which may refer to the description of the preset relationship that needs to be satisfied by the first time interval and the second time interval in step S201.
In this embodiment, K is a preset value, K is greater than or equal to 3, and K is an odd number, and the signal may be a pulse signal, that is, a high-level pulse signal (rising edge signal) or a low-level pulse signal (falling edge signal) is received, and the pulse signal may be a square wave, a sine wave, a triangular wave, or other irregular waveform, or a combination of the above different waveforms.
In this embodiment, generating and transmitting K signals includes at least one of the following:
the first method is as follows: generating and transmitting K times of low-level pulses;
in this manner, the transmitting end triggers the low-level pulse K times in consecutive high levels, for example, after a first time interval of continuously triggering the high level, triggers the low-level pulse 1 times, and then resumes the state of triggering the high level, and after a second time interval elapses, triggers the low-level pulse 1 times, in such a manner that the low-level pulse K times can be continuously generated, the first time interval may be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval may be a time interval between a start time of the ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j (K-1)/2, K ≧ 3 and K is an odd number.
Illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, which is labeled t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, which is labeled t3, the transmitting end triggers 5 times of low level pulses in consecutive high levels, including: after continuously triggering the high level for a period of time, triggering the 1 st low level pulse, then restoring the state of triggering the high level again, after t0, triggering the 2 nd low level pulse, then restoring the state of triggering the high level again, after t1, triggering the 3 rd low level pulse, then restoring the state of triggering the high level again, after t2, triggering the 4 th low level pulse, then restoring the state of triggering the high level again, after t3, triggering the 5 th low level pulse, in such a way that the 5 th low level pulse can be continuously generated, and the first time interval and the second time interval satisfy a preset relationship, for example, t 1a t0 and t3 a t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers greater than or equal to 1, for example, a ═ 2, and the predetermined relationship may be various, which is not described herein again and forms an effective handshake signal;
the second method comprises the following steps: generating and transmitting K times of high-level pulses;
in this manner, the transmitting end triggers the high-level pulse K times in consecutive low levels, for example, after a first time interval of continuously triggering the low level, triggers the high-level pulse 1 times, and then resumes the state of triggering the low level, and after a second time interval elapses, triggers the high-level pulse 1 times, in such a manner that the high-level pulse K times can be continuously generated, the first time interval may be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval may be a time interval between a start time of the ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j (K-1)/2, K ≧ 3 and K is an odd number.
Illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, which is labeled t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, which is labeled t3, the transmitting end triggers 5 high level pulses in consecutive low levels, including: after the low level is continuously triggered for a period of time, triggering the 1 st high level pulse, then restoring the state of triggering the low level, after t0, triggering the 2 nd high level pulse, then restoring the state of triggering the low level, after t1, triggering the 3 rd high level pulse, then restoring the state of triggering the low level, after t2, triggering the 4 th high level pulse, then restoring the state of triggering the low level, after t3, triggering the 5 th high level pulse, in such a way, 5 times of high level pulses can be continuously generated, and the first time interval and the second time interval satisfy a preset relationship, for example, t 1a t0 and t3 a t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers greater than or equal to 1, for example, a ═ 2, and the predetermined relationship may be various, which is not described herein again and forms an effective handshake signal;
in the above manner, the K signals belong to the hopping signal, and the hopping amplitude is significant, so that the K signals are conveniently distinguished from the noise signal.
In addition, after the generating and sending K handshake signals, the method provided by this embodiment further includes: specifically, refer to the data transmission method described in embodiment 4 according to the step of transmitting data according to the first time parameter etu and the second time parameter pdt.
Example 4
The present embodiment provides a data transmission method, and fig. 4 is a flowchart of an alternative data transmission method based on the data transmission methods shown in fig. 1 in embodiment 1 and fig. 3 in embodiment 3. As shown in fig. 4, the data transmission method performs data transmission according to the determined time parameter, and includes the following steps:
step S401, according to the time parameter, obtaining 2 contained in the N-bit dataNAnd (3) corresponding relations between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1.
In step S401, the time parameter is the time parameter determined in embodiment 1 and embodiment 3, and specifically includes the first time parameter etu and the second time parameter pdt. As an optional implementation manner of this embodiment, 2 included in the N-bit data is obtained according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N ≧ 1 can also be understood as:
acquisition 2NBit string of length NThe correspondence of each bit string to a time interval, wherein 2NThe bit strings are different from each other, the time intervals corresponding to the different bit strings are different, and N is larger than or equal to 1. For example, when N is 1, each bit string in 2 bit strings with length 1 is 0 and 1, respectively, and when N is 2, each bit string in 4 bit strings with length 2 is: 00. 01,10 and 11, when N is 3 or more, refer to N is 2, which is not described herein again.
In an alternative implementation of this embodiment, the N-bit data comprises 2NThe different values are understood to be: for example, when N is 1,1 bit data, which contains 21Different values, 0,1 respectively; when N is 2, 2 bits of data, which contains 2 bits2The values are 00,01,10 and 11. Obtaining 2 contained in N-bit data according to time parameterNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 1, a time interval corresponding to 0 is obtained according to the time parameter, and a time interval corresponding to 1 is obtained according to the time parameter; when N is 2, acquiring a time interval corresponding to 00 according to the time parameter, acquiring a time interval corresponding to 01 according to the time parameter, acquiring a time interval corresponding to 10 according to the time parameter, and acquiring a time interval corresponding to 11 according to the time parameter. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again.
In an optional implementation manner of this embodiment, the sending end of the data may calculate the time interval corresponding to the value by using a calculation method determined by negotiating with the receiving end of the data in advance, for example, when N is equal to N, the calculation method of the time interval corresponding to the sending value m may be: the time interval corresponding to the value m is etu + m pdt (where m is 0. ltoreq. m.ltoreq.2)n-1, etu is the first time parameter, pdt is the second time parameter, for example etu-10 μ s, pdt-30 μ s), i.e. the time interval calculation method corresponding to the value 11 may be 10 μ s + 3-30 μ s-100 μ s, and the time interval corresponding to the value may be calculated by this alternative embodiment. Of course, the present invention may also use other pre-negotiated calculation methods to determine the time interval, which is not limited in this respect. By pre-coordinationThe quotient calculating method calculates the time interval corresponding to the numerical value, and can ensure the expandability of data transmission, namely, the sending end and the receiving end can calculate the corresponding relation between different numerical values and the time interval no matter what the value of N is.
Specifically, according to the first time parameter etu and the second time parameter pdt, the 2 bits included in the N-bit data are obtained according to the encoding and decoding rule predetermined by the data receiving endNThe predetermined encoding and decoding rule may be any manner capable of ensuring that N data bits of different values correspond to a unique time interval, exemplarily:
when N is 1, N data bits of different values include: 0.1, at this time,
0 ═ etu, 1 ≠ etu + pdt, and etu ≠ etu + pdt, or,
0 ═ 2etu, 1 ≠ etu +2pdt, and 2etu ≠ etu +2pdt,
……
when N is 2, N data bits of different values include: 00. 01,10,11, and at this time,
00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, 11 ≠ etu +3pdt, and etu ≠ etu + pdt ≠ etu +2pdt ≠ etu +3pdt, or,
00=2etu,01=etu+2pdt,10=etu+2.5pdt,11=1.3etu+3pdt,
and 2etu is not equal to etu +2pdt is not equal to etu +2.5pdt is not equal to 1.3etu +3pdt,
……
likewise, when N is 3, N data bits of different values include: 000. 001, 010, 011, 100, 101, 110, 111, at this time, according to the first time parameter etu and the second time parameter pdt, according to the encoding and decoding rule agreed in advance with the data receiving end, obtaining 2 included in the N-bit dataNFor the time intervals corresponding to different values, the above example is referred to for the pre-agreed codec rule, and the likeNo further description is given here to the details,
as another optional implementation manner of the embodiment of the present invention, the sending end of the data may also determine the time interval corresponding to the value by using a list negotiated and stored with the receiving end of the data in advance, and determine the time interval corresponding to the value by using a manner of looking up the list, so as to improve efficiency of obtaining the time interval corresponding to the value.
As another optional implementation manner of the embodiment of the present invention, after the sending end of the data calculates the time interval corresponding to the value by using a calculation method determined by negotiating with the receiving end of the data in advance, the sending end of the data searches a pre-stored list to determine whether the time interval corresponding to the calculated value belongs to the receiving range of the receiving end of the data. The time interval corresponding to the numerical value is obtained by further searching the list after the time interval corresponding to the numerical value is obtained through calculation, and the expansibility of data transmission can be improved on the premise of ensuring that a receiving end can normally receive the data.
Step S402, acquiring a data bit string to be sent currently.
In an optional embodiment of the present invention, a data sending end may generate a current data bit string to be sent by itself, or may receive the current data bit string to be sent from another device.
As an optional embodiment of the present invention, a sending end of data may be used as a switching device, which can switch communications between another device (hereinafter, referred to as a first terminal) and a receiving end of the data, and at this time, the sending end of the data obtains a data bit string to be currently sent by: step S402a, receiving first data through a first interface; step S402b, decoding the first data according to the protocol supported by the first interface, to obtain a first data bit string to be sent. When the sending end of data is as switching device, can have two communication interface, for example first interface and second interface, first interface is the interface that communicates with first terminal, and the second interface is the interface that communicates with the receiving terminal of data, and first interface can be current general interface, including wireless and wired interface, for example interfaces such as USB interface, audio interface, serial ports, bluetooth, wifi, NFC, can be connected to first terminal through this first interface to receive the first data that sends from first terminal. The first terminal can be a mobile phone, a computer, a PAD and other devices, and the first data can be data to be transmitted by the mobile phone, the computer and the PAD. Meanwhile, the first interface may decode the received first data by using a protocol supported by the first interface according to a difference in interface types, for example, the first interface may decode the first data according to a USB protocol, an audio protocol, a serial protocol, a bluetooth protocol, a wifi protocol, an NFC protocol, or the like, to obtain a data bit string corresponding to the first data, where the data bit string is a first data bit string to be sent (that is, a current data bit string to be sent). The second interface may be an interface connected to the electronic payment device (i.e. the receiving end of the data) through which the data bits are transmitted to the electronic payment device. The second interface may be a two-wire interface; the electronic payment device can realize the USBKey function, the OTP function, the smart card function and the like. The sending end of the data is used as a switching device, the first interface is used for data conversion, the data sent by the terminal can be converted into the data suitable for being communicated with the receiving end of the data, the conversion among different interfaces is realized, and the application range of the sending end of the data is expanded. When the sending end of the data is used as a switching device, the current data bit string to be sent is obtained through the first interface, and the data bit string to be sent is sent through the second interface by the data sending method recorded by the invention.
Step S403, grouping the data bit strings, where each group of data is N bits.
In this embodiment, optionally, step S402 and step S403 may be executed at any time before step S401,it is sufficient to acquire the data bit string and group it before data transmission. In addition, the sending end of the data may execute the step of determining the time parameter and the step S401 in embodiment 3 once before sending the data each time, or the sending end of the data may execute the step of determining the time parameter and the step S401 in embodiment 3 first, and then each time the data is sent, the step S401 is used to obtain the 2 bits included in the N-bit dataNThe corresponding relationship between the different values and the time interval is used to encode the data to be transmitted, or an effective time limit may be set, and the data transmitted within the effective time limit are obtained by using the 2 bits included in the N-bit data obtained in step S401NThe correspondence of the different values to the time intervals to encode the data to be transmitted. Alternatively, 2 of the N-bit data may be calculated once every time an event trigger is received, for example, a user inputs a time parameter of the current data transmissionNThe correspondence of the various values to the time intervals. The present embodiment is not particularly limited.
As an optional embodiment of the present invention, the data bit strings are grouped, each group of data is N bits, and may be grouped in various ways, and may be grouped in a way that each group includes 1 bit, or may be grouped in a way that each group includes 2 bits, when the data bit string includes a single number, since it is impossible to completely group according to 2 bits, the data bit string may be grouped after being complemented by 0, at this time, a sending end of data and a receiving end of data set or negotiate a way of complementing 0 in advance, when the data bit string is sent from a high order of data, 0 is complemented at a last order of the bit string, and when the data bit string is sent from a low order of data, 0 is complemented at a high order of the bit string. Of course, the cases where each group includes 3 bits or more may be grouped by referring to the manner where each group includes 2 bits, which is not described herein again.
Step S404, according to the obtained correspondence, sending the group of data in a manner that the time interval corresponding to the numerical value of each group of data represents the group of data.
In this embodiment, the value of each set of data may correspond to one time interval, or may correspond to a plurality of same time intervals. For example, referring to fig. 2, a group of data includes 2 bits, the value of the group of data may be 00,01,10, and 11, when the value of the group of data is 00, the value 00 may be represented by 1 time interval, and the time length corresponding to the 1 time interval may be etu, that is, the expression manner of the group of data 00 may be 1 time interval of, for example, 10 μ s, and when the group of data is 00, the value 00 may also be represented by 5 time intervals, and the time length of each of the 5 time intervals may be etu, that is, the expression manner of the group of data 00 may be 5 signals with the same time interval, and each time interval is a time interval of 10 μ s. The numerical value of each group of data corresponds to a time interval, so that the data transmission speed is high and the efficiency is high. The numerical value of each group of data corresponds to a plurality of time intervals, the numerical value corresponding to the time interval can be accurately judged, and errors caused by time intervals lost in the data transmission process are prevented.
In an optional implementation manner of this embodiment, for each group of data, when the group of data is transmitted, M signals may be generated and transmitted, where a time interval between a start time of each signal and a start time of an adjacent previous signal is a time interval corresponding to a numerical value of the group of data, M ≧ 1 and M is a natural number. The time interval generated by adopting the signal mode has the effects of easy detection and high stability.
Alternatively, M signals may be generated such that M low level pulses are generated at time intervals, or M signals may be generated such that M high level pulses are generated at time intervals. The low level pulse/high level pulse may be represented by a waveform such as a square wave, a sine wave, a triangular wave, etc., which can distinguish between high and low level pulses, and is not limited herein. Preferably, the low level pulse is generated according to the time interval, when the sending end communicates with the receiving end, the sending end can use the high level to supply power to the receiving end, and the information is transmitted in the low level pulse mode. The equipment adopting the method can complete power supply and information transmission simultaneously by using the same wire when information interaction is carried out, thereby reducing the volume of the equipment and the manufacturing cost.
In an optional implementation manner of this embodiment, after step S404, in order to meet the rate of the current data transmission, the time parameter may be replaced, that is, after step S404, the method further includes: according to a preset rule, replacing the currently used time parameter with a new time parameter, and taking the new time parameter as the time parameter of current data transmission; updating the corresponding relation according to the time parameter of the current data transmission; and in the subsequent data sending process, carrying out data transmission by using the updated corresponding relation. In this embodiment, the determination of the new time parameter may be completed by negotiation between the sending end and the receiving end, or may be completed by searching a pre-stored time parameter table by the sending end and the receiving end, for example, when a certain type of data is sent, the table is searched to determine the time parameter that should be used by the type of data. The time parameter of the sending end can be changed, and can be matched with the receiving ends with different data processing capabilities or different types of data, so that the data processing efficiency can be further improved.
In an optional implementation manner of this embodiment, after the step S404 completes sending the last group of data, the method may further include: and sending check data, wherein the data receiving end can judge whether the received data is complete and correct through the check data. The check data includes, but is not limited to, check data calculated by MAC check, parity check, checksum check, and the like.
In an optional implementation manner of this embodiment, after the sending of the last group of data bits is completed in step S404, or after the sending of the last group of data bits is completed in step S404, before the sending of the check data, the method may further include: and sending A ending signals (A is more than or equal to 1 and is an integer), wherein the ending signals can be the same as or different from the handshake signals, and the receiving end can judge whether the data bit is received and ended through the ending signals.
According to the technical scheme provided by the embodiment of the invention, the sending end can represent the data of the sending waveform according to the time interval of the sending waveform, can finish the sending of the data by using two lines only, and can effectively reduce the volume of the electronic equipment when being applied to the electronic equipment.
The following briefly exemplifies the data transmission method provided by the embodiment of the present invention, with the bit string to be transmitted being 0011100100, where N is 2:
in embodiment 1 and embodiment 3, the time parameter of the current transmission is determined, and optionally, two time parameters, namely, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s and pdt is 30 μ s. The number of the time parameters does not have a corresponding relationship with N, and only needs to be consistent with the receiving end.
In step S401, 2 included in the N-bit data is acquired according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 2, the correspondence relationship between 4 different values included in the 2-bit data and the time interval may be obtained according to the time parameter, that is, 00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, and 11 ═ etu +3 pdt.
In step S402, a data bit string 0011100100 to be sent currently is acquired;
in step S403, the data bit strings 0011100100 are grouped, each group of data is 2 bits, that is: 0011100100, respectively;
in step S404, the group of data is sent in a manner that the time interval corresponding to the numerical value of each group of data represents the group of data according to the obtained correspondence. In this embodiment, the value of each set of data may correspond to a time interval, or may correspond to a plurality of same time intervals, for example, 00 may correspond to an etu time interval (e.g., 10 μ s), and another signal is sent at the time interval after a signal, so that the time length of the etu formed in this way represents the value 00; of course, 00 may also correspond to three etu time intervals (for example, each time interval is 10 μ s), and after one signal, three signals are continuously transmitted at the etu time interval, and the receiving end considers that the value 00 is received only when receiving the same three time durations. When a plurality of identical time intervals are used to represent each group of data bits, the sending end and the receiving end of the number of the time intervals are the same, and the specific embodiment is not limited.
In this embodiment, the transmission value 00 may be represented by an etu time interval, the transmission value 11 may be represented by an etu +3pdt time interval, the transmission value 10 may be represented by an etu +2pdt time interval, the transmission value 01 may be represented by an etu + pdt time interval, and the transmission value 00 may be represented by an etu time interval in the order of the data bit string. Taking the example where each set of data values corresponds to a time interval, the waveform of the transmitted data bit string 0011100100 is shown in fig. 5, and the transmission of the data bit string is completed by the time interval between the signals.
The following briefly exemplifies the data transmission method provided in the embodiment of the present invention, with the bit string to be transmitted being 0011100100, where N is 1:
in embodiments 1 and 3, the time parameter of the current transmission is determined, and optionally, two time parameters, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s and pdt is 30 μ s. The number of the time parameters does not correspond to N, and the embodiment does not limit the specific number of the time parameters, as long as the time interval corresponding to the value of the data bit can be expressed.
In step S401, 2 included in the N-bit data is acquired according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 1, the correspondence between 2 different values included in 1-bit data and the time interval is obtained according to the time parameter, that is, the correspondence is obtainedIt may be that 0 ═ etu, 1 ═ pdt, and in the present invention, the time interval corresponding to the value of 1-bit data may be expressed in various combinations of time parameters, but is not limited thereto.
In step S402, a data bit string 0011100100 to be sent currently is acquired;
in step S403, the data bit strings 0011100100 are grouped, each group of data includes 1 bit, that is: 0011100100, respectively; this step may also be omitted.
In step S404, the group of data is sent in a manner that the time interval corresponding to the numerical value of each group of data represents the group of data according to the obtained correspondence. In this embodiment, the value of each set of data may correspond to a time interval, or may correspond to a plurality of same time intervals, for example, 0 may correspond to an etu time interval (e.g., 10 μ s), and another signal is sent at the time interval after a signal, so that the time length of the etu formed in this way represents a value of 0; of course, 0 may also correspond to three etu time intervals (for example, each time interval is 10 μ s), and after one signal, three signals are continuously transmitted at the etu time intervals, and the receiving end considers that the value 0 is received only when receiving the same three time durations.
In this embodiment, each group of data may be transmitted in the order of the data bit string, that is, the time intervals of the respective signals are the time interval of etu, the time interval of pdt, the time interval of pdt, the time interval of pdt, the time interval of etu, the time interval of pdt, the time interval of etu, and the time interval of etu, respectively. Taking the example where the value of each set of data corresponds to a time interval, the waveform of the transmitted data bit string 0011100100 is as shown in fig. 6, and the transmission of the data bit string is completed by the time interval between the signals.
The following briefly exemplifies the data transmission method provided by the embodiment of the present invention, with the bit string to be transmitted being 0011100100, where N is 3:
in embodiments 1 and 3, the time parameter of the current transmission is determined, and optionally, two time parameters, a first time parameter etu and a second time parameter pdt, may be determined, where etu is 10 μ s and pdt is 30 μ s. The number of the time parameters and N do not have a corresponding relationship, and the embodiment does not limit the specific number of the time parameters, as long as the time interval corresponding to the value can be expressed.
In step S401, the corresponding relationship between 2N different values included in the N-bit data and the time interval is obtained according to the time parameter. For example, when N is 3, the correspondence relationship between 8 different values included in the 3-bit data and the time interval is obtained according to the time parameter, for example, 000-etu, 001-etu + pdt, 010-etu +2pdt, 011-etu +3pdt, 100-etu +4pdt, 101-etu +5pdt, 110-etu +6pdt, and 111-etu +7 pdt.
In step S402, a data bit string 0011100100 to be sent currently is acquired;
in step S403, the data bit strings 0011100100 are grouped, each group of data is 3 bits, in this embodiment, when the obtained data bit strings are not integer multiples of the number of bits included in each group, zero padding operation is performed on the data bit strings, and when the transmission order of the data bit strings is from low to high, the high zero padding grouping is: 000011100100, when the transmission order of the data bit string is from high to low, the low zero padding packet is 001110010000.
In step S404, the group of data is sent in a manner that the time interval corresponding to the numerical value of each group of data represents the group of data according to the obtained correspondence. In this embodiment, the value of each set of data may correspond to one time interval, or may correspond to a plurality of same time intervals.
In this embodiment, for example, each group of data bits is transmitted in the order from the lower bit to the upper bit of the data bit string, that is, a signal of an etu +4pdt time interval, a signal of an etu +4pdt time interval, a signal of an etu +3pdt time interval, and a signal of an etu time interval. Taking the example where each set of data values corresponds to a time interval, the waveform of the transmitted data bit string 0011100100 is shown in fig. 7, and the transmission of the data bit string is completed by the time interval between the signals. Of course, if each group of data bits is sent from the high bit only in the order of the low bit, only zero padding is needed in the low bit, and the data sending mode is similar to that from the low bit to the high bit, but the signals are sent in sequence by using the time interval corresponding to the value from the high bit, which is not described herein again.
When N ≧ 4, data can be transmitted with reference to the data transmission method when N ≧ 2 or N ≧ 3.
When N is 1.5, data can be transmitted by referring to the data transmission method when N is 2, except that:
at least 2 time intervals are used for corresponding to values in 3-bit data, namely when the value of N is a non-integer, a plurality of time intervals can be used for corresponding to different values in B-bit data, wherein B is an integral multiple of N, and B is a positive integer.
Example 5
The present embodiment provides a data processing apparatus, as shown in fig. 8, including: a receiving module, a judging module, a time processing module and a data processing module, wherein,
the receiving module is used for receiving K signals;
k is a preset value, K ≧ 3 and K is an odd number, for example, K is set to 5 in advance, when the receiving module cumulatively receives 5 signals, the determining module, the time processing module and the data processing module process the received 5 signals, the data processing device provided by this embodiment may determine whether to start receiving data according to a relationship of time intervals between the K signals, that is, if the preset relationship is satisfied, the data reception is started after the K signals, the K signals may be regarded as handshake signals indicating the start of receiving data; the signal may be a pulse signal, that is, a high-level pulse signal (rising edge signal) or a low-level pulse signal (falling edge signal) is received, and the pulse signal may be a square wave, a sine wave, a triangular wave, or other irregular waveform, or a combination of the above different waveforms.
In this embodiment, the receiving module is configured to receive K signals, and includes at least one of the following modes:
the first method is as follows: the receiving module detects K times of low level pulses;
in this manner, the receiving module may detect K times of low level pulses in the continuous high level, for example, after the receiving module detects the high level for a period of time, detect 1 time of low level pulses, and then resume the state of detecting the high level, and after a period of time, detect 1 time of low level pulses again, in this manner, the receiving module may detect K times of low level pulses continuously;
the second method comprises the following steps: the receiving module detects K times of high level pulses;
in this manner, the receiving module may detect K times of high level pulses in the continuous low level, for example, after the receiving module detects the low level for a period of time, detect 1 time of high level pulses, and then resume the state of detecting the low level, and after a period of time, detect 1 time of high level pulses again, in this manner, the receiving module may continuously detect the K times of high level pulses;
in the above manner, the K signals belong to the hopping signal, and the hopping amplitude is significant, so that the K signals are conveniently distinguished from the noise signal.
A judging module for detecting the time interval between every two adjacent K signals,
in this embodiment, after the receiving module continuously receives the K signals, the determining module detects a time interval between every two adjacent signals in the K signals, and optionally, when the K signals are K low-level signals in continuous high levels, the determining module determines that a time duration from a starting time of a p-th low-level signal to a starting time of a p + 1-th low-level signal is a time interval between the p-th and p + 1-th signals; similarly, when the K signals are K high-level signals in continuous low levels, the judging module determines that the time length from the starting time of the p-th high-level signal to the starting time of the p + 1-th high-level signal is the time interval between the p-th signal and the p + 1-th signal; wherein p is more than or equal to 1 and less than or equal to K-1, and p is a natural number; as an alternative embodiment, the determining module detects the start time of each pulse signal, so as to accurately and quickly obtain the time interval between the start times of two adjacent signals.
The judging module is also used for judging whether the first time interval and the second time interval meet the preset relation or not,
as an alternative implementation manner of this embodiment, the first time interval may be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval may be a time interval between a start time of an ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j is (K-1)/2, K ≧ 3 and K is an odd number; illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start of the fourth signal, denoted t2, and the second time interval is the time interval between the fourth signal and the start of the 5 th signal, denoted t 3. The judgment of whether the first time interval and the second time interval satisfy a preset relationship means that whether the preset relationship is satisfied simultaneously between t0 and t1 and between t2 and t3 is judged, the preset relationship can be determined according to the experience of technicians or according to parameters in actual operation, and as long as the preset relationship is satisfied, the K signals can be determined as handshake signals indicating that data reception starts. As an alternative, the preset relationship may be t1 ═ a × t0 and t3 ═ a × t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers ≧ 1, for example, a ═ 2, and this predetermined relationship may be various and will not be described herein again; when the judging module judges that the first time interval and the second time interval meet the preset relation, the K signals can be judged to be effective handshake signals.
The time processing module is used for determining a first time interval group and/or a second time interval group, wherein the first time interval group comprises j first time intervals, the second time interval group comprises j second time intervals, j is (K-1)/2, K is larger than or equal to 3, and K is an odd number;
when the values of i are different, the time processing module may generate a series of first time intervals and second time intervals according to K-1 time intervals generated by the K signals, and the time processing module may select at least 1 time interval from a plurality of different first time intervals to become a first time interval group, and similarly, the time processing module may also select at least 1 time interval from a plurality of different second time intervals to become a second time interval group, for example, when K is 5, the first time intervals t0 and t2, and the second time intervals t1 and t3 are generated in 5 signals, at this time, the time processing module may select t0 and t2 as the first time interval group and t1 and t3 as the second time interval group, in this embodiment, the number of time intervals in the first time interval group and the second time interval group is not limited, and is j, at least one time may be, and the time processing module may determine the first time interval group and/or the second time interval group in this manner And the interval groups are convenient for classifying the time intervals.
If the first time interval and the second time interval meet a preset relationship, the time processing module determines a time parameter of current data transmission according to at least one first time interval in a first time interval group and/or at least one second time interval in a second time interval group;
the time processing module determines a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group, specifically: the time processing module generates a rule according to at least two first time intervals in the first time interval group, or according to at least two second time intervals in the second time interval group, or according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group, according to a time parameter agreed in advance with the data sending end, and the first time interval and the second time interval are not adjacent.
In this embodiment, in the determined first time interval group and the second time interval group, when both a first time interval between the ith signal and the (i-1) th signal and a second time interval between the ith signal and the (i + 1) th signal satisfy a preset relationship, the K signals may be determined as valid handshake signals, and at this time, the time processing module generates a rule according to at least two first time intervals in the first time interval group, or according to at least two second time intervals in the second time interval group, or according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group, according to a time parameter predetermined by the data transmitting end, and the first time interval and the second time interval are not adjacent, and determines a time parameter of current data transmission, wherein, the pre-agreed time parameter generation rule can select any kind of mode to determine the time parameter on the premise of ensuring that each data bit coding mode is unique;
for example, when K is 5, 4 time intervals are generated between two adjacent signals in 5 signals, when i is 2, the first time interval is the time interval between the start time of the first signal and the start time of the second signal, which is labeled as t0, and the second time interval is the time interval between the start time of the second signal and the start time of the third signal, which is labeled as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, denoted as t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, denoted as t 3; taking this as an example, a detailed description is given below of a manner of determining a time parameter of a current data transmission according to at least one first time interval in a first time interval group and/or at least one second time interval in the second time interval group.
As an optional implementation manner of this embodiment, the time processing module selects t0 and t2 as the first time interval group, and determines the time parameter of the current data transmission according to the first time interval group, where the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0 and t2, and the values of etu and pdt may be obtained by any calculation manner according to the values of t0 and t2, and exemplarily, etu and pdt may be obtained by any one of the following calculation manners, which is not limited to the following calculation manners:
etu=t0,pdt=(t0-t2)/5;
etu=t0+t2,pdt=(t0+t2)/10;
etu=t0+t2/2,pdt=(t0-t2)/5;
etu=t2,pdt=(t0-t2)/15;
........
as another alternative to this embodiment, the time processing module selects t0 as the first time interval group, and determines the time parameter of the current data transmission according to the first time interval group, where the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0, and the values of etu and pdt may be obtained by any calculation method according to the value of t0, for example, etu and pdt may be obtained by any one of the following calculation methods, and of course, are not limited to the following calculation methods:
etu=t0,pdt=t0/5;
etu=2*t0,pdt=t0/10;
etu=t0/2,pdt=t0/5;
etu=t0/3,pdt=t0/15;
........
as another alternative to this embodiment, the time processing module selects t1 and t3 as a second time interval group, and determines a time parameter of the current data transmission according to the second time interval group, where the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t1 and t3, and values of etu and pdt may be obtained by any calculation method according to values of t1 and t3, and for example, etu and pdt may be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=(t1-t3)/5;
etu=t1+t3,pdt=(t1+t3)/10;
etu=t1+t3/2,pdt=(t1-t3)/5;
etu=t3,pdt=(t1-t3)/15;
........
as another optional implementation manner of this embodiment, the time processing module selects t1 as the second time interval group, and determines the time parameter of the current data transmission according to the second time interval group, where the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1, and the values of etu and pdt may be obtained by any calculation manner according to the value of t1, and exemplarily, etu and pdt may be obtained by any one of the following calculation manners, but are not limited to the following calculation manners:
etu=t1,pdt=t1/5;
etu=2*t1,pdt=t1/10;
etu=t1/2,pdt=t1/5;
etu=t1/3,pdt=t1/15;
........
when K is 3, 2 time intervals are generated between two adjacent signals in the 3 signals, when i is 2, the first time interval is the time interval between the starting time of the first signal and the starting time of the second signal and is marked as t0, and the second time interval is the time interval between the starting time of the second signal and the starting time of the third signal and is marked as t 1; taking this as an example, the following describes in detail a manner of determining a time parameter of a current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group,
as another alternative to this embodiment, t0 is selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group, the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0, the values of etu and pdt can be obtained by any calculation method according to the value of t0, and for example, etu and pdt can be obtained by any one of the following calculation methods, and of course, the following calculation methods are not limited:
etu=t0,pdt=t0/5;
etu=2*t0,pdt=t0/10;
etu=t0/2,pdt=t0/5;
etu=t0/3,pdt=t0/15;
........
as another alternative to this embodiment, t1 is selected as the second time interval group, the time parameter of the current data transmission is determined according to the second time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1, the values of etu and pdt can be obtained by any calculation method according to the value of t1, and for example, etu and pdt can be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=t1/5;
etu=2*t1,pdt=t1/10;
etu=t1/2,pdt=t1/5;
etu=t1/3,pdt=t1/15;
........
similarly, when K is 7, 6 time intervals are generated between two adjacent 7 signals, when i is 2, the first time interval is the time interval between the start time of the first signal and the start time of the second signal, and is marked as t0, and the second time interval is the time interval between the start time of the second signal and the start time of the third signal, and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start of the fourth signal, denoted t2, and the second time interval is the time interval between the fourth signal and the start of the fifth signal, denoted t 3; when i is 6, the first time interval is the time interval between the fifth signal and the start time of the sixth signal, denoted as t5, and the second time interval is the time interval between the sixth signal and the start time of the seventh signal, denoted as t 6; at this time, the time processing module may select t0, t2 and t5 as the first time interval group, may also select t1, t3 and t6 as the second time interval group, the time processing module determines the time parameter of the current data transmission according to at least two first time intervals in the first time interval group, determines the time parameter of the current data transmission according to at least two second time intervals in the second time interval group, may also determine the time parameter of the current data transmission according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group, and the first time interval and the second time interval are not adjacent, the obtaining manner of the time parameters etu and pdt is not unique, the time processing module may optionally obtain the time parameters through the first time interval group and/or the second time interval group by using different calculation manners, for a specific obtaining manner, reference may be made to the scheme when K is 5, which is not described herein again;
when K is 3, 2 time intervals are generated between two adjacent signals in the 3 signals, when i is 2, the first time interval is the time interval between the starting time of the first signal and the starting time of the second signal and is marked as t0, and the second time interval is the time interval between the starting time of the second signal and the starting time of the third signal and is marked as t 1; taking this as an example, the following describes in detail a manner of determining a time parameter of a current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group,
as another alternative to this embodiment, t0 is selected as the first time interval group, the time parameter of the current data transmission is determined according to the first time interval group, the time parameter includes a first time parameter etu and a second time parameter pdt, etu and pdt are uniquely represented by t0, the values of etu and pdt can be obtained by any calculation method according to the value of t0, and for example, etu and pdt can be obtained by any one of the following calculation methods, and of course, the following calculation methods are not limited:
etu=t0,pdt=t0/5;
etu=2*t0,pdt=t0/10;
etu=t0/2,pdt=t0/5;
etu=t0/3,pdt=t0/15;
...
as another alternative to this embodiment, t1 is selected as the second time interval group, the time parameter of the current data transmission is determined according to the second time interval group, the time parameter includes the first time parameter etu and the second time parameter pdt, etu and pdt are uniquely represented by t1, the values of etu and pdt can be obtained by any calculation method according to the value of t1, and for example, etu and pdt can be obtained by any one of the following calculation methods, which is not limited to the following calculation methods:
etu=t1,pdt=t1/5;
etu=2*t1,pdt=t1/10;
etu=t1/2,pdt=t1/5;
etu=t1/3,pdt=t1/15;
........
the above-mentioned specific implementation of determining the time parameter of the current data transmission in this embodiment is only an exemplary implementation, and the present invention does not exclude other implementations in which the time parameter generation rule is generated to determine the time parameter of the current data transmission according to at least two first time intervals in the first time interval group, or according to at least two second time intervals in the second time interval group, or according to at least one first time interval in the first time interval group and at least one second time interval in the second time interval group.
In this embodiment, the time processing module determines the time parameters etu and pdt through the first time interval group and/or the second time interval group, thereby ensuring that the values of the sending end and the receiving end for etu and pdt are consistent during each data transmission, ensuring the stability and accuracy of each data transmission, and effectively preventing the problems of receiving error and reduced communication efficiency caused by sampling dislocation of the receiving end when the difference between the sending clock and the receiving time parameter is too large, because the receiving end re-determines the values of the time parameters etu and pdt according to the handshake information sent by the sending end before each data transmission, thereby avoiding the error accumulation caused by the continuous addition of a plurality of characters due to frequency difference.
As an optional implementation manner of this embodiment, if the first time interval and the second time interval satisfy the preset relationship and do not satisfy the preset relationship, the receiving module is instructed to continue receiving the handshake signal.
The data processing module is used for receiving data according to the time parameters;
as an optional implementation manner of this embodiment, the receiving module is further configured to receive X signals, determine a time interval between start times of every two adjacent signals in the X signals, and obtain X-1 time intervals, where X is a positive integer and X > 1; the data processing module is further configured to receive the X signals according to the time parameter, and specifically, the data processing module is configured to obtain N data bits corresponding to a single time interval in every consecutive S time intervals in X-1 time intervals, to obtain data bits transmitted at S time intervals, where the obtained data bits transmitted at S time intervals are the obtained N data bits, where S time intervals are the same when S > 1, where X and S are both positive integers, and S is not greater than X-1.
As an optional implementation manner of this embodiment, when the data obtaining receiving end may determine the data bit according to the time parameter of the current data transmission by using a calculation method determined by negotiating with the data sending end in advance, for example, when N is equal to N, the calculation method of the time interval for sending the data bit m is m equal to etu + m equal to pdt (where m is greater than or equal to 0 and less than or equal to 2)n-1, etu is the first time parameter, pdt is the second time parameter, etu is 10 μ s, pdt μ s) i.e. the time interval calculation method for data bits 11 is 10 μ s +3 μ s30 μ s 100 μ s. If the data receiving apparatus receives a time interval of 100 μ s, it can calculate that m is 3, i.e. the data bit corresponding to the time interval is 11.
As an optional implementation manner of this embodiment, the data processing module receives data according to the first time parameter etu and the second time parameter pdt and according to an encoding and decoding rule agreed in advance with the data sending end; the data processing module receiving data according to the time parameter comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1;
the data processing module obtains the 2 bits included in the N bits of data according to the first time parameter etu and the second time parameter pdt and according to the coding and decoding rule agreed in advance with the data sending endNThe predetermined coding and decoding rules can be those that can ensure different valuesAny manner in which N data bits correspond to a unique time interval, illustratively:
when N is 1, N data bits of different values include: 0.1, at this time,
0 ═ etu, 1 ≠ etu + pdt, and etu ≠ etu + pdt, or,
0 ═ 2etu, 1 ≠ etu +2pdt, and 2etu ≠ etu +2pdt,
……
when N is 2, N data bits of different values include: 00. 01,10,11, and at this time,
00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, 11 ≠ etu +3pdt, and etu ≠ etu + pdt ≠ etu +2pdt ≠ etu +3pdt, or,
00=2etu,01=etu+2pdt,10=etu+2.5pdt,11=1.3etu+3pdt,
and 2etu is not equal to etu +2pdt is not equal to etu +2.5pdt is not equal to 1.3etu +3pdt,
……
likewise, when N is 3, N data bits of different values include: 000. 001, 010, 011, 100, 101, 110, 111, at this time, according to the first time parameter etu and the second time parameter pdt, obtaining 2 bits included in the N-bit data according to the encoding and decoding rule agreed in advance with the data sending endNFor the time intervals corresponding to different values, the predetermined encoding and decoding rules may refer to the above examples, and are not described herein again.
The data processing module obtains 2 bits of data contained in the N bits of data according to the first time parameter etu and the second time parameter pdt in a mode predetermined with the data sending endNAnd time intervals corresponding to different values are different, so that different data bits corresponding to different received time intervals are distinguished, and the data sent by the sending end is obtained through the received time intervals.
In an optional implementation manner of this embodiment, the time processing module is further configured to obtain time intervals corresponding to N bits of different values according to the time parameter before the data processing module obtains the transmitted data, where the time intervals corresponding to the N bits of different values are different, and N is greater than or equal to 1;
alternatively, the data receiving end may calculate the time interval of the data bit by using a calculation method determined by negotiating with the data transmitting end in advance, for example, when N is equal to N, the calculation method of the time interval of transmitting the data bit m is m ═ etu + m × pdt (where m is greater than or equal to 0 and less than or equal to 2 and less than or equal to 0 and less than or equal to 2)n-1, etu is the first time parameter, pdt is the second time parameter, etu is 10 μ s, pdt is 30 μ s), that is, the time interval calculation method of the data bits 11 is 10 μ s +3 is 30 μ s is 100 μ s, or other pre-negotiated calculation methods may be adopted to determine the time interval, which is not limited in this embodiment. The time interval of the data bit is calculated by a pre-negotiated calculation method, so that the expandability of data transmission can be ensured, namely, the time interval of the data bit can be calculated by a data sending end and a data receiving end no matter what the value of N is.
As another alternative to the embodiments of the present invention. The data receiving end can also adopt a list pre-stored with the data sending end to determine the time interval of the data bit, and the data processing module can adopt a mode of searching the list to determine the time interval of the data bit, so that the efficiency of obtaining the time interval of the data bit can be improved.
In an optional implementation manner of this embodiment, X-1 ═ n × S, n ≧ 1 and n are integers, and with this optional implementation manner, X signals can just transmit n × S data bits, and the problem of being unable to decode due to redundant signals does not occur.
In an optional implementation manner of this embodiment, as shown in fig. 9, the data processing apparatus further includes a time parameter updating module, which is configured to replace the time parameter, that is, replace the currently used time parameter with a new time parameter according to a preset rule, and use the new time parameter as the time parameter of the current data transmission; the data processing module is further configured to decode the received X signals according to the time intervals corresponding to the N bits of the different obtained values, that is, according to the currently used time parameter, obtain N bits corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals, to obtain data bits transmitted in S time intervals, where the obtained data bits transmitted in S time intervals are the obtained N bits. In this embodiment, the determination of the new time parameter may be completed through negotiation between the data sending end and the data receiving end, or may be completed through searching a pre-stored time parameter table by the data sending end and the data receiving end, for example, when sending a certain type of data, the table is looked up to determine the time parameter that the type of data should use. The time parameter of the data sending end can be changed, and can be matched with data receiving devices with different data processing capabilities or different types of data, so that the data processing efficiency can be further improved.
In an optional implementation manner of this embodiment, the receiving module is further configured to receive a number of end signals (Z ≧ 1 and is an integer) after the last data bit is received, where the end signals may be the same as the handshake signals or signals in other specific formats, and the data processing module may determine whether the data bit is received completely through the end signals.
In an optional implementation manner of this embodiment, the receiving module is further configured to receive a check data bit after the receiving of the last data bit is completed or after the receiving of the a end signals is completed, and determine whether the received data is complete and correct through the check data bit. The check data bits include check data calculated by check methods such as MAC check, parity check, and checksum check.
In an optional implementation manner of this embodiment, as shown in fig. 9, the data processing device further includes a filtering module, configured to receive Z signals, remove interference in the Z signals, obtain X signals, and send the X signals to the receiving module, where Z ≧ X.
According to the technical scheme provided by the embodiment of the invention, the data processing module can determine the data bit of the received waveform according to the time interval of the received waveform, can receive data only by using two lines, and can effectively reduce the volume of the electronic equipment when being applied to the electronic equipment.
Furthermore, as an optional implementation manner of this embodiment, as shown in fig. 9, the data processing apparatus in this embodiment further includes: the data processing module is used for receiving data according to the time parameters and then sending the data to the data sending module; specifically, please refer to fig. 11 in embodiment 7 for a detailed description of the data sending module, regarding a specific structure of the data sending module and an implementation manner of the data sending module sending data according to the time parameter.
The data processing module provided by this embodiment re-determines the time parameter according to the handshake information before receiving data each time, so as to ensure that the time parameters of the sending end and the receiving end are always consistent, and ensure the stability and accuracy of data transmission; the signal is transmitted by adopting a pulse signal, so that the signal is conveniently distinguished from a noise signal; the method comprises the steps of detecting a rising edge or a falling edge triggered by each signal, easily obtaining the starting time of each signal, accurately and quickly obtaining a time interval between the starting times of two adjacent signals, judging whether the time interval between the signals meets a preset relation or not according to the obtained time interval, judging whether the received signals are effective handshake signals or not, enabling the judging process to be accurate and quick, enabling the success rate to be high, determining a first time interval group and/or a second time interval group according to the first time interval and/or the second time interval group, and determining time parameters etu and pdt according to the first time interval group and/or the second time interval group, so that the values of a sending end and a receiving end are kept consistent during each data transmission, the stability and the accuracy of each data transmission are guaranteed, and the receiving end can re-determine the time parameters etu and pdt according to handshake information sent by the sending end before each data transmission The value of (2) avoids error accumulation caused by continuous addition and reception of a plurality of characters due to frequency difference, and effectively prevents the technical problems of receiving error and reduced communication efficiency caused by sampling dislocation of a receiving end when the parameter difference between a sending clock and receiving time is too large.
Example 6
The present embodiment provides a data processing apparatus, as shown in fig. 10, including: the second time parameter module, the second time processing module and the second signal generating and sending module;
the second time parameter module is used for determining a time parameter;
as an optional implementation manner in this embodiment, the time parameter may include a first time parameter and/or a second time parameter, for convenience of illustration, in this embodiment, the first time parameter is denoted as etu, the second time parameter is denoted as pdt, and both the first time parameter etu and the second time parameter pdt represent a period of time, for example, etu is 0.1 second, pdt is 0.01 second, the value is determined by negotiation between the data transmitting end and the receiving end, the time interval for transmitting the handshake signals can be determined by using the time parameter, and the receiving end can be determined according to the received handshake signals, of course, there may be only one time parameter or multiple time parameters, which is for convenience of description in this embodiment, only 2 time parameters are taken as an example, and the first time interval group and the second time interval group are determined by using the 2 time parameters, but the case of multiple time parameters is not excluded.
The second time processing module is configured to determine a first time interval group and a second time interval group according to the time parameter, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals;
as an optional implementation manner in this embodiment, the first time interval refers to a time between a start time of an ith signal and a start time of an (i-1) th signal when the second signal generation and transmission module transmits K handshake signalsThe time interval between, denoted Ti-1,iThe second time interval is the time interval between the starting time of the ith signal and the starting time of the (i + 1) th signal when the K handshake signals are transmitted, and is denoted as Ti,i+1Wherein i is 2,4, … …,2j, j is (K-1)/2, K is not less than 3 and K is odd number.
In this embodiment, it should be noted that, first, the first time interval T in the first time interval groupi-1,iWith a second time interval T of a second group of time intervalsi,i+1Satisfy certain predetermined relation, can guarantee the validity of the signal of shaking hands through this predetermined relation to make the receiving end after receiving this signal of shaking hands, can be according to first time interval Ti-1,iAnd a second time interval Ti,i+1Judging that the handshake signal is a signal for indicating the start of receiving data; secondly, each first time interval T in the first time interval groupi-1,iA certain preset relationship is satisfied with the first time parameter etu and/or the second time parameter pdt, so that after receiving the handshake signal, the receiving end may calculate the first time parameter etu and/or the second time parameter pdt according to the same preset relationship through a plurality of received first time intervals, so that the receiving end may calculate bit data corresponding to the transmitted time intervals according to the first time parameter etu and/or the second time parameter pdt.
In the present embodiment, the first time interval T in the first time interval groupi-1,iWith a second time interval T of a second group of time intervalsi,i+1The predetermined relationship may include a plurality of types, and each of the first time intervals T in the first time interval groupi-1,iSatisfying certain predetermined relationships with the first time parameter etu and/or the second time parameter pdt also includes a variety, as explained in detail below in an exemplary manner.
As an alternative to this embodiment, taking K equal to 5 as an example, a total of 4 time intervals are generated between every two adjacent 5 signals, and when i equal to 2, the first time interval T is the first time interval T1,2Is the first signal and the second signalThe time interval between the start moments, denoted T0, a second time interval T2,3The time interval between the start of the second signal and the third signal, labeled t 1; when i is 4, the first time interval T3,4Is the time interval between the start of the third signal and the start of the fourth signal, denoted T2, and the second time interval T4,5The time interval between the start of the fourth signal and the 5 th signal is marked t 3. At this time, t0 and t2 are first time interval groups, t1 and t3 are second time interval groups, and the first time interval and the second time interval satisfy a preset relationship, that is, the preset relationship is satisfied between t0 and t1, and between t2 and t3, and the preset relationship may be determined according to experience of a technician, or according to parameters during actual operation. As an alternative, the preset relationship may be t1 ═ a × t0 and t3 ═ a × t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers ≧ 1, for example, a ═ 2, and this predetermined relationship may be various and will not be described herein again.
In the following, taking the first time intervals T0 and T2 of the first time interval group as an example, for each first time interval T in the first time interval groupi-1,it0, t2 and the first time parameter etu and/or the second time parameter pdt satisfy a certain preset relationship, which is explained in detail as follows:
the first time intervals t0 and t2 are generated according to a preset time parameter generation rule according to one of the first time parameter etu or the second time parameter pdt, where etu is taken as an example, t0 and t2 may be obtained by any one of the following calculation methods, and of course, the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu;
t2=x*a*etu;
wherein a is a natural number greater than or equal to 1, and x is a rational number, so that the receiving end can calculate etu by using t0 and t2 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0 and t2 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and the t0 and t2 may be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=x*a*etu+b*pdt;
wherein, a and b are natural numbers equal to or greater than 1, and x is a rational number, therefore, the receiving end can calculate etu and pdt by using t0 and t2 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0 and t2 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and the t0 and t2 may be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=a*etu+x*b*pdt;
wherein, a and b are natural numbers equal to or greater than 1, and x is a rational number, therefore, the receiving end can calculate etu and pdt by using t0 and t2 according to the same preset time parameter generation rule.
Similarly, when K is 7, 6 time intervals are generated between two adjacent 7 signals, and when i is 2, the first time interval T is generated1,2Is the time interval between the start of the first signal and the start of the second signal, denoted T0, the second time interval T2,3The time interval between the start of the second signal and the third signal, labeled t 1; when i is 4, the first time interval T3,4Is the time interval between the start of the third signal and the start of the fourth signal, denoted T2, and the second time interval T4,5The time interval between the start of the fourth signal and the fifth signal, labeled t 3; when i is 6, the first time interval T5,6Is the time interval between the start of the fifth signal and the sixth signal, denoted T4, and the second time interval T6,7The time interval between the start of the sixth signal and the seventh signal, labeled t 5; at this time, t0, t2 and t4 are first time interval groups, t1, t3 and t5 are second time interval groups, t1, t3 and t5 of the second time interval groups and t0, t2 and t4 of the first time interval groups respectively satisfy preset relations, that is, preset relations are satisfied between t0 and t0, and between t0 and t0, the values of the first time intervals t0, t0 and t0 of the first time interval groups are determined by a preset time parameter generation rule according to the first time parameter etu and/or the second time parameter 0, the preset time parameter generation rule may be adopted, for example, the first time intervals t0, t0 and t0, the value may be generated by the preset time parameter generation rule according to one of the first time parameter etu or the second time parameter 0, and any one of the following ways may be obtained by the preset time parameter generation rule, the preset time parameter generation rule is not limited to the following calculation manner:
t0=a*etu;
t2=x*a*etu;
t4=2x*a*etu;
wherein a is a natural number greater than or equal to 1, and x is a rational number, so that the receiving end can calculate etu by using t0, t2 and t4 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0, t2 and t4 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and t0, t2 and t4 can be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=x*a*etu+b*pdt;
t4=2x*a*etu+b*pdt;
wherein a and b are natural numbers equal to or greater than 1, and x is a rational number, so that the receiving end can calculate etu and pdt by using t0, t2 and t4 according to the same preset time parameter generation rule.
Alternatively, the first time intervals t0, t2 and t4 are generated according to the first time parameter etu and the second time parameter pdt by using a preset time parameter generation rule, and t0, t2 and t4 can be obtained by using any one of the following calculation methods, although the preset time parameter generation rule is not limited to the following calculation method:
t0=a*etu+b*pdt;
t2=a*etu+x*b*pdt;
t4=a*etu+2x*b*pdt;
wherein a and b are natural numbers equal to or greater than 1, and x is a rational number, so that the receiving end can calculate etu and pdt by using t0, t2 and t4 according to the same preset time parameter generation rule.
The above-described specific implementation of determining the first time interval group and the second time interval group of the current data transmission in this embodiment is only an exemplary implementation, and the present invention does not exclude an implementation of other time parameter generation rules to determine the first time intervals of the first time interval group according to the first time parameter etu and/or the second time parameter pdt, nor exclude a preset relationship of other first time intervals and second time intervals.
In this embodiment, the first time interval group is determined by the time parameter etu and/or pdt, so that it is ensured that the values of the sending end and the receiving end to etu and pdt are consistent during each data transmission, and the stability and accuracy of each data transmission are ensured.
The second signal generating and sending module is used for generating and sending K handshake signals,
as an optional implementation manner of this embodiment, in a specific implementation, generating and sending K handshake signals includes: generating and sending K handshake signals according to the first time interval group and the second time interval group; the first time interval and the second time interval in the K handshake signals satisfy the preset relationship, which may refer to the description of the preset relationship that the first time interval and the second time interval need to satisfy in embodiment 1.
In this embodiment, K is a preset value, K is greater than or equal to 3, and K is an odd number, and the signal may be a pulse signal, that is, a high-level pulse signal (rising edge signal) or a low-level pulse signal (falling edge signal) is received, and the pulse signal may be a square wave, a sine wave, a triangular wave, or other irregular waveform, or a combination of the above different waveforms.
In this embodiment, the second signal generating and transmitting module generates and transmits K signals, including at least one of the following modes:
the first method is as follows: the second signal generating and sending module generates and sends K times of low level pulses;
in this manner, the second signal generating and transmitting module triggers the low level pulse K times in consecutive high levels, for example, the second signal generating and transmitting module triggers the low level pulse 1 time after continuously triggering the high level for a first time interval, and then resumes the state of triggering the high level, and triggers the low level pulse 1 time again after a second time interval elapses, in such a manner that the low level pulse K times can be consecutively generated, the first time interval can be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval can be a time interval between a start time of the ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j is (K-1)/2, K is ≧ 3 and K is an odd number.
Illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, which is labeled t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, which is labeled t3, the second signal generation and transmission module triggers 5 times of low level pulses in consecutive high levels, including: the second signal generating and transmitting module triggers the 1 st low-level pulse after continuously triggering the high level for a period of time, then restores to trigger the high level, triggers the 2 nd low-level pulse after t0, then restores to trigger the high level, triggers the 3 rd low-level pulse after t1, then restores to trigger the high level, triggers the 4 th low-level pulse after t2, then restores to trigger the high level, and triggers the 5 th low-level pulse after t3, in such a way that the 5 th low-level pulses can be continuously generated, and the first time interval and the second time interval satisfy a preset relationship, for example, t1 ═ a ═ t0 and t3 ═ a ═ t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers greater than or equal to 1, for example, a ═ 2, and the predetermined relationship may be various, which is not described herein again and forms an effective handshake signal;
the second method comprises the following steps: the second signal generating and sending module generates and sends K times of high level pulses;
in this manner, the second signal generating and transmitting module triggers the high level pulse K times in the continuous low level, for example, the second signal generating and transmitting module triggers the high level pulse 1 times after continuously triggering the low level for a first time interval, and then resumes the state of triggering the low level, and triggers the high level pulse 1 times after a second time interval elapses, in such a manner that the high level pulse K times can be continuously generated, the first time interval can be a time interval between a start time of an ith signal and a start time of an i-1 th signal, and the second time interval can be a time interval between a start time of the ith signal and a start time of an i +1 th signal, where i is 2,4, … …,2j, j is (K-1)/2, K is ≧ 3 and K is an odd number.
Illustratively, when K is 5, 4 time intervals are generated between every two adjacent 5 signals, when i is 2, the first time interval is the time interval between the first signal and the start time of the second signal and is marked as t0, and the second time interval is the time interval between the second signal and the start time of the third signal and is marked as t 1; when i is 4, the first time interval is the time interval between the third signal and the start time of the fourth signal, which is labeled t2, and the second time interval is the time interval between the fourth signal and the start time of the 5 th signal, which is labeled t3, the second signal generation and transmission module triggers 5 high level pulses in consecutive low levels, including: the second signal generating and transmitting module triggers the 1 st high level pulse after continuously triggering the low level for a period of time, then resumes triggering the low level state, triggers the 2 nd high level pulse after t0, then resumes triggering the low level state, triggers the 3 rd high level pulse after t1, then resumes triggering the low level state, triggers the 4 th high level pulse after t2, then resumes triggering the low level state, and triggers the 5 th high level pulse after t3, in such a way that the 5 th high level pulse can be continuously generated, and the first time interval and the second time interval satisfy a preset relationship, for example, t1 ═ a ═ t0 and t3 ═ a ═ t 2; alternatively, t1 ═ a + b) × t0 and t3 ═ a + b) × t 2; alternatively, t1 ═ c × a + b) × t0 and t3 ═ c × a + b) × t2, where a, b, and c are natural numbers greater than or equal to 1, for example, a ═ 2, and the predetermined relationship may be various, which is not described herein again and forms an effective handshake signal;
in the above manner, the K signals belong to the hopping signal, and the hopping amplitude is significant, so that the K signals are conveniently distinguished from the noise signal.
Furthermore, as an optional implementation manner of this embodiment, the data processing apparatus in this embodiment further includes: the data sending module is used for sending data according to the time parameters after the second signal generating and sending module generates and sends the K handshaking signals; specifically, please refer to the detailed description of the data sending module in embodiment 7 for the specific structure of the data sending module and the implementation manner of the data sending module sending data according to the time parameter.
The time parameters of the sending end and the receiving end are ensured to be consistent all the time by re-determining the time parameters according to the handshake information before receiving data every time, and the stability and the accuracy of data transmission are ensured; the signal is transmitted by adopting a pulse signal, so that the signal is conveniently distinguished from a noise signal; the method comprises the steps of detecting a rising edge or a falling edge triggered by each signal, easily obtaining the starting time of each signal, accurately and quickly obtaining a time interval between the starting times of two adjacent signals, judging whether the time interval between the signals meets a preset relation or not according to the obtained time interval, judging whether the received signals are effective handshake signals or not, enabling the judging process to be accurate and quick, enabling the success rate to be high, determining a first time interval group and/or a second time interval group according to the first time interval and/or the second time interval group, and determining time parameters etu and pdt according to the first time interval group and/or the second time interval group, so that the values of a sending end and a receiving end are kept consistent during each data transmission, the stability and the accuracy of each data transmission are guaranteed, and the receiving end can re-determine the time parameters etu and pdt according to handshake information sent by the sending end before each data transmission The value of (2) avoids error accumulation caused by continuous addition and reception of a plurality of characters due to frequency difference, and effectively prevents the technical problems of receiving error and reduced communication efficiency caused by sampling dislocation of a receiving end when the parameter difference between a sending clock and receiving time is too large.
Example 7
The present embodiment provides the data sending module related to embodiments 5 and 6, and fig. 11 is a schematic structural diagram of an optional data sending module of the present embodiment, which specifically includes: time interval acquisition unit, data bit string acquisition unit, sending unit, wherein:
a time interval acquisition unit for acquiring 2 contained in the N-bit data according to the time parameterNAnd (3) corresponding relations between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1.
In an alternative implementation of this embodiment, the N-bit data comprises 2NThe different values are understood to be: for example, when N is 1,1 bit data, which contains 21Different values, 0,1 respectively; when N is 2, 2 bits of data, which contains 2 bits2The values are 00,01,10 and 11. Obtaining 2 contained in N-bit data according to time parameterNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 1, a time interval corresponding to 0 is obtained according to the time parameter, and a time interval corresponding to 1 is obtained according to the time parameter; when N is 2, acquiring a time interval corresponding to 00 according to the time parameter, acquiring a time interval corresponding to 01 according to the time parameter, acquiring a time interval corresponding to 10 according to the time parameter, and acquiring a time interval corresponding to 11 according to the time parameter. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again.
In an optional implementation manner of this embodiment, the time interval obtaining unit of the data sending module may calculate the time interval corresponding to the value by using a calculation method determined by negotiating with the data receiving end in advance, for example, when N is equal to N, the calculation method of the time interval corresponding to the sending value m may be: the time interval corresponding to the value m is etu + m pdt (where m is 0. ltoreq. m.ltoreq.2)n-1, etu is the first time parameter, pdt is the second time parameter, for example etu-10 μ s, pdt-30 μ s), i.e. the time interval calculation method corresponding to the value 11 may be 10 μ s + 3-30 μ s-100 μ s, and the time interval corresponding to the value may be calculated by this alternative embodiment. When in useHowever, the present invention may also adopt other pre-negotiated calculation methods to determine the time interval, which is not limited in this respect. The time interval corresponding to the value is calculated by a pre-negotiated calculation method, so that the expandability of data transmission can be ensured, namely, the sending end and the receiving end can calculate the corresponding relation between different values and the time interval no matter what the value of N is.
In an optional implementation manner of this embodiment, the time interval obtaining unit obtains, according to the first time parameter etu and the second time parameter pdt, a corresponding relationship between 2N different values included in the N-bit data and a time interval according to a coding and decoding rule agreed in advance with the data sending end, where the agreed coding and decoding rule in advance may be any manner capable of ensuring that N data bits of different values correspond to a unique time interval, and exemplarily:
when N is 1, N data bits of different values include: 0.1, at this time,
0 ═ etu, 1 ≠ etu + pdt, and etu ≠ etu + pdt, or,
0 ═ 2etu, 1 ≠ etu +2pdt, and 2etu ≠ etu +2pdt,
……
when N is 2, N data bits of different values include: 00. 01,10,11, and at this time,
00 ═ etu, 01 ═ etu + pdt, 10 ═ etu +2pdt, 11 ≠ etu +3pdt, and etu ≠ etu + pdt ≠ etu +2pdt ≠ etu +3pdt, or,
00=2etu,01=etu+2pdt,10=etu+2.5pdt,11=1.3etu+3pdt,
and 2etu is not equal to etu +2pdt is not equal to etu +2.5pdt is not equal to 1.3etu +3pdt,
……
likewise, when N is 3, N data bits of different values include: 000. 001, 010, 011, 100, 101, 110, and 111, at this time, according to the first time parameter etu and the second time parameter pdt, the time interval obtaining unit obtains the time intervals corresponding to the 2N different values included in the N-bit data according to the coding and decoding rule agreed in advance with the data sending end, and the agreed coding and decoding rule in advance may refer to the above example and will not be described herein again.
As another optional implementation manner of the embodiment of the present invention, the time interval obtaining unit of the data sending module may also determine the time interval corresponding to the value by using a list negotiated and stored with the data receiving end in advance, and determine the time interval corresponding to the value by using a lookup list, so as to improve efficiency of obtaining the time interval corresponding to the value.
As another optional implementation manner of the embodiment of the present invention, after the time interval acquiring unit of the data sending module calculates the time interval corresponding to the value by using a calculation method determined by negotiating with the data receiving end in advance, the time interval acquiring unit of the data sending module searches a pre-stored list to determine whether the time interval corresponding to the calculated value belongs to the receiving range of the data receiving end. The time interval corresponding to the numerical value is obtained by further searching the list after the time interval corresponding to the numerical value is obtained through calculation, and the expansibility of data transmission can be improved on the premise that the data receiving end can normally receive the data.
And the data bit string acquisition unit is used for acquiring the current data bit string to be sent and grouping the data bit strings, wherein each group of data is N bits.
In an optional embodiment of the present invention, the data bit string obtaining unit may generate a current data bit string to be sent by itself, or may receive the current data bit string to be sent from other units of other devices or data processing devices.
As an optional embodiment of the present invention, the data processing apparatus may be used as a switching device, which can switch communications between another device (hereinafter referred to as a first terminal) and the data receiving device, and at this time, the data processing apparatus acquires the data bit string to be currently transmitted by: receiving first data through a first interface; and decoding the first data according to a protocol supported by the first interface to obtain a first data bit string to be sent. When the data processing device is used as a switching device, the data processing device may have two communication interfaces, for example, a first interface and a second interface, the first interface is an interface for communicating with the first terminal, the second interface is an interface for communicating with a receiving end of data, the first interface may be an existing general interface, and includes wireless and wired interfaces, for example, USB interfaces, audio interfaces, serial ports, bluetooth, wifi, NFC, and other interfaces, and may be connected to the first terminal through the first interface to receive the first data sent from the first terminal. The first terminal can be a mobile phone, a computer, a PAD and other devices, and the first data can be data to be transmitted by the mobile phone, the computer and the PAD. Meanwhile, the first interface may decode the received first data by using a protocol supported by the first interface according to a difference in interface types, for example, the first interface may decode the first data according to a USB protocol, an audio protocol, a serial protocol, a bluetooth protocol, a wifi protocol, an NFC protocol, or the like, to obtain a data bit string corresponding to the first data, where the data bit string is a first data bit string to be sent (that is, a current data bit string to be sent). The second interface may be an interface connected to the electronic payment device (i.e. the data receiving means) through which the data bits are transmitted to the electronic payment device. The second interface may be a two-wire interface; the electronic payment device can realize the USBKey function, the OTP function, the smart card function and the like. The data transmission of the invention is transferred to be used as a transfer device, and the data conversion is carried out through the first interface, so that the data transmitted by the terminal can be converted into the data suitable for being communicated with the data receiving device, the conversion among different interfaces is realized, and the application range of the data transmission module of the invention is expanded.
In this embodiment, alternatively, the data bit string obtaining unit may perform obtaining at any timingThe operation of fetching the data bit string and the packet may be performed before the transmitting unit transmits the data. In addition, the transmitting end of the data may include 2 included in the N-bit data acquired by the time interval acquiring unit before each data transmissionNThe corresponding relation between different values and time intervals is operated, or the sending end of the data can be operated by the time interval obtaining unit first, and then 2 included in the N-bit data obtained by the time interval obtaining unit in operation is used for sending the data each timeNThe corresponding relation between different values and time intervals is used for coding the data to be transmitted, or an effective period can be set, the data are transmitted in the effective period, and the data are all transmitted by using 2 contained in the N-bit data acquired by the operation of the time interval acquisition unitNThe correspondence of the different values to the time intervals to encode the data to be transmitted. Alternatively, 2 of the N-bit data may be calculated once every time an event trigger is received, for example, a user inputs a time parameter of the current data transmissionNThe correspondence of the various values to the time intervals. The present embodiment is not particularly limited.
As an optional embodiment of the present invention, the data bit string obtaining unit groups the data bit strings, where each group of data is N bits, and may be grouped in multiple ways, and may be grouped in a way that each group includes 1 bit, or may be grouped in a way that each group includes 2 bits, when the data bit string includes a single number, since it is impossible to completely group according to 2 bits, the data bit string may be grouped after being complemented by 0, at this time, a sending end of the data and a receiving end of the data set in advance or negotiate a way of complementing 0, when the data bit string is sent from a high order of the data, 0 is complemented at a last order of the bit string, and when the data bit string is sent from a low order of the data, 0 is complemented at a high order of the bit string. Of course, the cases where each group includes 3 bits or more may be grouped by referring to the manner where each group includes 2 bits, which is not described herein again.
And the sending unit is used for sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
In this embodiment, the value of each group of data bits may correspond to one time interval, or may correspond to a plurality of same time intervals. The numerical value of each group of data bits corresponds to a plurality of time intervals, the numerical value corresponding to the time interval can be accurately judged, and errors caused by time intervals lost in the data transmission process are prevented.
In an optional implementation manner of this embodiment, for each group of data bits, when sending the group of data bits, the sending unit is configured to generate and send M signals, where a time interval between a start time of each signal and a start time of an adjacent previous signal is a time interval corresponding to the group of data bits, M ≧ 1 and M is a natural number. The time interval generated by adopting the signal mode is easy to detect and high in stability.
Optionally, the sending unit is configured to generate M signals in a manner that M low-level pulses are generated at time intervals, or generate M signals in a manner that M high-level pulses are generated at time intervals. The low level pulse/high level pulse may be represented by a waveform such as a square wave, a sine wave, a triangular wave, etc., which can distinguish between high and low level pulses, and is not limited herein. Preferably, the low level pulse is generated according to the time interval, and when the data sending end communicates with the data receiving end, the data sending end can use the high level to supply power to the data receiving end, and information is transmitted in a low level pulse mode. The equipment adopting the method can complete power supply and information transmission simultaneously by using the same wire when information interaction is carried out, thereby reducing the volume of the equipment and the manufacturing cost.
Optionally, the time parameter may also be transmitted through the time interval between the K handshake signals, so that the data receiving end may obtain the time parameter used by the data processing device according to the K handshake signals, and further confirm the time parameter used by the data receiving end. Specifically, the data sending module may further include a handshake signal time interval determining unit, configured to determine a first time interval group and/or a second time interval group according to the time parameter, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals, where j ═ K-1)/2, K ≧ 3, and K is an odd number.
In an optional implementation manner of this embodiment, as shown in fig. 12, in the data sending module of this embodiment, in order to meet the current data transmission rate, a time parameter updating unit may further be included, configured to replace a currently used time parameter with a new time parameter according to a preset rule, and use the new time parameter as the time parameter of current data transmission; the trigger time interval acquisition unit updates the corresponding relation according to the new time parameter; the time interval acquisition unit is further used for updating the corresponding relation according to the time parameter of the current data transmission; and the sending unit is also used for carrying out data transmission by utilizing the updated corresponding relation. In this embodiment, the determination of the new time parameter may be completed through negotiation between the data sending end and the data receiving end, or may be completed through searching a pre-stored time parameter table by the data sending end and the data receiving end, for example, when sending a certain type of data, the table is looked up to determine the time parameter that the type of data should use. The time parameter of the data sending module can be changed, and can be matched with data receiving devices with different data processing capabilities or different types of data, so that the data processing efficiency can be further improved.
In an optional implementation manner of this embodiment, as shown in fig. 12, the data sending module may further include a check data sending unit, where after the sending unit finishes sending the last group of data, the check data sending unit sends check data, and through the check data, the data receiving end may determine whether the received data is complete and correct. The check data includes, but is not limited to, check data calculated by MAC check, parity check, checksum check, and the like.
In an optional implementation manner of this embodiment, as shown in fig. 12, the data sending module may further include an end signal sending unit, where the end signal sending unit is configured to send a (a ≧ 1 and is an integer) end signals after the sending unit completes sending the last group of data or after the check data bit sending unit sends the check data, where the end signals may be the same as or different from the handshake signals, and the data receiving apparatus may determine whether the data reception is ended by the end signals.
According to the technical scheme provided by the embodiment of the invention, the data processing equipment can represent the data bits of the sending waveform according to the time interval of the sending waveform, can finish sending data by using two lines only, and can effectively reduce the volume of the electronic equipment when being applied to the electronic equipment.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (26)
1. A method of data transmission, comprising:
receiving K signals, detecting a time interval between every two adjacent signals in the K signals, and judging whether a first time interval and a second time interval meet a preset relationship, wherein the first time interval is a time interval between the starting time of the ith signal and the starting time of the (i-1) th signal, the second time interval is a time interval between the starting time of the ith signal and the starting time of the (i + 1) th signal, i is 2,4, … …,2j, j is (K-1)/2, K is more than or equal to 3, and K is an odd number;
determining a first time interval group and/or a second time interval group, wherein the first time interval group comprises j first time intervals, and the second time interval group comprises j second time intervals;
if the first time interval and the second time interval meet a preset relationship, determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group;
receiving data according to the time parameter, wherein receiving data according to the time parameter comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; receiving X signals, and determining the time interval between the starting moments of every two adjacent signals in the X signals to obtain X-1 time intervals, wherein X is a positive integer and is greater than 1; according to the determined time parameter, obtaining a numerical value corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals to obtain a numerical value transmitted by the S time intervals, wherein the numerical value transmitted by the S time intervals is the numerical value corresponding to the single time interval, and the numerical value is 2 included in the N-bit dataNOne of the different values, wherein, in the case that S > 1, the S time intervals are the same, wherein S is a positive integer and S ≦ X-1.
2. The method of claim 1, wherein receiving the K signals comprises:
k low pulses are detected.
3. The method of claim 1, wherein X-1 is n S, n ≧ 1 and n is an integer.
4. The method of claim 1 or 3, wherein the receiving X signals comprises: x low pulses are detected.
5. The method of claim 1 or 3, wherein receiving X signals comprises: and receiving Y +1 signals, and removing interference in the Y +1 signals to obtain the X signals, wherein Y +1 is more than or equal to X.
6. The method of claim 1, further comprising, after said receiving data according to said time parameter: and transmitting data according to the time parameter.
7. The method of claim 6, wherein said transmitting data according to the time parameter comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
8. A method according to any of claims 1 to 3, characterized by:
and if the first time interval and the second time interval do not meet the preset relation, continuing to execute the step of receiving the K signals.
9. A method of data transmission, comprising:
determining a time parameter;
determining a first time interval group and a second time interval group according to the time parameter, wherein the first time interval group comprises j first time intervals, and the second time interval group comprises j second time intervals;
generating and transmitting K handshake signals, wherein the first time interval and the second time interval satisfy a preset relationship; the first time interval is a time interval between a start time of an ith handshake signal and a start time of an i-1 th handshake signal, the second time interval is a time interval between a start time of an ith handshake signal and a start time of an i +1 th handshake signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number;
wherein after the generating and transmitting K handshake signals, the method further comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
10. The method of claim 9, wherein generating the K handshake signals comprises:
and generating K times of low-level pulses according to the first time interval and the second time interval.
11. The method of claim 10, wherein for each set of data, transmitting the set of data comprises: and generating and transmitting M signals, wherein the time interval between the starting time of each signal and the starting time of the adjacent last signal is the time interval corresponding to the numerical value of the group of data, M is more than or equal to 1, and M is a natural number.
12. The method of claim 11, wherein generating the M signals comprises: and generating M times of low-level pulses according to the first time interval and the second time interval.
13. The method according to any one of claims 10 to 12, further comprising: replacing the currently used time parameter with a new time parameter according to a preset rule, and taking the new time parameter as the time parameter of the current data transmission; updating the corresponding relation according to the time parameter of the current data transmission; and carrying out data transmission by utilizing the updated corresponding relation.
14. A data processing apparatus, characterized by comprising: a receiving module, a judging module, a time processing module and a data processing module, wherein,
the receiving module is used for receiving K signals;
the judging module is configured to detect a time interval between every two adjacent signals in the K signals, and judge whether a first time interval and a second time interval satisfy a preset relationship, where the first time interval is a time interval between a start time of an ith signal and a start time of an i-1 th signal, the second time interval is a time interval between a start time of an ith signal and a start time of an i +1 th signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number;
the time processing module is configured to determine a first time interval group and/or a second time interval group, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals; if the first time interval and the second time interval meet a preset relationship, determining a time parameter of current data transmission according to at least one first time interval in the first time interval group and/or at least one second time interval in the second time interval group;
the receiving module is further configured to receive X signals;
the data processing module is configured to receive data according to the time parameter, and includes: acquiring 2 contained in N-bit data according to the time parameterNA different numerical value andthe corresponding relation of time intervals, wherein the time intervals corresponding to different numerical values are different, wherein N is more than or equal to 1; determining the time interval between the starting moments of every two adjacent signals in the X signals to obtain X-1 time intervals, wherein X is a positive integer and is greater than 1; according to the determined time parameter, obtaining a numerical value corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals to obtain a numerical value transmitted by the S time intervals, wherein the numerical value transmitted by the S time intervals is the numerical value corresponding to the single time interval, and the numerical value is 2 included in the N-bit dataNOne of the different values, wherein, in the case that S > 1, the S time intervals are the same, wherein S is a positive integer and S ≦ X-1.
15. The apparatus of claim 14,
the receiving module is configured to receive K signals, and includes:
and the receiving module is used for detecting K times of low-level pulses.
16. The apparatus of claim 14, wherein X-1 ═ n × S, n ≧ 1 and n is an integer.
17. The apparatus of claim 14 or 16, wherein the receiving module is further configured to receive X signals, and comprises: the receiving module is further configured to detect X times of low level pulses.
18. The apparatus of claim 14 or 16, wherein the data processing module is further configured to: and receiving Y +1 signals, and removing interference in the Y +1 signals to obtain the X signals, wherein Y +1 is more than or equal to X.
19. The apparatus of any of claims 14 to 16, further comprising: and the data sending module is used for sending data according to the time parameter after the data processing module receives the data according to the time parameter.
20. The apparatus of claim 19, wherein the data sending module is configured to send data according to the time parameter, and comprises: acquiring 2 contained in N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
21. The apparatus according to any one of claims 14 to 16,
the time processing module is also used for
And if the first time interval and the second time interval do not meet the preset relation, indicating the receiving module to continue to execute the operation of receiving the K signals.
22. A data processing apparatus, characterized by comprising: the second time parameter module, the second time processing module and the second signal generating and sending module; wherein,
the second time parameter module is used for determining a time parameter;
the second time processing module is configured to determine a first time interval group and a second time interval group according to the time parameter, where the first time interval group includes j first time intervals, and the second time interval group includes j second time intervals;
the second signal generating and sending module is configured to generate and send K handshake signals, where the first time interval and the second time interval satisfy a preset relationship; the first time interval is a time interval between a start time of an ith handshake signal and a start time of an i-1 th handshake signal, the second time interval is a time interval between a start time of an ith handshake signal and a start time of an i +1 th handshake signal, i is 2,4, … …,2j, j is (K-1)/2, K is greater than or equal to 3, and K is an odd number;
the second signal generating and sending module is further configured to, after generating and sending K handshake signals, obtain 2 bits included in the N-bit data according to the time parameterNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to the different values are different, and N is more than or equal to 1; acquiring a data bit string to be sent currently; grouping the data bit strings, wherein each group of data is N bits; and sending the group of data in a mode that the time interval corresponding to the numerical value of each group of data represents the group of data according to the acquired corresponding relation.
23. The apparatus of claim 22, wherein the second signal generating and sending module for the K handshake signals comprises:
and the second signal generating and sending module generates K times of low-level pulses according to the first time interval and the second time interval.
24. The apparatus of claim 22, wherein for each set of data, the second signal generating module is further configured to transmit the set of data, comprising: the second signal generating and sending module is further configured to generate and send M signals, where a time interval between a start time of each signal and a start time of an adjacent previous signal is a time interval corresponding to a numerical value of the group of data, M is greater than or equal to 1, and M is a natural number.
25. The apparatus of claim 24, wherein the second signal generating and transmitting module is further configured to generate M signals, comprising: and the second signal generating and sending module is further configured to generate M times of low level pulses according to the first time interval and the second time interval.
26. The apparatus according to any one of claims 22 to 25, wherein the second time parameter module is further configured to replace a currently used time parameter with a new time parameter according to a preset rule, and use the new time parameter as the time parameter of the current data transmission; the second signal generation and transmission module is further configured to update the corresponding relationship according to the time parameter of the current data transmission; and carrying out data transmission by utilizing the updated corresponding relation.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510604981.5A CN106549748B (en) | 2015-09-21 | 2015-09-21 | A kind of data transmission method and data processing equipment |
PCT/CN2016/099622 WO2017050234A1 (en) | 2015-09-21 | 2016-09-21 | Data transmission method and data processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510604981.5A CN106549748B (en) | 2015-09-21 | 2015-09-21 | A kind of data transmission method and data processing equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106549748A CN106549748A (en) | 2017-03-29 |
CN106549748B true CN106549748B (en) | 2019-08-27 |
Family
ID=58365302
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510604981.5A Active CN106549748B (en) | 2015-09-21 | 2015-09-21 | A kind of data transmission method and data processing equipment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106549748B (en) |
WO (1) | WO2017050234A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109960672B (en) * | 2017-12-22 | 2022-12-30 | 苏州迈瑞微电子有限公司 | Digital communication method based on GPIO interface |
CN111262718A (en) * | 2018-12-03 | 2020-06-09 | 厦门雅迅网络股份有限公司 | Data transmission method and system for avoiding influence on statistical accuracy due to data loss |
CN110597752B (en) * | 2019-09-02 | 2021-02-19 | 广州粒子微电子有限公司 | UART instruction data receiving system and receiving method thereof |
CN111404638B (en) * | 2019-12-16 | 2022-10-04 | 王振江 | Digital signal transmission method |
CN111124969B (en) * | 2019-12-26 | 2023-08-04 | 山西银河电子设备厂 | Improved serial port conversion module based on FPGA |
CN113390499B (en) * | 2021-05-21 | 2023-09-08 | 山东金钟科技集团股份有限公司 | Anti-cheating method for digital weighing sensor, equipment and storage medium |
CN113625992B (en) * | 2021-06-28 | 2023-07-14 | 山东云海国创云计算装备产业创新中心有限公司 | Task processing method and device based on divider, divider and storage medium |
CN113746912B (en) * | 2021-08-30 | 2023-12-01 | 浙江中控技术股份有限公司 | DCS monitoring system and method for acquiring DCS control data |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998038737A1 (en) * | 1997-02-27 | 1998-09-03 | Northrop Grumman Corporation | Pulse position modulation communications protocol |
CN1482761A (en) * | 2002-09-13 | 2004-03-17 | 华为技术有限公司 | Time synchronisation method in communication system |
EP1294116A3 (en) * | 2001-09-18 | 2005-07-13 | Nortel Networks Limited | Technique for synchronizing clocks in a network |
CN102183695A (en) * | 2010-01-18 | 2011-09-14 | 英飞凌科技股份有限公司 | Methods and receiver for measuring data pulses |
CN104219757A (en) * | 2014-05-13 | 2014-12-17 | 中兴通讯股份有限公司 | Synchronizing signal transmission time determination method, terminal, base station and communication system |
-
2015
- 2015-09-21 CN CN201510604981.5A patent/CN106549748B/en active Active
-
2016
- 2016-09-21 WO PCT/CN2016/099622 patent/WO2017050234A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998038737A1 (en) * | 1997-02-27 | 1998-09-03 | Northrop Grumman Corporation | Pulse position modulation communications protocol |
EP1294116A3 (en) * | 2001-09-18 | 2005-07-13 | Nortel Networks Limited | Technique for synchronizing clocks in a network |
CN1482761A (en) * | 2002-09-13 | 2004-03-17 | 华为技术有限公司 | Time synchronisation method in communication system |
CN102183695A (en) * | 2010-01-18 | 2011-09-14 | 英飞凌科技股份有限公司 | Methods and receiver for measuring data pulses |
CN104219757A (en) * | 2014-05-13 | 2014-12-17 | 中兴通讯股份有限公司 | Synchronizing signal transmission time determination method, terminal, base station and communication system |
Also Published As
Publication number | Publication date |
---|---|
CN106549748A (en) | 2017-03-29 |
WO2017050234A1 (en) | 2017-03-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106549748B (en) | A kind of data transmission method and data processing equipment | |
US11048366B2 (en) | Sensor controller, position indicator, and position detecting system | |
JP6586222B2 (en) | Wireless transmission method for simple receiver | |
US20220013003A1 (en) | Method carried out in system including active stylus and sensor controller, sensor controller, and active stylus | |
CN104639477A (en) | Backchannel communications for initialization of high-speed networks | |
CN106549729B (en) | Data sending method and device and data receiving method and device | |
US8402354B2 (en) | Signal processor and error correction process | |
GB2514817A (en) | Digital radio communication | |
CN105703875B (en) | Method, equipment and system for transmitting message | |
CN106549921B (en) | Data transmission method and device | |
CN105591716B (en) | A kind of serial data communication method, apparatus and system based on single carrier | |
WO2015120758A1 (en) | Data communication method, terminal and information security device | |
CN106027196B (en) | A kind of data transmission method and system | |
CN103840914B (en) | Data communication method, terminal and information security equipment | |
CN107368446B (en) | Transmission parameter adaptive data transmission method and device | |
US8416717B2 (en) | Signals communication apparatus | |
CN106547711B (en) | Data sending method and device and data receiving method and device | |
CN109347605A (en) | A kind of coding method, coding/decoding method and device, computer readable storage medium | |
CN106549890B (en) | Data receiving method and device | |
CN107493156B (en) | Transmission parameter acquisition method and terminal | |
CN106549727B (en) | Signal receiving method and device | |
CN106549728A (en) | A kind of data receiver method and device | |
CN107346998B (en) | Data frame tail detection method and data transmission device | |
CN107370565B (en) | Transmission parameter adaptive data transmission method and device | |
CN111147107B (en) | Data receiving method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |