CN106547711B - Data sending method and device and data receiving method and device - Google Patents

Data sending method and device and data receiving method and device Download PDF

Info

Publication number
CN106547711B
CN106547711B CN201510604984.9A CN201510604984A CN106547711B CN 106547711 B CN106547711 B CN 106547711B CN 201510604984 A CN201510604984 A CN 201510604984A CN 106547711 B CN106547711 B CN 106547711B
Authority
CN
China
Prior art keywords
time interval
time
data
signals
parameter
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
Application number
CN201510604984.9A
Other languages
Chinese (zh)
Other versions
CN106547711A (en
Inventor
李东声
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tendyron Corp
Original Assignee
Tendyron Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tendyron Corp filed Critical Tendyron Corp
Priority to CN201510604984.9A priority Critical patent/CN106547711B/en
Publication of CN106547711A publication Critical patent/CN106547711A/en
Application granted granted Critical
Publication of CN106547711B publication Critical patent/CN106547711B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data sending method and device and a data receiving method and device, wherein the data sending method comprises the following steps: obtaining 2 contained in N-bit dataNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; 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.

Description

Data sending method and device and data receiving method and device
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a data sending method and apparatus and a data receiving method and apparatus.
Background
At present, electronic products are developed rapidly, external interfaces are mixed, and common wired external interfaces include a USB interface, a DOCK interface and the like, but the number of the interfaces is at least three to complete communication and charging, so that the electronic products occupy larger volume of electronic equipment and need more hardware support. Therefore, in the field of technology, in order to reduce hardware cost and reduce the size of electronic equipment, a two-wire communication technical scheme is needed, in which data transmission can be completed by using only two wires.
Disclosure of Invention
The present invention is directed to solving one of the problems set forth above.
The present invention provides the following solutions, including:
the first scheme is as follows: a method for transmitting data, comprising: obtaining 2 contained in N-bit dataNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; 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 II: the method according to aspect one, wherein obtaining 2 comprised by the N-bit dataNThe correspondence of the different values to the time intervals includes: determining a time parameter of current data transmission; obtaining 2 contained in N-bit data according to time parameterNThe correspondence of the various values to the time intervals.
The third scheme is as follows: the method according to the first or second aspect, 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.
And the scheme is as follows: the method of scheme three, wherein generating the M signals comprises: the low level pulses are generated M times at intervals.
And a fifth scheme: the method of any of scheme one to scheme four, wherein prior to transmitting the first set of data, the method further comprises: k handshake signals are generated and sent, K is larger than or equal to 2 and is an integer.
Scheme six: the method according to scheme five, wherein the K handshake signals satisfy a preset relationship.
The scheme is seven: the method according to scheme six, wherein the K handshake signals contain a time parameter.
And the eighth scheme is as follows: the method according to the sixth or seventh aspect, wherein the satisfying the preset relationship among the K handshake signals includes: the first time interval and the second time interval satisfy a preset relationship, the first time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (i-1) th handshake signal, the second time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (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 scheme is nine: the method according to variant six, wherein a first group of time intervals and/or a second group of time intervals are determined as a function of the time parameter, the first group of time intervals comprising at least one first time interval and the second group of time intervals comprising at least one second time interval.
And a scheme ten: the method according to scheme eight or nine, wherein generating the K handshake signals comprises: the low level pulses are generated K times in a first time interval and a second time interval.
Scheme eleven: the method according to any of schemes two to ten, 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 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.
Scheme twelve: a data receiving method, comprising: obtaining 2 contained in N-bit dataNAnd the corresponding relation between different numerical values and time intervals, wherein the time intervals corresponding to the different numerical values are different. Receiving X signals, determining the time interval between the starting time of every two adjacent signals in the X signals to obtain X-1 time intervals, wherein X is positive integerNumber, and X > 1; according to the obtained corresponding relation, 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 transmitted by S time intervals, wherein the numerical value transmitted by S time intervals is the numerical value corresponding to the single time interval, and the numerical value is 2 contained 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 2.
Scheme thirteen: the method of scheme twelve, wherein X-1 ═ n × M, n ≧ 1 and n is an integer.
A fourteen scheme: a method according to the twelfth or thirteenth aspect, characterized in that 2 included in the acquired N-bit dataNThe correspondence of the different values to the time intervals includes: determining a time parameter of current data transmission; obtaining 2 contained in N-bit data according to time parameterNThe correspondence of the various values to the time intervals.
A fifteenth scheme: the method according to any of aspects twelve to fourteen, wherein receiving the X signals comprises: x low pulses are detected.
Sixthly, the scheme is as follows: the method according to any of aspects twelve to fifteen, wherein prior to receiving the X signals, the method further comprises: receiving K signals, and detecting whether the K signals meet a preset relation, wherein K is more than or equal to 2 and is an integer.
Seventeen scheme: the method according to scheme sixteen, wherein determining a time parameter for a current data transmission comprises: a time parameter is determined from the K signals.
And eighteen schemes: the method according to the sixteenth or seventeenth aspect, wherein detecting whether the K signals satisfy a preset relationship includes: detecting time intervals among the K signals, and judging whether a first time interval and a second time interval meet a preset relation, 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; and if the first time interval and the second time interval meet the preset relation, executing the step of receiving the X signals.
The scheme is nineteen: the method according to scheme eighteen, wherein determining the time parameter from the K signals comprises: determining a first time interval group and/or a second time interval group, wherein the first time interval group comprises at least one first time interval, and the second time interval group comprises at least one second time interval; the time parameter is determined from the first time interval group and/or the second time interval group.
The scheme twenty: the method according to any one of aspects sixteen to nineteen, wherein receiving the K signals comprises: k low pulses are detected.
Scheme twenty one: the method according to any one of the fourteenth to the twenty-first aspects, 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 current data transmission; updating the corresponding relation according to the time parameter of the current data transmission; and acquiring data by using the updated corresponding relation.
Scheme twenty-two: a method according to any of aspects twelve to twenty-one, wherein receiving X signals comprises: and receiving Y +1 signals, and removing interference in the Y +1 signals to obtain X signals, wherein Y +1 is more than or equal to X.
Scheme twenty-three: a data transmission device comprises a time interval acquisition unit, a data bit string acquisition unit and a transmission unit, wherein: a time interval acquisition unit for acquiring 2 contained in the N-bit dataNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; the data bit string acquisition unit is used for acquiring a data bit string to be sent currently and grouping the data bit string, wherein each group of data is N bits; 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.
Twenty-four schemes: the apparatus according to the twenty-third aspect, wherein the apparatus further comprises a time parameter determining unit, and the time interval acquiring unit acquires2 comprised of N bits of dataNThe correspondence of the different values to the time intervals includes: a time parameter determining unit for determining the time parameter of the current data transmission, and a trigger time interval acquiring unit for acquiring 2 bits included in the N bits of data according to the time parameterNThe correspondence of the various values to the time intervals; a time interval acquisition unit for acquiring 2 contained in the N-bit data according to the time parameterNThe correspondence of the various values to the time intervals.
The scheme is twenty five: the apparatus according to scheme twenty-two or twenty-three, wherein for each set of data, the transmitting unit is configured to transmit the set of data, and includes: the sending unit is used for generating and sending 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.
Scheme twenty-six: the apparatus of scheme twenty-five, wherein the means for generating M signals comprises: the sending unit is used for generating M times of low-level pulses according to the time interval.
The scheme is twenty-seven: the apparatus according to any one of schemes twenty-three to twenty-six, further comprising a handshake signal transmission unit, wherein: and the handshake signal sending unit is used for generating and sending K handshake signals, wherein K is more than or equal to 2 and is an integer.
Scheme twenty-eight: the apparatus according to scheme twenty-seventh, wherein the K handshake signals satisfy a predetermined relationship.
The scheme is twenty-nine: the apparatus according to scheme twenty-eight, wherein the K handshake signals contain a time parameter.
Thirty percent of the scheme: the apparatus according to scheme twenty-eight or twenty-nine, wherein the satisfying of the preset relationship among the K handshake signals includes: the first time interval and the second time interval satisfy a preset relationship, the first time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (i-1) th handshake signal, the second time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (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 thirty one: the apparatus according to scheme thirty, further comprising: a handshake signal time interval determination 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 at least one first time interval, and the second time interval group includes at least one second time interval.
Scheme thirty-two: the apparatus according to scheme thirty or thirty-one, wherein the handshake signal transmission unit is configured to generate K handshake signals includes: the handshake signal sending unit is used for generating K times of low-level pulses according to the first time interval and the second time interval.
Scheme thirty-three: the apparatus according to twenty-four or thirty-two of the schemes, further comprising a time parameter updating unit, wherein: the time parameter updating unit is used for replacing the currently used time parameter with a new time parameter according to a preset rule, taking the new time parameter as the time parameter of the current data transmission, and triggering the time interval acquisition unit to update the corresponding relation according to the new time parameter; a time interval obtaining unit, configured to update the corresponding relationship according to a time parameter of current data transmission; and the sending unit is used for carrying out data transmission by utilizing the updated corresponding relation.
Scheme thirty-four: a data receiving apparatus, comprising a time parameter determining unit receiving unit and a data acquiring unit, wherein: a time interval acquisition unit for acquiring 2 bits contained in the N-bit dataNAnd the corresponding relation between different numerical values and time intervals, wherein the time intervals corresponding to the different numerical values are different. The receiving unit is used for receiving X signals, determining the time interval between the starting moments 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; a data obtaining unit, configured to obtain, according to the obtained correspondence, a value corresponding to a single time interval in every consecutive S time intervals in the X-1 time intervals to obtain a value transmitted in the S time intervals, where the value transmitted in the S time intervals is a value corresponding to the single time interval, and the value is 2 included in the N-bit dataNOne of different numerical valuesWherein, in the case of S > 1, the S time intervals are the same.
The scheme is thirty-five: the device according to the thirty-four aspect further comprises a time parameter determining unit, wherein the time interval acquiring unit acquires 2 bits of data contained in the N bits of dataNThe correspondence of the different values to the time intervals includes: a time parameter determining unit for determining the time parameter of the current data transmission, triggering the time interval acquiring unit to acquire 2 contained in the N-bit data according to the time parameterNThe correspondence of the various values to the time intervals; a time interval acquisition unit for acquiring 2 contained in the N-bit data according to the time parameterNThe correspondence of the various values to the time intervals.
The scheme is thirty-six: an apparatus according to scheme thirty-two or thirty-three, wherein X-1 ═ n × S, n ≧ 1 and n is an integer.
Scheme thirty-seven: the apparatus according to any one of schemes thirty-four to thirty-six, wherein the receiving unit is configured to receive the X signals and comprises: the receiving unit is used for detecting X times of low-level pulses.
Scheme thirty-eight: the apparatus according to any one of solutions thirty-four to thirty-seven, further comprising a handshake signal receiving unit, wherein: and the handshake signal receiving unit is used for receiving the K signals and detecting whether the K signals meet a preset relationship.
Scheme thirty-nine: thirty-eighth of the present aspects, wherein the time parameter determining unit is configured to determine the time parameter of the current data transmission, and comprises: the time parameter determining unit is used for determining time parameters according to the K signals.
Scheme forty: the apparatus according to any one of solutions thirty-eight or thirty-nine, wherein the handshake signal receiving unit is configured to receive the K signals and includes: the handshake signal receiving unit is used for detecting time intervals among 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; and if the first time interval and the second time interval meet the preset relationship, informing the receiving unit to execute the reception of the X signals.
Scheme forty one: the apparatus of scheme forty, wherein the means for determining the time parameter for the current data transmission comprises: the time parameter determining unit is used for determining a first time interval group and/or a second time interval group, wherein the first time interval group comprises at least one first time interval, and the second time interval group comprises at least one second time interval; and determining a time parameter from the first time interval group and/or the second time interval group.
Scheme forty-two: the apparatus according to any one of solutions thirty-eight to forty-one, wherein the handshake signal receiving unit configured to receive the K signals includes: the handshake signal receiving unit is used for detecting K times of low-level pulses.
Scheme forty-three: the apparatus according to any one of schemes thirty-five to forty-two, further comprising a time parameter updating unit, wherein: the time parameter updating unit is used for 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; a time interval obtaining unit, configured to update the corresponding relationship according to a time parameter of current data transmission; and the data acquisition unit is used for acquiring data by using the updated corresponding relation.
Scheme forty-four: the device according to any one of schemes thirty-four to forty-three, further comprising a filtering unit: and the filtering unit is used for receiving the Y +1 signals, removing the interference in the Y +1 signals, obtaining X signals and sending the X signals to the receiving unit, wherein Y +1 is more than or equal to X.
As can be seen from the above technical solutions of the present invention, according to the present invention, information can be transmitted through a transmission time interval, and a data transmission device represents transmitted data information through a time interval between two signals, so that data communication can be performed using only two lines, and the data transmission device and the data reception device can realize communication using only two communication interfaces.
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 schematic waveform diagram of each set of data provided in embodiment 1 of the present invention, which may correspond to one time interval or a plurality of time intervals;
fig. 3 is a schematic waveform diagram of a transmitted data bit string 0011100100 when N is 2 according to embodiment 1 of the present invention;
fig. 4 is a schematic waveform diagram of a transmitted data bit string 0011100100 when N is 3 according to embodiment 1 of the present invention;
fig. 5 is a flowchart of a data receiving method according to embodiment 2 of the present invention;
fig. 6 is a schematic structural diagram of a data transmission apparatus according to embodiment 3 of the present invention;
fig. 7 is a schematic structural diagram of a data receiving apparatus according to embodiment 4 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
The present embodiment provides a data transmission method, and fig. 1 is a flowchart of an alternative data transmission method according to the present embodiment. The execution main body of the embodiment of the present invention may be a transmitting end that transmits data.
As shown in fig. 1, the data transmission method includes the steps of:
step 101, obtaining 2 contained in N-bit dataNAnd (3) corresponding relations between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2.
Optionally, the time interval corresponding to the same value may be one or multiple, as long as the time intervals corresponding to different values are different, that is, the same time interval may uniquely correspond to one value, so that the receiving party may identify the value transmitted in the current time interval.
In an alternative implementation of this embodiment, the N-bit data comprises 2NThe different values are understood to be: for example, when N is 2, 2 bits of data, which contains 2 bits2The values are 00,01,10 and 11. The following is understood not to mean that the time intervals corresponding to the numerical values are different: for example, when N is 2, 00 corresponds to a time interval of 10 μ s, 01 corresponds to a time interval of 40 μ s, and the like. 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 sending end of the data may determine the time interval corresponding to the value by using a list negotiated and stored in advance with the receiving end of the data, for example, if a list of contents such as 10 μ s for the time interval corresponding to 00 and 40 μ s for the time interval corresponding to 01 is stored in the sending end of the data, the time interval corresponding to the value is determined by using a lookup list, so that efficiency of obtaining the time interval corresponding to the value may be improved.
As an optional implementation manner of this embodiment, 2 included in the N-bit data is obtainedNThe corresponding relationship between different values and time intervals, where the time intervals corresponding to different values are different, N is greater than or equal to 2, can also be understood as: 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 different bit strings are different, and N is more than or equal to 2. For example, when N is 2, each of the 4 bit strings with the length of 2 is: 00. 01,10 and 11, when N is 3 or more, refer to N is 2, which is not described herein again.
As an optional implementation manner of the embodiment of the present invention, before step 101, step 101' may further include determining a time parameter of current data transmission, and in step 101, obtaining 2 bits included in the N-bit dataNThe corresponding relationship between the different values and the time interval may be 2 included in the N-bit data obtained according to the time parameterNThe correspondence of the various values to the time intervals. Optionally, the time parameter of the current data transmission may be preset and determined in the sending end of the data, or may be obtained by the sending end of the data from other devicesThe present invention is not limited to the determination of the time parameter of the current data transmission, and the present invention is also within the scope of the present invention as long as the method for determining the time parameter of the current data transmission can be finally performed. 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 2, the time interval corresponding to time parameter acquisition 00, the time interval corresponding to time parameter acquisition 01, the time interval corresponding to time parameter acquisition 10, and the time interval corresponding to time parameter acquisition 11 are obtained. 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 sending end of the data may calculate the time interval corresponding to the value according to the time interval 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. 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.
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 102, obtaining 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: 103a, receiving first data through a first interface; and 103b, 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 is 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. Of course, the sending end of data in the embodiment of the present invention may also adopt the receiving method in the following embodiment 2 to receive X signals in the receiving method in the following embodiment 2 through the second interface, and obtain the second data bit strings corresponding to X-1 time intervals according to the obtained numerical values corresponding to the single time intervals in the S time intervals; coding the second data bit string according to a protocol supported by the first interface to obtain second data; the second data is transmitted through the first interface. At this time, the first interface may encode the received second data bit string by using a protocol supported by the first interface according to a difference in interface types, for example, the first interface may encode the second data bit string 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 second data to be sent. By performing data conversion through the first interface, the data bit string generated in the embodiment can be converted into data which can be supported by a general interface protocol, conversion among different interfaces is realized, and the application range of the data sending end of the embodiment is expanded.
And 103, grouping the data bit strings, wherein each group of data is N bits.
In this embodiment, optionallyStep 102 and step 103 may also be performed at any time before step 101, as long as the data bit string is acquired and grouped before data transmission. In addition, the sending end of the data may execute step 101 once before sending the data each time, or the sending end of the data may execute step 101 first, and then obtain 2 bits included in the N-bit data using step 101 each time the data is sent nextNThe correspondence between the different values and the time intervals to encode the data to be transmitted, or alternatively, a validity period may be set up within which to transmit the data, all using step 101 to obtain the 2 bits included in the N-bit dataNThe 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.
And 104, 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 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, before the sending of the first set of data in step 104, the method may further include: and 104a, generating and sending K handshake signals, wherein K is more 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 generated and transmitted to embody at least one time interval. The transmitting end sends a handshake signal, and the receiving end can judge the starting position of data transmission according to the handshake signal, so that the data transmission efficiency is improved.
Optionally, the K handshake signals may satisfy a preset relationship. The sending end sends the handshake signals meeting the preset relationship, and the receiving end can accurately judge whether the received data are the handshake signals according to the preset relationship.
Optionally, the handshake signals may include time parameters, and the receiving end may obtain the time parameters according to the K handshake signals, so that when the receiving end receives the signal sent by the sending end, a time interval is obtained, and the data sent by the sending end is obtained according to the time parameters and the time interval. By adopting the mode, the receiving end can acquire the time interval of the numerical value representing the data according to the time parameter used by the sending end, and the problem that the theoretical time parameter of the receiving end is not matched with the actual time parameter is solved.
Alternatively, the preset relationship that is satisfied between the K handshake signals may be that 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 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 ≧ 3, and K is an odd number. In this optional embodiment, the preset relationship that is satisfied between the first time interval and the second time interval may be a relationship that is agreed in advance by any transmitting end and receiving end, for example, the second time interval is twice as long as the first time interval. The sending end sends the handshake signals meeting the preset relationship, so that the receiving end can judge whether the received signals are the handshake signals according to whether the received data meet the preset relationship. For example, when 5 handshake signals are generated and transmitted, 4 time intervals t0, t1, t2 and t3 are included, wherein the first time interval may include t0 and t2, and the second time interval may include t1 and t3, and the preset relationship that the first time interval and the second time interval satisfy may be: t 1-2 t0 and t 3-2 t 2.
Optionally, the time parameter in step 101' may also be transmitted through the time interval between the K handshake signals, so that the receiving end may obtain the time parameter used by the sending end according to the K handshake signals, and further confirm the time parameter used by the receiving end. Specifically, the sending end may determine a first time interval group and a second time interval group according to the time parameter in step 101', where the first time interval group includes at least one first time interval, and the second time interval group includes at least one second time interval.
Alternatively, K handshake signals may be generated in such a way that K low-level pulses are generated in the first and second time intervals. The K handshake signals may also be generated in a manner that K times of high level pulses are generated according to the first time interval and the second time interval, and the low level pulse/high level pulse may be represented by waveforms of square waves, sine waves, triangular waves, and the like, which can distinguish between high and low level pulses, and is not limited herein. Preferably, the handshake signals are generated in a mode of generating low-level pulses according to time intervals, and 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 information is transmitted in a mode of low-level pulses. 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 104, in order to meet the rate of the current data transmission, the time parameter may also be replaced, that is, step 104 further includes step 100, according to a preset rule, the currently used time parameter may be replaced with a new time parameter, and the new time parameter is used as the time parameter of the 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 last group of data is sent in step 104, step 105 may further be included to send 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, after the last group of data is sent in step 104, or after the last group of data is sent in step 104, and after the check data is sent in step 105, step 106 may further be included to send a number a of end signals (a is greater than or equal to 1 and is an integer), where the end signals may be the same as or different from the handshake signals, and through the end signals, the receiving end may determine whether the data reception is ended.
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 step 101, 2 included in the N-bit data is obtainedNThe correspondence of the various values to the time intervals. For example, when N is 2, the corresponding relationship between 4 different values contained in the 2-bit data and the time interval is obtained, and the corresponding relationship may be obtained by table lookup or the like, for example, the value 00 pair in the listIn the present invention, the time interval corresponding to the value expressing 2-bit data may be obtained in a manner of, but is not limited to, a time interval having a time length of 10 μ s, a value of 01 corresponding to a time interval having a time length of 40 μ s, a value of 10 corresponding to a time interval having a time length of 70 μ s, and a value of 11 corresponding to a time interval having a time length of 100 μ s.
Before this step, step 101' may also be included, where a 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, and in this embodiment of the present invention, the time parameter is a time length occupied by data transmission. In step 101, 2 included in the N-bit data may be obtained according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 2, the corresponding relationship between 4 different values included in the 2-bit data and the time interval is obtained according to the time parameter, that is, the time interval corresponding to 00 is etu, the time interval corresponding to 01 is etu + pdt, the time interval corresponding to 10 is etu +2pdt, and the time interval corresponding to 11 is etu +3 pdt. 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 103, a current data bit string 0011100100 to be sent is obtained;
in step 104, the data bit strings 0011100100 are grouped, each group of data is 2 bits, that is: 0011100100, respectively;
in step 104, 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 corresponding relationship. 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, the sending end and the receiving end of the number of the time intervals are consistent, 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. 3, 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 step 101, 2 included in the N-bit data is obtainedNThe correspondence of the various values to the time intervals. For example, when N is 3, the corresponding relationship between 8 different values and time intervals included in the 3-bit data is obtained, and the corresponding relationship may be obtained by table lookup or the like, for example, in the list, the value 000 corresponds to a time interval with a time length of 10 μ s, the value 001 corresponds to a time interval with a time length of 40 μ s, the value 010 corresponds to a time interval with a time length of 70 μ s, the value 011 corresponds to a time interval with a time length of 100 μ s, the value 100 corresponds to a time interval with a time length of 130 μ s, the value 101 corresponds to a time interval with a time length of 160 μ s, the value 110 corresponds to a time interval with a time length of 190 μ s, and the value 111 corresponds to a time interval with a time length of 220 μ s.
Before this step, a step 101' of determining whenOptionally, two time parameters, a first time parameter etu and a second time parameter pdt, may be determined for the previous transmission, 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 101, 2 included in the N-bit data may be obtained according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 3, the corresponding relationship between 8 different values and time intervals included in the 3-bit data is obtained according to the time parameter, for example, the time interval corresponding to 000 is etu, the time interval corresponding to 001 is etu + pdt, the time interval corresponding to 010 is etu +2pdt, the time interval corresponding to 011 is etu +3pdt, the time interval corresponding to 100 is etu +4pdt, the time interval corresponding to 101 is etu +5pdt, the time interval corresponding to 110 is etu +6pdt, and the time interval corresponding to 111 is etu +7 pdt.
In step 103, a current data bit string 0011100100 to be sent is obtained;
in step 104, grouping the data bit strings 0011100100, where 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, performing zero padding on the data bit strings, and when the transmission order of the data bit strings is from low to high, performing high zero padding grouping as follows: 000011100100, when the transmission order of the data bit string is from high to low, the low zero padding packet is 001110010000.
In step 104, 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 corresponding relationship. 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 set of data 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. 4, and the transmission of the data bit string is completed by the time interval between the signals. Of course, if each group of data 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, and only the time interval corresponding to the numerical value from the high bit is used to send the signal in sequence, 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 2
This embodiment provides a data receiving method, and fig. 5 is a flowchart of an alternative data receiving method of this embodiment. The execution main body of the embodiment of the present invention may be a receiving end that receives data.
As shown in fig. 5, the data receiving method includes the steps of:
step 201, obtaining 2 contained in N-bit dataNThe 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 2, and the pre-calculation of 2 contained in the N bits of data is adoptedNThe value corresponding to the received time interval is determined in different manners of the value and the time interval, so that the decoding time after the data is received can be further reduced.
Optionally, the time interval corresponding to the same value may be one or multiple, as long as the time intervals corresponding to different values are different, that is, the same time interval may uniquely correspond to one value, so that the receiving party may identify the value transmitted in the current time interval.
As an optional implementation of the embodiment of the present invention, the N bits of data comprise 2NThe different values are understood to be: for example, when N is 2, 2 bits of data, which contains 2 bits2The values are 00,01,10 and 11. The time intervals corresponding to different values are different, and it is understood that the time intervals corresponding to 00,01,10, and 11 are different. Alternatively, the receiving end of the data may determine the time interval corresponding to the value by using a list negotiated and stored in advance with the transmitting end of the data, where the receiving end and the transmitting end of the data both store the list, and the time interval of 00 in the list is 10 μ s, the time interval of 01 in the list is 40 μ s, and so on. And determining the time interval corresponding to the numerical value by adopting a lookup list mode, and improving the efficiency of obtaining the time interval corresponding to the numerical value.
As an optional implementation manner of this embodiment, 2 included in the N-bit data is obtainedNThe corresponding relationship between different values and time intervals, where the time intervals corresponding to different values are different, N is greater than or equal to 2, can also be understood as: 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 different bit strings are different, and N is more than or equal to 2. For example, when N is 2, each of the 4 bit strings with the length of 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 optional implementation manner of this embodiment, 2 included in the N-bit data is obtained according to the time parameterNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 2, a time interval corresponding to 00 is acquired, a time interval corresponding to 01 is acquired, a time interval corresponding to 10 is acquired, and a time interval corresponding to 11 is acquired. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again.
As an optional implementation manner of the embodiment of the present invention, before this step, the method further includes step 201' of determining a time parameter of current data transmission; in step 201, the number of N bitsAccording to inclusion of 2NThe correspondence between the different values and the time intervals may also be: obtaining 2 contained in N-bit data according to time parameterNAnd (3) corresponding relations between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2. Optionally, the time parameter of the current data transmission may be preset and determined in the sending end of the data, may also be determined after the sending end of the data obtains the time parameter from other devices, and may also be determined after the sending end of the data obtains the time parameter by calculation in a preset manner. 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 2, the time interval corresponding to time parameter acquisition 00, the time interval corresponding to time parameter acquisition 01, the time interval corresponding to time parameter acquisition 10, and the time interval corresponding to time parameter acquisition 11 are obtained. 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 corresponding to the value by using a calculation method preset or determined by negotiation with the sending end of the data, for example, when N is equal to N, the calculation method of the time interval for sending the value 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 numerical 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 time interval corresponding to the numerical value of the data no matter what the value of N is. Thereafter, the receiving end can follow the calculated time intervalComparing the interval with the received time interval, thereby directly determining the numerical value corresponding to the time interval and improving the efficiency of determining data.
Step 202, receiving X signals, determining a time interval between starting times of every two adjacent signals in the X signals, and obtaining X-1 time intervals, where X is a positive integer and X > 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 202, step 202a is further included, that K signals are received, and whether K signals satisfy a preset relationship is detected, 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.
Optionally, in step 202a, 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. For example, when 5 signals are received, 4 time intervals t0, t1, t2 and t3 are included, wherein the first time interval may include t0 and t2, and the second time interval may include t1 and t3, wherein the preset relationship that the first time interval and the second time interval satisfy may be: t 1-2 t0 and t 3-2 t 2.
Further, the K signals received in step 202a may also carry a time parameter, and then in step 201', 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, where the first time interval group includes at least one first time interval, and the second time interval group includes at least one second time interval, and then the time parameter may be determined according to the first time interval group and/or the second time interval group. For example, if the transmitting end transmits 5 handshake signals, the first time interval group includes: and t0 and t2 are etu + pdt, the receiving end may determine values of the time parameters etu and pdt according to t0 and t2 in the first time interval group. 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 Y +1 signals, and removing interference in the Y +1 signals to obtain X signals, wherein Y +1 is more than or equal to X. For example, a first signal of the Y +1 signals may be determined as a first valid signal; and then sequentially judging whether the time interval between the starting time of the received Z-th signal and the starting time of the previous effective signal is one time interval in the acquired corresponding relationship, if so, recording the Z-th signal as an effective signal, wherein Z is 2,3,4, … … and Y +1, and recording the obtained effective signal as X signals.
Step 203, obtaining the corresponding numerical value of each single time interval in every continuous S time intervals in the X-1 time intervals according to the corresponding relation obtained in the step 201, and obtaining the numerical value transmitted by the S time intervals, wherein the numerical value transmitted by the S time intervals isA value corresponding to a single time interval of 2 for N bits of 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 2. 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. For example, a time interval of 100 μ s is received, and if N is 2, the time interval may be determined to correspond to a value of 11.
As an optional implementation manner of the embodiment of the present invention, according to the obtained correspondence, obtaining a value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals, to obtain a value transmitted by 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 ≧ 2 can be understood as: and according to the obtained corresponding relation, obtaining a bit string corresponding to a single time interval in every continuous S time intervals in X-1 time intervals to obtain a bit string transmitted by S time intervals, wherein the transmitted value of the 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 not more than 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 these two time intervals represent the time corresponding to the one time intervalA bit string; when X is 5, S is 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 another bit string, that is, the first two time intervals represent one bit string, and the last two time intervals represent another 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.
As an optional implementation manner of the embodiment of the present invention, as an implementation manner includes step 201 ', according to the time parameter of current data transmission determined in step 201', a value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals may be obtained, so as to obtain a value transmitted by S time intervals. The value corresponding to a single time interval may be calculated by various calculation methods, for example, the following may be adopted: 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.
In an optional implementation manner of this embodiment, X-1 ═ N × S, N ≧ 2, and N is an integer, with this optional implementation manner, X signals can transmit exactly N × S data, and the problem of being unable to decode due to redundant signals does not occur.
In an optional implementation manner of this embodiment, during the data transmission process, the time parameter may also be replaced, that is, after step 203, step 204 may further be included: 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 current data transmission; updating the corresponding relation according to the time parameter of the current data transmission; and acquiring data 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 last data is received in step 203, 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 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 203, 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 corresponding to the received waveform according to the time interval of the received waveform, can receive the data by using two lines only, and can effectively reduce the volume of the electronic equipment when being applied to the electronic equipment.
As an optional implementation manner of the present invention, a receiving end of data may serve as a switching device, which may switch communications between another device (hereinafter, referred to as a first terminal) and a sending end of the data, and at this time, the receiving end of the data may receive X signals through a second interface by using the receiving method in this embodiment, and obtain second data bit strings corresponding to X-1 time intervals according to values corresponding to single time intervals in the obtained S time intervals; coding the second data bit string according to a protocol supported by the first interface to obtain second data; the second data is transmitted through the first interface. At this time, the first interface may encode the received second data bit string by using a protocol supported by the first interface according to a difference in interface types, for example, the first interface may encode the second data bit string 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 second data to be sent. By performing data conversion through the first interface, the data bit string generated in the embodiment can be converted into data which can be supported by a general interface protocol, conversion among different interfaces is realized, and the application range of the receiving end of the data in the embodiment is expanded. Of course, when the data receiving end of the invention is used as a switching device, the first data can be received through the first interface; decoding the first data according to a protocol supported by the first interface to obtain a first data bit string to be sent; after the current data bit string to be sent is obtained through the first interface, the data bit string to be sent is sent through the second interface by using the data sending method provided in embodiment 1 of the present invention. At this time, when the receiving end of the data is used as the switching device, the receiving end of the data 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 the sending end of the data, the first interface may be an existing general interface, and includes wireless and wired interfaces, for example, interfaces such as a USB interface, an audio interface, a serial port, bluetooth, wifi, NFC, and the like, and may be connected to the first terminal through the first interface so as to send the second data to the first terminal. The first terminal can be a mobile phone, a computer, a PAD and other devices, and the second data can be data which needs to be received 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 of the first interface, 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, obtain a data bit string corresponding to the first data, and then send the data through the second interface by using the sending method described in embodiment 1. The second interface may be an interface connected to the electronic payment device (i.e., a receiving end of data), through which the data is transmitted to the electronic payment device, or may receive the data transmitted by the electronic payment device through the second interface. 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 receiving end of the data is used as a switching device, and the data conversion is carried out through the first interface, so that the data transmitted by the transmitting end of the data can be converted into the data suitable for communication with the terminal.
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 step 201, 2 included in the N-bit data is obtainedNThe correspondence of the various values to the time intervals. For example, when N is 2, the corresponding relationship between 4 different values and time intervals included in the 2-bit data is obtained, and the corresponding relationship may be obtained by table lookup, for example, a value 00 corresponds to a time interval with a time length of 10 μ s, a value 01 corresponds to a time interval with a time length of 40 μ s, a value 10 corresponds to a time interval with a time length of 70 μ s, and a value 11 corresponds to a time interval with a time length of 100 μ s.
Before this step, step 201' may be included, in which a time parameter of the current data transmission is determined, and 2 included in the N-bit data is obtained according to the time parameterNThe correspondence of the various values to the time intervals. Optionally, two time parameters, a first time parameter etu and a second time parameter pdt may be determined, where etu is 10 μ s, pdt is 30 μ s, a value 00 corresponds to a time interval with etu duration, a value 01 corresponds to a time interval with etu + pdt duration, a value 10 corresponds to a time interval with etu +2pdt duration, and a value 11 corresponds to a time interval with etu +3pdt durationThe length of time it takes to transmit. 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 202, 6 signals are received, and the time interval between the start times of every two adjacent signals in the 6 signals is determined, so as to obtain 5 time intervals of 10 μ s, 100 μ s, 70 μ s, 40 μ s, and 10 μ s.
In step 203, 2-bit data corresponding to the 5 time intervals are obtained, in this embodiment, if step 201' is included, a value corresponding to the obtained time interval according to a calculation method Tm + m pdt negotiated in advance with the sending end of the data may be obtained, and if a received time interval of 100 μ s is received, m may be obtained as 3, that is, the value transmitted by the time interval is 11. If step 201' is not included, 2 included in the N-bit data may be obtained by looking up a table or the like before this stepNThe correspondence of the various values to the time intervals. For example, when N is 2, the correspondence between 4 different values included in the 2-bit data and the time interval is obtained, that is, the time interval corresponding to 00 is 10 μ s, the time interval corresponding to 01 is 40 μ s, the time interval corresponding to 10 is 70 μ s, the time interval corresponding to 11 is 100 μ s, that is, if the time interval of 100 μ s is received, the value transmitted by the time interval may 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 represent a group of data at one time interval, for example, the time interval of one etu is obtained to represent 00, the data transmission speed is fast, or may represent a group of data at a plurality of same time intervals, for example, the time interval of three etu is obtained to represent 00, 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 step 201, 2 included in the N-bit data is obtainedNIndividual different value and timeAnd (5) corresponding relation of intervals. For example, when N is 3, the corresponding relationship between 8 different values and time intervals included in the 3-bit data is obtained, and the corresponding relationship may be obtained by table lookup or the like, for example, in the list, the value 000 corresponds to a time interval with a time length of 10 μ s, the value 001 corresponds to a time interval with a time length of 40 μ s, the value 010 corresponds to a time interval with a time length of 70 μ s, the value 011 corresponds to a time interval with a time length of 100 μ s, the value 100 corresponds to a time interval with a time length of 130 μ s, the value 101 corresponds to a time interval with a time length of 160 μ s, the value 110 corresponds to a time interval with a time length of 190 μ s, and the value 111 corresponds to a time interval with a time length of 220 μ s.
Before this step, step 201' may be included to determine a time parameter of the current transmission, 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, pdt is 30 μ s, the number of time parameters and N do not have a corresponding relationship, and this embodiment does not limit the specific number of time parameters, as long as a time interval corresponding to a numerical value can be expressed. In step 101, 2 included in the N-bit data may be obtained according to the time parameterNThe correspondence of the various values to the time intervals. For example, when N is 3, the corresponding relationship between 8 different values and time intervals included in the 3-bit data is obtained according to the time parameter, for example, the time interval corresponding to 000 is etu, the time interval corresponding to 001 is etu + pdt, the time interval corresponding to 010 is etu +2pdt, the time interval corresponding to 011 is etu +3pdt, the time interval corresponding to 100 is etu +4pdt, the time interval corresponding to 101 is etu +5pdt, the time interval corresponding to 110 is etu +6pdt, and the time interval corresponding to 111 is etu +7 pdt.
In step 202, 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 of 10 μ s, 100 μ s, 130 μ s, and 130 μ s.
Step 203, obtaining 3 bits of data corresponding to the 4 time intervals, in this embodiment, if step 201' is included, a value corresponding to the obtained time interval of the calculation method Tm + m pdt negotiated in advance with the sending end of the data may be obtained, and if a received time interval of 100 μ s is received, m may be 3, that is, the group of data is 011. If step 201' is not included, 2 included in the N-bit data may be obtained by looking up a table or the like before this stepNThe correspondence of the various values to the time intervals. For example, when N is 3, the correspondence between 8 different values and time intervals included in the 3-bit data is obtained, that is, the time interval corresponding to 000 is 10 μ s, the time interval corresponding to 001 is 40 μ s, the time interval corresponding to 010 is 70 μ s, the time interval corresponding to 011 is 100 μ s, the time interval corresponding to 100 is 130 μ s, the time interval corresponding to 101 is 160 μ s, the time interval corresponding to 110 is 190 μ s, and the time interval corresponding to 111 is 220 μ s, that is, if the time interval corresponding to 100 μ s is received, the value may be determined to be 011 directly. 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 transmission strategies of the transmitting end, the receiving end may represent a group of data at one time interval, for example, the time interval of etu is obtained only once to represent 000, the data transmission speed is fast, or may represent a group of data at multiple same time intervals, for example, the time interval of etu is obtained three times to represent 000, 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
In this embodiment, a data sending apparatus is provided, which corresponds to the data sending method in embodiment 1 one to one, and is not repeated herein, and only briefly described, in an optional implementation manner of this embodiment, the specific operations performed by each unit in the data sending apparatus may refer to embodiment 1.
In this embodiment, the data transmission device may be a mobile phone, a computer, a POS device, or the like.
Fig. 6 is a schematic structural diagram of an alternative data transmission apparatus according to this embodiment, where the apparatus includes: a time interval acquisition unit 302, a data bit string acquisition unit 303, and a transmission unit 304, wherein:
a time interval obtaining unit 302 for obtaining 2 contained in the N-bit dataNAnd (3) corresponding relations between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2.
In an optional implementation manner of this embodiment, the time interval obtaining unit 302 obtains 2 included in the N-bit dataNThe different values are understood to be: for example, when N is 2, 2 bits of data, which contains 2 bits2The values are 00,01,10 and 11. The following is understood not to mean that the time intervals corresponding to the numerical values are different: for example, when N is 2, 00 corresponds to a time interval of 10 μ s, 01 corresponds to a time interval of 40 μ s, and the like. 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 data sending apparatus may determine the time interval corresponding to the value by using a list negotiated and stored in advance with the data receiving apparatus, for example, if a list of contents, such as 10 μ s for a time interval corresponding to 00 and 40 μ s for a time interval corresponding to 01, is stored in the sending end of the data, the time interval corresponding to the value is determined by using a lookup list, so that efficiency of obtaining the time interval corresponding to the value may be improved.
As an optional implementation manner of this embodiment, the time interval obtaining unit 302 obtains 2 included in the N-bit dataNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N ≧ 2 can also be understood as: 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 different bit strings are different, and N is more than or equal to 2. For example, when N is 2, each of the 4 bit strings with the length of 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 optional implementation manner of this embodiment, the data sending apparatus may further include: a time parameter determining unit 301, configured to determine a time parameter of current data transmission, and trigger the time interval obtaining unit 302 to obtain 2 bits included in the N-bit data according to the time parameterNThe correspondence of the various values to the time intervals. Obtaining 2 contained in N-bit data according to time parametersNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 2, the time interval corresponding to 00 is obtained according to the time parameter (the time interval corresponding to 00 is etu), the time interval corresponding to 01 is obtained (the time interval corresponding to 01 is etu + pdt), the time interval corresponding to 10 is obtained (the time interval corresponding to 10 is etu +2pdt), and the time interval corresponding to 11 is obtained (the time interval corresponding to 11 is etu +3pdt), wherein etu and pdt are both time parameters and indicate time lengths. Optionally, the time parameter of the current data transmission may be preset and determined in the data sending device, may also be determined after the data sending device obtains the time parameter from another device, and may also be determined after the data sending device obtains the time parameter by calculation in a preset manner.
In an optional implementation manner of this embodiment, the time interval obtaining unit 302 of the data sending apparatus may calculate the time interval corresponding to the value by using a calculation method determined by negotiation with the data receiving apparatus 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. The number is calculated by a pre-negotiated calculation methodThe time interval corresponding to the value can ensure the expandability of data transmission, namely, the data sending device and the data receiving device can calculate the corresponding relation between different values and the time interval no matter what the value of N is.
As another optional implementation manner of the embodiment of the present invention, after the time interval acquiring unit 302 of the data transmitting apparatus calculates the time interval corresponding to the value by using a calculation method negotiated and determined in advance with the data receiving apparatus, the time interval acquiring unit 302 of the data transmitting apparatus 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 apparatus. 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, so that the expansibility of data transmission can be improved on the premise of ensuring that the data receiving device can normally receive the data.
A data bit string obtaining unit 303, configured to obtain a data bit string to be currently sent, and group the data bit strings, where each group of data is N bits.
In an optional embodiment of the present invention, the data bit string obtaining unit 303 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 devices or other units of the data sending device.
As an optional embodiment of the present invention, the data transmitting apparatus may be used as a switching apparatus, which can switch communications between another apparatus (hereinafter referred to as a first terminal) and the data receiving apparatus, and at this time, the data transmitting 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 sending device is used as a switching device, the data sending 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 data is 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 transmitting device of the invention is expanded. When the data transmission device is used as a switching device, the current data bit string to be transmitted is obtained through the first interface, and the data bit string to be transmitted is transmitted through the second interface.
In the present embodiment, alternatively, the data bit string acquisition unit 303 may perform the operation of acquiring the data bit string and the packet at any time as long as it is performed before the data transmission by the transmission unit 304. In addition, the transmitting end of the data may include 2 included in the N-bit data acquired by the time parameter determining unit and the time interval acquiring unit 302 before each data transmissionNIndividual difference value and time intervalOr, the sending end of the data may be operated by the time parameter determining unit and the time interval obtaining unit 302 first, and each time the data is sent later, the sending end of the data uses the 2 bits included in the N-bit data obtained by the operation of the time parameter determining unit and the time interval obtaining unit 302NThe corresponding relation between different values and time intervals 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 all obtained by using the 2 bits included in the N-bit data obtained by the operation of the time parameter determining unit and the time interval obtaining unit 302NThe 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 303 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 the data bit string 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.
A sending unit 304, configured to send the group of data in a manner that a time interval corresponding to a 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. 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 sending the group of data, the sending unit 304 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, 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.
Alternatively, the sending unit 304 is configured to generate M signals by generating M low-level pulses at time intervals, or by generating M high-level pulses 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. It is preferable that the low level pulse is generated at time intervals, and when the data transmission apparatus communicates with the data reception apparatus, the data transmission apparatus can use the high level to supply power to the data reception apparatus, and transmit information by means of the low level pulse. 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, the data sending apparatus further includes a handshake signal sending unit 305, where: and the handshake signal sending unit is used for generating and sending K handshake signals, wherein K is more 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 generated and transmitted to embody at least one time interval. The data sending device sends the handshake signals, and the data receiving device can judge the starting position of data transmission according to the handshake signals, so that the data transmission efficiency is improved.
Optionally, the K handshake signals may satisfy a preset relationship. The handshake signal sending unit of the data sending device sends handshake signals meeting the preset relationship, and the data receiving device can accurately judge whether the received data are the handshake signals according to the preset relationship.
Optionally, the handshake signals may include time parameters, and the data receiving apparatus may obtain the time parameters according to the K handshake signals, so that when the data receiving apparatus receives the signal sent by the sending end, a time interval is obtained, and the data sent by the sending end is obtained through the time parameters and the time interval. In this way, the data receiving device can acquire the time interval representing the numerical value according to the time parameter used by the data sending device, and the problem that the theoretical time parameter of the data receiving device is not matched with the actual time parameter is solved.
Alternatively, the preset relationship that is satisfied between the K handshake signals may be that 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 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 ≧ 3, and K is an odd number. In this optional embodiment, the preset relationship satisfied between the first time interval and the second time interval may be a relationship agreed in advance by any data transmitting apparatus and data receiving apparatus, for example, the second time interval is twice as long as the first time interval. The data sending device sends the handshake signals meeting the preset relationship, so that the data receiving device can judge whether the received signals are the handshake signals through whether the received data meet the preset relationship. For example, when 5 handshake signals are generated and transmitted, 4 time intervals t0, t1, t2 and t3 are included, wherein the first time interval may include t0 and t2, and the second time interval may include t1 and t3, and the preset relationship that the first time interval and the second time interval satisfy may be: t 1-2 t0 and t 3-2 t 2.
Optionally, the time parameter may also be transmitted through the time interval between the K handshake signals, so that the data receiving device may acquire the time parameter used by the data sending device according to the K handshake signals, and further confirm the time parameter used by the data receiving device. Specifically, the data transmitting apparatus may further include a handshake signal time interval determination 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 at least one first time interval, and the second time interval group includes at least one second time interval.
Optionally: the handshake signal sending unit is used for generating K handshake signals and comprises: the unit is used for generating K handshaking signals according to a mode that K low-level pulses are generated in a first time interval and a second time interval. The K handshake signals may also be generated in a manner that K times of high level pulses are generated according to the first time interval and the second time interval, and the low level pulse/high level pulse may be represented by waveforms of square waves, sine waves, triangular waves, and the like, which can distinguish between high and low level pulses, and is not limited herein. Preferably, the handshake signals are generated in such a manner that low-level pulses are generated at time intervals, and when the data transmission apparatus communicates with the data reception apparatus, the data transmission apparatus may use the high level to supply power to the data reception apparatus, and transmit information by means of the low-level pulses. 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, in order to meet the rate of current data transmission, the data sending apparatus of this embodiment may further include a time parameter updating unit, 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 obtaining unit 302 updates the corresponding relationship according to the new time parameter; the time interval obtaining unit 302 is further configured to update the corresponding relationship according to the time parameter of the current data transmission; the sending unit 304 is further configured to perform data transmission by using the updated corresponding relationship. In this embodiment, the determination of the new time parameter may be performed by negotiation between the data transmitting apparatus and the data receiving apparatus, or may be performed by the data transmitting apparatus and the data receiving apparatus looking up a pre-stored time parameter table, for example, when transmitting a certain type of data, the table look-up determines the time parameter that should be used by the certain type of data. The time parameter of the data sending device 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 apparatus 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, the apparatus 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 verification data sending unit sends the verification completion data, where the end signals may be the same as or different from the handshake signals, and through the end signals, the data receiving apparatus may determine whether the data reception is completed.
The technical scheme provided by the embodiment of the invention shows that the data sending device 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.
Example 4
This embodiment provides a data receiving apparatus, which corresponds to the data receiving method in embodiment 2 one to one, and no further description is given here, and only briefly described below, in an optional implementation manner of this embodiment, specific operations performed by each unit in the data sending apparatus may refer to embodiment 2.
In this embodiment, the data receiving apparatus may be an electronic payment device having functions of a smart card, a smart key device, a dynamic token, and the like, and may be used in cooperation with the data transmitting apparatus in embodiment 3.
Fig. 7 is a schematic structural diagram of an alternative data receiving apparatus of this embodiment, where the apparatus includes: a time interval acquisition unit 402, a receiving unit 403, and a data acquisition unit 404, wherein:
a time interval obtaining unit 402 for obtaining 2 contained in the N-bit dataNThe 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 2, and 2 contained in the N bits of data is calculated in advanceNThe value of the received time interval is determined in different values and time interval modes, so that the decoding time after the data is received can be reduced.
In an alternative implementation of this embodiment, the N-bit data comprises 2NThe different values are understood to be: for example, 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 dataNThe correspondence of the various values to the time intervals can be understood as: for example, when N is 2, a time interval corresponding to 00 is acquired, a time interval corresponding to 01 is acquired, a time interval corresponding to 10 is acquired, and a time interval corresponding to 11 is acquired. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again. Alternatively, the time interval obtaining unit 402 of the data receiving apparatus may determine the time interval corresponding to the numerical value of the data by using a list pre-stored in the data sending apparatus, and determine the time interval of the numerical value by using a lookup list, which may improve the efficiency of obtaining the time interval.
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 ≧ 2 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 different bit strings are different, and N is more than or equal to 2.
In an optional implementation of this embodiment, the data receiving apparatus further includes: a time parameter determining unit for determining the time parameter of the current data transmission, and a triggering time interval obtaining unit 402 for obtaining 2 bits included in the N bits of data according to the time parameterNThe correspondence of the various values to the time intervals. Optionally, the time parameter of the current data transmission may be preset and determined in the time parameter determining unit, may be determined after the time parameter determining unit acquires the time parameter from the data sending device, may be determined after the time parameter determining unit acquires the time parameter from another device, or may be determined after the time parameter determining unit calculates the time parameter in a preset manner. 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 2, the time interval corresponding to time parameter acquisition 00, the time interval corresponding to time parameter acquisition 01, the time interval corresponding to time parameter acquisition 10, and the time interval corresponding to time parameter acquisition 11 are obtained. Of course, when N is other values, it is the same as the above-mentioned understanding manner, and is not described herein again.
Alternatively, the time interval obtaining unit 402 of the data receiving apparatus may adopt a calculation method preset or determined by negotiation with the data sending apparatus to calculate a time interval corresponding to the value of the data according to the time parameter, for example, when N is equal to N, the calculation method of the time interval for sending the value 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 is also applicableOther pre-negotiated calculation methods may be used to determine the time interval, which is not limited in this embodiment. The time interval corresponding to the data value is calculated according to the time parameter by a pre-negotiated calculation method, so that the expandability of data transmission can be ensured, namely, the data sending device and the data receiving device can calculate the time interval corresponding to the data value no matter what the value of N is. Then, the data receiving device can compare the calculated time interval with the received time interval, so as to directly determine the value corresponding to the time interval, thereby improving the efficiency of determining data.
A receiving unit 403, 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;
in an optional implementation manner of this embodiment, the receiving unit 403 may detect X times of low-level pulses or X times of high-level pulses when receiving X signals. 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 detected low level pulse is low level pulse, that is, the data transmitting device can generate low level pulse under the condition of providing high level for the data receiving device, in this way, when the data transmitting device is communicated with the data receiving device, the data transmitting device can use the high level provided by the data receiving device as power supply to provide power for the power consumption device of the data receiving device, for example, the data receiving device can be charged by using the high level provided by the data transmitting device, or the data receiving device is not internally provided with power supply, but directly uses the high level of the data transmitting device as power supply.
In an optional implementation manner of this embodiment, the data receiving apparatus further includes a handshake signal receiving unit, where the handshake signal receiving unit is configured to receive K signals, and detect whether the 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.
Further, the handshake signal receiving unit may detect a time interval between K signals, and determine 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; 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. For example, when 5 signals are received, 4 time intervals t0, t1, t2 and t3 are included, wherein the first time interval may include t0 and t2, and the second time interval may include t1 and t3, wherein the preset relationship that the first time interval and the second time interval satisfy may be: t 1-2 t0 and t 3-2 t 2.
Further, the K signals received by the handshake signal receiving unit may also carry a time parameter, and the time parameter determining unit of the data receiving apparatus of this embodiment may also determine the time parameter according to the K signals. Optionally, the time parameter determining unit may be configured to determine a first time interval group and a second time interval group, where the first time interval group includes at least one first time interval, and the second time interval group includes at least one second time interval, and then determine the time parameter according to the first time interval group and/or the second time interval group. For example, if the data transmission apparatus transmits 5 handshake signals, the first time interval group includes: the data receiving apparatus may determine the values of the time parameters etu and pdt according to t0 and t1, where t0 and t2 are etu + pdt. The time parameter is determined through the K signals, the condition that the theoretical time parameter of the data receiving device is inconsistent with the actual time parameter can be overcome, and the accuracy of data transmission is guaranteed.
Similar to the signals for transmitting data, the handshake signal receiving unit of the data receiving apparatus is configured to confirm reception of K signals in a case where K low-level pulses are detected. 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 apparatus further includes a filtering unit, configured to receive Y +1 signals, and remove interference in the Y +1 signals to obtain X signals, where Y +1 ≧ X.
A data obtaining unit 404, configured to obtain, according to the correspondence obtained by the time interval obtaining unit 402, a numerical value corresponding to a single time interval in every continuous S time intervals in X-1 time intervals to obtain a numerical value transmitted by S time intervals, where the numerical value transmitted by S time intervals is a numerical value corresponding to a single time interval, and the numerical value is a numerical value included in the N-bit data and corresponding to 2 time intervals in each continuous S time intervalNOne 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 2. 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. For example, a time interval of 100 μ s is received, and the time interval may correspond to a value of 11 according to the correspondence.
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 ≧ 2 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 exampleWhen X is 2 and S is 1, only one time interval is provided, 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, S is 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 another bit string, that is, the first two time intervals represent one bit string, and the last two time intervals represent another 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.
As an optional implementation manner of the embodiment of the present invention, if the data receiving apparatus includes the time parameter determining unit, according to the time parameter of the current data transmission determined by the time parameter determining unit, a numerical 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 numerical value transmitted in S time intervals, and multiple calculation manners may be used 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.
In an optional implementation manner of this embodiment, X-1 ═ N × S, N ≧ 2, and N is an integer, with this optional implementation manner, X signals can transmit exactly N × S data, and the problem of being unable to decode due to redundant signals does not occur.
In an optional implementation manner of this embodiment, the data receiving apparatus further includes a time parameter updating unit, where the time parameter updating unit is further configured to replace a time parameter, replace a currently used time parameter with a new time parameter according to a preset rule, use the new time parameter as a time parameter for current data transmission, and update the corresponding relationship according to the time parameter for current data transmission; and the data acquisition unit is used for acquiring data by using the updated corresponding relation. In this embodiment, the determination of the new time parameter may be performed by negotiation between the data transmitting apparatus and the data receiving apparatus, or may be performed by the data transmitting apparatus and the data receiving apparatus looking up a pre-stored time parameter table, for example, when transmitting a certain type of data, the table look-up determines the time parameter that should be used by the certain type of data. The time parameter of the data sending device 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, after the receiving unit 403 finishes receiving the last data, the receiving unit 403 may further receive a number of end signals (Y +1 ≧ 1 and is an integer), where the end signals may be the same as the handshake signals or signals in other specific formats, and through the end signals, the data receiving apparatus may determine whether the data reception is finished.
In an optional implementation manner of this embodiment, after the receiving unit 403 finishes receiving the last data, or after the receiving unit 403 finishes receiving the last data and before receiving the a end signals, the receiving unit 403 may further receive check data, and through the check data, the data receiving apparatus 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 data receiving device can determine the data of the received waveform according to the time interval of the received waveform, can receive the 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 that is related to instructions of a program, and the program may be stored in a computer-readable storage medium, and when 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 separate 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 (10)

1. A data sending method is applied to the field of two-wire communication, and comprises the following steps:
determining a first time parameter etu and a second time parameter pdt for the current data transmission;
obtaining 2 contained in the N-bit data according to the first time parameter etu, the second time parameter pdt and a preset calculation methodNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; the preset calculation method is that the time interval corresponding to the value m is etu + m pdt, wherein N is N, and m is more than or equal to 0 and less than or equal to 2n-1;
Acquiring a data bit string to be sent currently;
grouping the data bit strings, wherein each group of data is N bits;
according to the obtained corresponding relation, 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; wherein the sending the group of data comprises:
generating and sending 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; generating M times of low-level pulses according to the time interval;
generating and transmitting K handshake signals before transmitting a first set of data, wherein the K handshake signals comprise the first time parameter etu and the second time parameter pdt, and determining a first time interval group and a second time interval group according to the first time parameter etu and the second time parameter pdt, the first time interval group comprising at least one first time interval, and the second time interval group comprising at least one second time interval;
the first time interval and the second time interval satisfy a preset relationship, the first time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (i-1) th handshake signal, the second time interval is a time interval between the starting time of the ith handshake signal and the starting time of the (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; and generating K times of low-level pulses according to the first time interval and the second time interval.
2. The method of claim 1, 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.
3. A data receiving method, which is applied to the field of two-wire communication, comprising:
receiving K times of low-level pulses, confirming to obtain K signals, and determining a first time interval group and a second time interval group according to the K signals, wherein the first time interval group comprises at least one first time interval, and the second time interval group comprises at least one second time interval; detecting whether the first time interval and the second time interval meet a preset relation, 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; if the first time interval and the second time interval meet a preset relation; determining a first time parameter etu and a second time parameter pdt for a current data transmission based on the first time interval group and the second time interval group;
obtaining 2 contained in the N-bit data according to the first time parameter etu, the second time parameter pdt and a preset calculation methodNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; the preset calculation method is that the time interval corresponding to the value m is etu + m pdt, wherein m is more than or equal to 0 and less than or equal to 2N-1;
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, wherein X is a positive integer and is greater than 1, and the X received signals are obtained by detecting X times of low-level pulses;
according to the obtained corresponding relation, obtaining a numerical value corresponding to a single time interval in every continuous S time intervals in the X-1 time intervals to obtain numerical values 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 the N-bit dataNOne of different numerical valuesAnd in the case that S is more than 1, the S time intervals are the same, X and S are positive integers, S is less than or equal to X-1, N is more than or equal to 2, X-1 is N S, N is more than or equal to 1, and N is an integer.
4. The method of claim 3, 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 currently transmitted time parameter;
and acquiring data by using the updated corresponding relation.
5. The method of claim 4, 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. A data sending device is applied to the field of two-wire communication and is characterized by comprising a time parameter determining unit, a handshake signal sending unit, a handshake signal time interval determining unit, a time interval acquiring unit, a data bit string acquiring unit and a sending unit, wherein:
the time parameter determining unit is configured to determine a first time parameter etu and a second time parameter pdt of the current data transmission;
the time interval obtaining unit is configured to obtain 2 bits included in the N-bit data according to the first time parameter etu, the second time parameter pdt, and a preset calculation methodNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; the preset calculation method is that the time interval corresponding to the value m is etu + m pdt, wherein N is N, and m is more than or equal to 0 and less than or equal to 2n-1;
The data bit string acquisition unit is used for acquiring a data bit string to be sent currently and grouping the data bit string, wherein each group of data is N bits;
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; wherein the sending the group of data comprises: generating and sending 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; generating M times of low-level pulses according to the time interval;
the handshake signal sending unit is configured to generate and send K handshake signals before sending the first set of data, where the K handshake signals include the first time parameter etu and the second time parameter pdt; generating K times of low-level pulses according to a first time interval and a second time interval;
the handshake signal time interval determination unit is configured to determine a first time interval group and a second time interval group according to the first time parameter etu and the second time parameter pdt, where the first time interval group includes at least one first time interval, and the second time interval group includes at least one second time interval;
the first time interval and the second time interval satisfy a preset relationship, the first time interval is a time interval between a starting time of an ith handshake signal and a starting time of an ith-1 th handshake signal, the second time interval is a time interval between a starting time of an ith handshake signal and a starting time of an ith +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.
7. The apparatus of claim 6, further comprising a time parameter update unit, wherein:
the time parameter updating unit is configured to replace a currently used time parameter with a new time parameter according to a preset rule, use the new time parameter as the time parameter of the current data transmission, and trigger the time interval obtaining unit to update the corresponding relationship according to the new time parameter;
the time interval obtaining unit is used for updating the corresponding relation according to the time parameter of the current data transmission;
and the sending unit is used for carrying out data transmission by utilizing the updated corresponding relation.
8. A data receiving device is applied to the field of two-wire communication and is characterized by comprising a handshake signal receiving unit, a time parameter determining unit, a time interval acquiring unit, a receiving unit and a data acquiring unit, wherein:
the handshake signal receiving unit is used for receiving K times of low level pulses and confirming to obtain K signals;
the time parameter determining unit is configured to determine a first time interval group and a second time interval group according to the K signals, where the first time interval group includes at least one first time interval, and the second time interval group includes at least one second time interval; detecting whether the first time interval and the second time interval meet a preset relation, 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; if the first time interval and the second time interval meet a preset relation; determining a first time parameter etu and a second time parameter pdt for a current data transmission based on the first time interval group and the second time interval group;
the time interval obtaining unit obtains 2 bits included in the N-bit data according to the first time parameter etu, the second time parameter pdt and a preset calculation methodNThe corresponding relation between different values and time intervals, wherein the time intervals corresponding to different values are different, and N is more than or equal to 2; the preset calculation method is that the time interval corresponding to the value m is etu + m pdt, wherein m is more than or equal to 0 and less than or equal to 2N-1;
The receiving unit is 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, and the received X signals are obtained by detecting X low-level pulses;
the data obtaining unit is configured to obtain, according to the obtained correspondence, a numerical value corresponding to a single time interval in every consecutive S time intervals in the X-1 time intervals to obtain a numerical value transmitted by the S time intervals, where 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 of S > 1, the S time intervals are identical and S is equal to or less than X-1, X-1 is n S, n is equal to or greater than 1 and n is an integer.
9. The apparatus of claim 8, further comprising a time parameter update unit, wherein:
the time parameter updating unit is used for 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;
the time interval obtaining unit is used for updating the corresponding relation according to the time parameter of the current data transmission;
and the data acquisition unit is used for acquiring data by using the updated corresponding relation.
10. The apparatus according to any one of claims 8 to 9, further comprising a filtering unit:
the filtering unit is used for receiving Y +1 signals, removing interference in the Y +1 signals, obtaining the X signals and sending the X signals to the receiving unit, wherein Y +1 is larger than or equal to X.
CN201510604984.9A 2015-09-21 2015-09-21 Data sending method and device and data receiving method and device Active CN106547711B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510604984.9A CN106547711B (en) 2015-09-21 2015-09-21 Data sending method and device and data receiving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510604984.9A CN106547711B (en) 2015-09-21 2015-09-21 Data sending method and device and data receiving method and device

Publications (2)

Publication Number Publication Date
CN106547711A CN106547711A (en) 2017-03-29
CN106547711B true CN106547711B (en) 2020-03-24

Family

ID=58364484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510604984.9A Active CN106547711B (en) 2015-09-21 2015-09-21 Data sending method and device and data receiving method and device

Country Status (1)

Country Link
CN (1) CN106547711B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683821A (en) * 2018-12-19 2019-04-26 惠州Tcl移动通信有限公司 Data processing method, device, mobile terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983913A (en) * 2005-12-17 2007-06-20 华为技术有限公司 Method and system for transmitting data
CN102333054A (en) * 2011-09-26 2012-01-25 北京天地融科技有限公司 Data sending and receiving method and device
CN103716270A (en) * 2011-09-26 2014-04-09 天地融科技股份有限公司 Data sending and receiving method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7729427B2 (en) * 2004-02-24 2010-06-01 Intersil Americas Inc. Pseudo-synchronous one wire bidirectional bus interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983913A (en) * 2005-12-17 2007-06-20 华为技术有限公司 Method and system for transmitting data
CN102333054A (en) * 2011-09-26 2012-01-25 北京天地融科技有限公司 Data sending and receiving method and device
CN103716270A (en) * 2011-09-26 2014-04-09 天地融科技股份有限公司 Data sending and receiving method and device

Also Published As

Publication number Publication date
CN106547711A (en) 2017-03-29

Similar Documents

Publication Publication Date Title
CN106549748B (en) A kind of data transmission method and data processing equipment
CN107210615B (en) Fast charge method, mobile terminal and adapter
CN104639477A (en) Backchannel communications for initialization of high-speed networks
CN106549921B (en) Data transmission method and device
US20170155458A1 (en) Multi-lane synchronization method, synchronization apparatus and system, and computer storage medium
CN106549729B (en) Data sending method and device and data receiving method and device
CN104753538B (en) Manchester encoded signals coding/decoding method and device
CN109286404A (en) A kind of Polar code encoding method and device
CN106547711B (en) Data sending method and device and data receiving method and device
CN111443869A (en) File storage method, device, equipment and computer readable storage medium
CN105591716B (en) A kind of serial data communication method, apparatus and system based on single carrier
CN107241162B (en) Data transmission method and device
CN110474692A (en) A kind of optical communication equipment, optical communication system, data transmission method and storage medium
CN107423248B (en) Data frame header sending method and sending device
CN106027196B (en) A kind of data transmission method and system
CN107493156B (en) Transmission parameter acquisition method and terminal
CN110062358A (en) A kind of access network node and paging method
CN106549728A (en) A kind of data receiver method and device
CN107465498B (en) Transmission parameter acquisition method and terminal
CN104753640B (en) A kind of adaptation method and device based on network transmission link
CN106549890B (en) Data receiving method and device
CN107346998B (en) Data frame tail detection method and data transmission device
CN105389865B (en) Shorten the digital signal method of sending and receiving and mobile terminal of sending time
CN107370565B (en) Transmission parameter adaptive data transmission method and device
CN104836277A (en) Communication method for lithium battery rapid charge

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