CN106549921A - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN106549921A
CN106549921A CN201510605275.2A CN201510605275A CN106549921A CN 106549921 A CN106549921 A CN 106549921A CN 201510605275 A CN201510605275 A CN 201510605275A CN 106549921 A CN106549921 A CN 106549921A
Authority
CN
China
Prior art keywords
time interval
data
numerical value
time
interface
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.)
Granted
Application number
CN201510605275.2A
Other languages
Chinese (zh)
Other versions
CN106549921B (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
Tendyron Technology Co Ltd
Original Assignee
Tendyron Technology Co Ltd
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 Technology Co Ltd filed Critical Tendyron Technology Co Ltd
Priority to CN201510605275.2A priority Critical patent/CN106549921B/en
Publication of CN106549921A publication Critical patent/CN106549921A/en
Application granted granted Critical
Publication of CN106549921B publication Critical patent/CN106549921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Abstract

The present invention provides a kind of data transmission method and device, and the method includes:First data are received by first interface;The agreement supported according to first interface obtains the first data bit string to be sent to the first decoding data;Determine the time parameter of present data transmission;2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval, wherein, the corresponding time interval of different numerical value is different, wherein, N >=1;First data bit string is grouped, every group of data are N-bit;According to the corresponding relation for obtaining, this group of data are sent by way of second interface represents this group of data with the corresponding time interval of the numerical value of every group of data.Using the present invention, it is spaced come transmission information by passing time, data transmission device receives conventional data, is representing the data message of transmission, so as to realize the data communication of distinct device different agreement using the time interval between two signals by the soft coral.

Description

Data transmission method and device
Technical field
The present invention relates to a kind of electronic technology field, more particularly to a kind of data transmission method and device.
Background technology
At present electronic product quickly grows, and external interface mixes, and conventional wired external interface has USB interface, DOCK interfaces etc., but on Stating interface at least needs more than three to complete to communicate and charge, and takes the volume of larger electronic equipment, and needs more hardware supported.Therefore, In the art, in order to reduce hardware cost and reduce the volume of electronic equipment, need a kind of only to use two lines, you can complete the two of data transfer Line communication technology scheme.
The content of the invention
Present invention seek to address that one of the problems referred to above.
Present invention is primarily targeted at providing a kind of data transmission method;
Another object of the present invention is to provide another kind of data transmission method;
A further object of the present invention is to provide a kind of data transmission device;
The a further object of the present invention is to provide another kind of data transmission device.
To reach above-mentioned purpose, what technical scheme was specifically realized in:
The invention provides below scheme:
Scheme one, a kind of data transmission method, including:
First data are received by first interface;The agreement supported according to first interface obtains to be sent first to first decoding data Data bit string;Determine the time parameter of present data transmission;2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value with The corresponding relation of time interval, wherein, the corresponding time interval of different numerical value is different, wherein, N >=1;The first data bit string is carried out point Group, every group of data are N-bit;According to the corresponding relation for obtaining, represented with the corresponding time interval of the numerical value of every group of data by second interface The mode of this group of data sends this group of data.
Scheme two, the method according to scheme one, for every group of data, send this group of data, including:M signal is produced and sends, wherein, The start time of each signal and the corresponding time interval of numerical value that the time interval of the start time of an adjacent upper signal is this group of data, M >=1 and M are natural number.
Scheme three, the method according to scheme two, M signal of the generation include:M low level pulse is produced according to the time interval.
Scheme four, the method according to scheme four, methods described also include:X signal is received by second interface, the X letter is determined The time interval between initial time in number per two neighboring signal, obtains X-1 time interval, wherein, X is positive integer, and X > 1; According to the time parameter for determining, the corresponding numerical value of single time interval in often continuous S time interval is obtained in the X-1 time interval, The numerical value of the S time interval transmission is obtained, the numerical value of the S time interval transmission is the corresponding numerical value of the single time interval, described Numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the case of S > 1, the S time interval is identical, its In, X and S is positive integer, and S≤X-1, N >=1;According to the corresponding numerical value of single time interval in the S time interval for getting, obtain Take the second data bit string of the X-1 time interval transmission;According to first interface support agreement to the second data bit string is compiled Code, obtains the second data;Second data are sent by the first interface.
Scheme five, the method according to scheme four, X-1=n*S, n >=1 and n are integer.
Scheme six, the method according to scheme four or five, the second interface include for receiving X signal:The second interface is used to detect To X low level pulse.
Scheme seven, the method according to one to six any one of scheme, before first group of data is sent, methods described also includes:Produce and send K handshake, K >=2 and K are integer.
Scheme eight, the method according to scheme seven, meet preset relation between the K handshake.
Scheme nine, the method according to scheme eight, the K handshake include the time parameter.
Scheme ten, the method according to scheme 8 or 9, meeting preset relation between the K handshake includes:The very first time is spaced and the Preset relation, start time and the i-th -1 described in shake hands letter of the very first time at intervals of handshake described in i-th are met between two time intervals Number start time between time interval, second time interval is that start time and the i+1 of handshake described in i-th described are shaken hands Time interval between the start time of signal, i=2,4 ... ..., 2j, j=(K-1)/2, K >=3 and K are odd number.
Scheme 11, the method according to scheme ten, determine very first time interval group and/or the second time interval group, institute according to the time parameter Stating very first time interval group includes described at least one very first time interval, and the second time interval group was included described at least one between the second time Every.
Scheme 12, the method according to scheme ten or 11, K handshake of the generation include:It is spaced according to the very first time and institute State the second time interval and produce K low level pulse.
Scheme 13, the method according to one to ten two any one of scheme, also include:According to preset rules, by currently used time parameter Replace with new time parameter, using the new time parameter as the present data transmission time parameter;According to the present data transmission Time parameter updates the corresponding relation;Carried out data transmission using the corresponding relation after renewal.
Scheme 14, the time parameter for determining present data transmission;X signal is received by second interface, every phase in the X signal is determined Time interval between the initial time of adjacent two signals, obtains X-1 time interval, wherein, X is positive integer, and X > 1;According to determination The time parameter, the corresponding numerical value of single time interval in obtaining in the X-1 time interval per continuous S time interval, obtain described in The numerical value of S time interval transmission, the numerical value of the S time interval transmission is the corresponding numerical value of the single time interval, and the numerical value is N Bit data include 2NOne in individual different numerical value, wherein, in the case of S > 1, the S time interval is identical, wherein, X and S is positive integer, and S≤X-1, N >=1;According to the corresponding numerical value of single time interval in the S time interval for getting, the X-1 is obtained Second data bit string of individual time interval transmission;The agreement supported according to first interface obtains the to the second data bit string is encoded Two data;Second data are sent by the first interface.
Scheme 15, the method according to scheme 14, first continuous S time interval transmission in the X-1 time interval is obtained Before numerical value, methods described also includes:2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are corresponding with time interval Relation, wherein, the corresponding time interval of different numerical value is different.
Scheme 16, the method according to scheme 15, X-1=n*S, n >=1 and n are integer.
Scheme 17, the method according to scheme 15 or 16, the second interface include for receiving X signal:The second interface is used In detecting X low level pulse.
Scheme 18, the method according to ten five to ten seven any one of scheme, before X signal is received, methods described also includes:Receive To K signal, detect and whether preset relation is met between the K signal, wherein, K >=2 and K is integer.
Scheme 19, the method according to scheme 18, determine that the time parameter of present data transmission includes:Institute is determined according to the K signal State time parameter.
Scheme 20, the method according to scheme 18 or 19, detect and whether meet preset relation between the K signal, including:Detection Time interval between the K signal, judges whether meet preset relation, the very first time between very first time interval and the second time interval Start time at intervals of signal described in i-th and the time interval between the start time of the i-th -1 signal, second time interval are the Time interval between the start time of the start time of the i signal and the i+1 signal, i=2,4 ... ..., 2j, j=(K-1)/2, K >=3 And K is odd number;If the very first time interval meets preset relation with second time interval, notify that the second interface is performed and receive the X Individual signal.
According to the K signal, scheme 21, the method according to scheme 20, determine that the time parameter includes:Determine between the very first time Every group and/or the second time interval group, very first time interval group includes very first time interval, the second time interval group bag described at least one Include the second time interval described at least one;The time parameter is determined according to very first time interval group and/or the second time interval group.
Scheme 22, the method according to 11 any one of scheme ten eight to two, K signal of the reception include:Detect K low electricity Flat pulse.
Scheme 23, the method according to 12 any one of scheme ten five to two, also include:According to preset rules, by the currently used time Parameter replaces with new time parameter, using the new time parameter as the present data transmission time parameter;The second interface is received X signal, determines the time interval between the initial time of every two neighboring signal in the X signal, obtains X-1 time interval, wherein, X is positive integer, and X > 1;According to the time parameter of the present data transmission, every continuous S time in the X-1 time interval is obtained The corresponding numerical value of single time interval in interval, obtains the numerical value of the S time interval transmission, and the numerical value that the S time interval is transmitted is institute The corresponding numerical value of single time interval is stated, the numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the feelings of S > 1 Under condition, the S time interval is identical.
Scheme 24, the method according to 13 any one of scheme ten five to two, the second interface is used to receiving X signal to be included:It is described Second interface is used to receive Z signal, removes the interference in the Z signal, obtains the X signal, wherein Z >=X.
Scheme 25, a kind of data transmission device, including:First interface, for receiving the first data;First codec unit, for basis The agreement that first interface is supported obtains the first data bit string to be sent to first decoding data;Time parameter determining unit, is used for Determine the time parameter of present data transmission;Time interval acquiring unit, 2 contained according to time parameter acquisition N-bit packetNIndividual difference The corresponding relation of numerical value and time interval, wherein, the corresponding time interval of different numerical value is different, wherein, N >=1;Data bit string grouped element, For the first data bit string is grouped, every group of data are N-bit;Second interface, for according to obtain the corresponding relation, with The corresponding time interval of numerical value of every group of data represents that the mode of this group of data sends this group of data.
Scheme 26, the device according to scheme 25, for every group of data, the second interface is used to send this group of data, including: The second interface is used to producing and sending M signal, wherein, the start time of the start time of each signal and an adjacent upper signal Time interval be this group of data the corresponding time interval of numerical value, M >=1 and M are natural number.
Scheme 27, the device according to scheme 26, the second interface include for producing M signal:The second interface is used for M low level pulse is produced according to the time interval.
Scheme 28, the device according to scheme 25, described device also include that data capture unit, Bit String acquiring unit, second are compiled Decoding unit;The second interface unit, is additionally operable to, by receiving X signal, determine the starting of every two neighboring signal in the X signal Time interval between moment, obtains X-1 time interval, wherein, X is positive integer, and X > 1;The data capture unit, for root According to the time parameter for determining, the corresponding numerical value of single time interval in often continuous S time interval is obtained in the X-1 time interval, is obtained To the numerical value of S time interval transmission, the numerical value of S time interval transmission is the corresponding numerical value of the single time interval, the number It is worth 2 contained for N-bit packetNOne in individual different numerical value, wherein, in the case of S > 1, the S time interval is identical, wherein, X and S are positive integer, and S≤X-1, N >=1;The Bit String acquiring unit, when single in the S time interval got for basis Between be spaced corresponding numerical value, obtain the second data bit string that the X-1 time interval is transmitted;Second codec unit, for according to The agreement that one interface is supported obtains the second data to the second data bit string is encoded;The first interface, is additionally operable to send described the Two data.
Scheme 29, the device according to scheme 28, X-1=n*S, n >=1 and n are integer.
Scheme 30, the device according to scheme 28 or 29, the second interface include for receiving X signal:Described second connects Mouth is used to detect X low level pulse.
Scheme 31, the device according to 20 five to three ten any one of scheme, also including handshake transmitting element, wherein:It is described to shake hands Signal transmitting unit, for producing and sending K handshake, K >=2 and K is integer.
Scheme 32, the device according to scheme 31, meet preset relation between the K handshake.
Scheme 33, the device according to scheme 32, the K handshake include the time parameter.
Scheme 34, the device according to scheme 32 or 33, meeting preset relation between the K handshake includes:First Preset relation, start time and i-th -1 of the very first time at intervals of handshake described in i-th are met between time interval and the second time interval Time interval between the start time of the individual handshake, second time interval are start time and the i+1 of handshake described in i-th Time interval between the start time of the individual handshake, i=2,4 ... ..., 2j, j=(K-1)/2, K >=3 and K are odd number.
Scheme 35, the device according to scheme 34, also include:Handshake time interval determining module, for according to the time Parameter determination very first time interval group and/or the second time interval group, very first time interval group include very first time interval, institute described at least one Stating the second time interval group includes the second time interval described at least one.
Scheme 36, the device according to scheme 34 or 35, the handshake transmitting element are used to produce K handshake bag Include:The handshake transmitting element is for according to very first time interval and second time interval K low level pulse of generation.
Scheme 37, the device according to 16 any one of scheme 20 five to three, also including time parameter updating block, wherein:When described Between parameter updating block, for according to preset rules, currently used time parameter being replaced with new time parameter, by the new time parameter As the time parameter of the present data transmission;The time interval acquiring unit, is additionally operable to update the correspondence according to the present data transmission Relation;The second interface, the corresponding relation after being additionally operable to using renewal carry out data transmission.
Scheme 38, a kind of data transmission device, including:Time parameter determining unit, for determining the time parameter of present data transmission;The Two interfaces, for receiving X signal, determine the time interval between the initial time of every two neighboring signal in the X signal, obtain X-1 Individual time interval, wherein, X is positive integer, and X > 1;Data capture unit, for according to the time parameter for determining, obtaining the X-1 Per the corresponding numerical value of single time interval in continuous S time interval in individual time interval, the numerical value that the S time interval is transmitted is obtained, it is described The numerical value of S time interval transmission is the corresponding numerical value of the single time interval, and the numerical value is 2 that N-bit packet containsNIndividual different numerical value In one, wherein, in the case of S > 1, the S time interval is identical, wherein, X and S is positive integer, and S≤X-1, N ≥1;Bit String acquiring unit, for according to the corresponding numerical value of single time interval in S time interval getting, during described X-1 of acquisition Between interval transmission the second data bit string;Second codec unit, for the agreement supported according to first interface to by the second data bit string Encoded, obtained the second data;First interface, for sending second data.
Scheme 39, the device according to scheme 38, also include:Time interval acquiring unit, for obtaining in the data capture unit In taking in the X-1 time interval per continuous S time interval before the corresponding numerical value of single time interval, according to time parameter acquisition N Bit data include 2NThe corresponding relation of individual different numerical value and time interval, wherein, the corresponding time interval of different numerical value is different.
Scheme 40, the device according to scheme 39, X-1=n*S, n >=1 and n are integer.
Scheme 41, the device according to scheme 39 or 40, the second interface include for receiving X signal:Described second connects Mouth is used to detect X low level pulse.
Scheme 42, the device according to 11 any one of scheme 30 nine to four, also including handshake receiving unit, wherein:It is described to hold Handss signal receiving unit, for receiving K signal, detects and whether meet preset relation between the K signal, wherein, K >=2 and K is Integer.
Scheme 43, the device according to scheme 42, the time parameter determining unit are used for the time parameter for determining present data transmission Including:The time parameter determining unit is for determining the time parameter according to the K signal.
Scheme 44, the device according to scheme 42 or 43, the handshake receiving unit be used for detect the K signal it Between whether meet preset relation, including:The handshake receiving unit detects the time interval between the K signal, judges between the very first time Whether meet preset relation between the second time interval, the very first time at intervals of signal described in i-th start time with described in the i-th -1 Time interval between the start time of signal, second time interval are the start time of signal described in i-th and the i+1 signal Time interval between start time, i=2,4 ... ..., 2j, j=(K-1)/2, K >=3 and K are odd number;If the very first time interval and described second Time interval meets preset relation, notifies that the second interface is performed and receives the X signal.
Scheme 45, the device according to scheme 44, when the time parameter determining unit is for determining described according to the K signal Between parameter include:The time parameter determining unit is used to determine very first time interval group and/or the second time interval group, very first time interval group It is spaced including the very first time described at least one, the second time interval group includes the second time interval described at least one;During according to described first Between interval group and/or the second time interval group determine the time parameter.
Scheme 46, the device according to 15 any one of scheme 40 two to four, the handshake receiving unit are used to receive K signal Including:The handshake receiving unit is used to detect K low level pulse.
Scheme 47, the device according to 16 any one of scheme 30 nine to four, also including time parameter updating block, wherein:When described Between parameter updating block, for according to preset rules, currently used time parameter being replaced with new time parameter, by the new time parameter As the time parameter of the present data transmission;The second interface, is additionally operable to receive X signal, determines every phase in the X signal Time interval between the initial time of adjacent two signals, obtains X-1 time interval, wherein, X is positive integer, and X > 1;The data Acquiring unit, is additionally operable to according to the time parameter according to the present data transmission, in the acquisition X-1 time interval between every continuous S time The corresponding numerical value of single time interval in, obtains the numerical value of the S time interval transmission, and the numerical value of the S time interval transmission is described The corresponding numerical value of single time interval, the numerical value are 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the situation of S > 1 Under, the S time interval is identical.
Scheme 48, the device according to 17 any one of scheme 30 nine to four, also including filter unit;The second interface is used to receive X signal includes:The second interface is used to receive Z signal;The filter unit, for removing the interference in the Z signal, obtains The X signal, wherein Z >=X.
As seen from the above technical solution provided by the invention, the invention provides a kind of data transmission method and data transmission device, by this The technical scheme that invention is provided, can be spaced come transmission information by passing time, and data transmission device receives conventional data by first interface, will The soft coral is time interval between two signals of utilization of the present invention representing the data message of transmission, and by this using two signals it Between time interval sent by second interface the data message that represents transmission, such that it is able to realize that the data of distinct device different agreement are led to Letter.
Description of the drawings
In order to be illustrated more clearly that the technical scheme of the embodiment of the present invention, embodiment will be described below needed for accompanying drawing to be used simply be situated between Continue, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for one of ordinary skill in the art, not On the premise of paying creative work, can be with according to these accompanying drawings acquisition other accompanying drawings.
Fig. 1 is the flow chart of the data transfer that the embodiment of the present invention 1 is provided;
Fig. 2 is that every group of data bit that the embodiment of the present invention 1 is provided can correspond to a time interval, and the waveform that can also correspond to multiple time intervals is illustrated Figure;
When Fig. 3 is the N=2 that the embodiment of the present invention 1 is provided, the waveform of data bit string 0011100100 is sent;
When Fig. 4 is the N=1 that the embodiment of the present invention 1 is provided, the waveform of data bit string 0011100100 is sent;
When Fig. 5 is the N=3 that the embodiment of the present invention 1 is provided, the waveform of data bit string 0011100100 is sent;
Fig. 6 is the flow chart of the data transmission method that the embodiment of the present invention 2 is provided;
Fig. 7 is the structural representation of the data transmission device that the embodiment of the present invention 3 is provided;
Fig. 8 is the structural representation of the data transmission device that the embodiment of the present invention 4 is provided.
Specific embodiment
With reference to the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that retouched The embodiment stated is only a part of embodiment of the invention, rather than the embodiment of whole.Based on embodiments of the invention, ordinary skill people The every other embodiment obtained under the premise of creative work is not made by member, belongs to protection scope of the present invention.
In describing the invention, it is to be understood that term " " center ", " longitudinal direction ", " horizontal ", " on ", D score, "front", "rear", " left side ", The orientation or position relationship of the instruction such as " right side ", " vertical ", " level ", " top ", " bottom ", " interior ", " outward " is to be closed based on orientation shown in the drawings or position System, be for only for ease of description the present invention and simplify description, rather than indicate or imply indication device or element must have specific orientation, with Specific azimuth configuration and operation, therefore be not considered as limiting the invention.Additionally, term " first ", " second " are only used for describing purpose, And it is not intended that indicating or implying relative importance or quantity or position.
In describing the invention, it should be noted that unless otherwise clearly defined and limited, should do term " installation ", " being connected ", " connection " Broadly understood, for example, it may be being fixedly connected, or being detachably connected, or be integrally connected;Can be mechanically connected, or electricity Connection;Can be joined directly together, it is also possible to be indirectly connected to by intermediary, can be the connection of two element internals.It is common for this area For technical staff, above-mentioned term concrete meaning in the present invention can be understood with concrete condition.
The embodiment of the present invention is described in further detail below in conjunction with accompanying drawing.
Embodiment 1
A kind of data transmission method is present embodiments provided, Fig. 1 is the flow chart of a kind of optional data transmission method of the present embodiment.It is of the invention real The executive agent for applying example can be the data transmission device in embodiment 3, and the data transmission device has first interface and second interface, and this first connects Mouthful can be existing general-purpose interface, including wireless and wireline interface, such as USB interface, audio interface, serial ports, bluetooth, wifi, NFC etc. Interface, data transmission device may be coupled to first terminal by the first interface, and to receive the first data sent from first terminal, first eventually End can be the equipment such as mobile phone, computer, PAD.The second interface can be a two line communication interfaces, i.e. second interface is realized using both threads Data transfer and power supply, data transmission device are connected to second terminal by the second interface, and the second terminal can be the equipment such as electronic payment devices, The electronic payment devices can realize USBkey functions, OTP functions and intelligent card function etc..
The data transmission device given below is passed by the data that second interface sends after from after first interface receiving data processed data The concrete steps of transmission method.In the present embodiment, when the data transmission device is connected to second terminal by second interface, the data transmission device The data sending terminal of the present embodiment data transmission method is may be considered, the second terminal may be considered the data of the present embodiment data transmission method and connect Receiving end.
As shown in figure 1, the data transmission method is comprised the following steps:
Step 101, receives the first data by first interface.
Specifically, first data can be that the data that first terminal needs transmission, i.e. first terminal need to transmit to the data of second terminal, example Data, or other key messages or the non-critical informations such as Transaction Information in payment process are could be for such as.
Step 102, the agreement supported according to first interface obtain the first data bit string to be sent to first decoding data.
Specifically, difference of the first interface according to its interface type, the host-host protocol supported by which are also different, and first interface can be propped up using itself , to the first decoding data for receiving, for example, first interface can be according to usb protocol, audio protocols, serial port protocol, indigo plant for the agreement held Tooth agreement, wifi agreements, NFC protocol etc. obtain the corresponding data bit string of the first data, are to be sent first to the first decoding data Data bit string.Data conversion is carried out by the first interface, it is possible to achieve the data conversion for sending over terminal is into the number being adapted in the present embodiment According to the data transmitted in transmission method, the conversion between distinct interface is realized, expand the use range of the data transmission method of the present embodiment.
Step 103, determines the time parameter of present data transmission.
In an optional embodiment of the present embodiment, the time parameter of present data transmission can be what data transmission device was preset and determined, Can determine from after other devices (such as connected first terminal) acquisition for data transmission device, can also pass through pre- for data transmission device If mode be calculated after determine, the invention is not limited in the determination mode of the time parameter of present data transmission, as long as may finally determine The mode of the time parameter of present data transmission all should belong to protection scope of the present invention.
Step 104,2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval, wherein, no It is different with the corresponding time interval of numerical value, wherein, N >=1.
Alternatively, the corresponding time interval of same numerical value can be one, or it is multiple, as long as the corresponding time interval of different numerical value is differed , i.e., by being spaced at the same time, a numerical value can be uniquely corresponded to, such recipient can recognize that current time interval is transmitted Numerical value.
As an optional embodiment of the present embodiment, 2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value and time interval Corresponding relation, wherein, the corresponding time interval of different numerical value is different, and N >=1 is it is also understood that be:
Obtain 2NCorresponding relation of the individual length for each Bit String and time interval in the Bit String of N, wherein, 2NThe individual Bit String is different, And the corresponding time interval of different Bit Strings is different, N >=1.For example as N=1,2 length be 1 Bit String in each Bit String distinguish For 0 and 1, as N=2,4 length be 2 Bit String in each Bit String be respectively:00th, 01,10 and 11, when N=3 or more than When, with reference to N=2, will not be described here.
In an optional embodiment of the present embodiment, N-bit packet contain 2NIndividual different numerical value, it can be understood as:For example, during N=1, 1 bit data, which includes 21Individual different numerical value, respectively 0,1;During N=2,2 bit datas, which includes 22Individual different numerical value, respectively 00,01,10,11.2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are can be understood as with the corresponding relation of time interval:For example, As N=1,0 corresponding time interval is obtained according to time parameter, obtain 1 corresponding time interval according to time parameter;As N=2, press 00 corresponding time interval is obtained according to time parameter, 01 corresponding time interval is obtained according to time parameter, obtain 10 correspondences according to time parameter Time interval, according to time parameter obtain 11 corresponding time intervals.Certainly, it is when N is other values, identical with above-mentioned understanding mode, This repeats no more.
In an optional embodiment of the present embodiment, data transmission device can using with the receiving terminal of data (be connected with data transmission device Two terminals) computational methods consulting in advance to determine calculate the corresponding time interval of the numerical value, such as N=n, between the transmission numerical value m corresponding times Every computational methods can be:Corresponding time interval=etu+m*pdt (wherein, 0≤m≤2 of numerical value mn- 1, etu be very first time parameter, pdt For the second time parameter, for example etu=10 μ s, pdt=30 μ s), i.e. 11 corresponding time interval computational methods of numerical value can be 10 μ s+3*30 μ s=100 μ s, can calculate the corresponding time interval of numerical value by the optional embodiment.Certainly, the present invention can also adopt which The computational methods that he consults in advance determine time interval, and the present invention is without limitation.The numerical value pair is calculated by the advance computational methods consulted The time interval answered, it is ensured that the extensibility of data transfer, no matter that is, the value of N is how many, data transmission device and data receiver can be counted Calculation draws the corresponding relation of different numerical value and time interval.
Used as another optional embodiment of the embodiment of the present invention, data transmission device may also be employed consulting in advance and storing with the receiving terminal of data List by the way of list is searched determines the corresponding time interval of the numerical value, can improve and obtain the numerical value determining the corresponding time interval of the numerical value The efficiency of corresponding time interval.
Used as another optional embodiment of the embodiment of the present invention, data transmission device is using the calculating side for consulting determination with the receiving terminal of data in advance After method calculates the corresponding time interval of the numerical value, when data transmission device searches the list that prestores to judge that the calculated numerical value is corresponding Between be spaced the range of receiving of the receiving terminal for whether belonging to data.By the way of list is further searched for after the corresponding time interval of numerical value is calculated The corresponding time interval of numerical value is obtained, the autgmentability of data transfer can be improved on the premise of normally receiving receiving terminal is ensured.
Step 105, the first data bit string is grouped, and every group of data are N-bit.
In the present embodiment, alternatively, any time that step 105 can also be before step 104 performs, as long as number is obtained before data is activation According to Bit String and it is grouped.In addition, data transmission device can be performed both by step 103 and a step 104 before data are sent every time, or Person, data transmission device can also first carry out step 103 and step 104, follow-up to send data every time, all obtain N-bit number using step 104 According to 2 for includingNThe corresponding relation of individual different numerical value and time interval, to be encoded to sent data, or, it is also possible to arranging one has In the effect time limit, data, 2 for containing using step 104 acquisition N-bit packet are sent in the expiry dateNIndividual different numerical value and time interval Corresponding relation, to be encoded to sent data.Or, it is also possible to according to the mode that event is triggered, often receive an event triggering, example Such as, the time parameter of user input present data transmission, calculate that N-bit packet contains 2NIndividual different numerical value are corresponding with time interval to close System.Concrete the present embodiment is not construed as limiting.
As an optional embodiment of the present invention, data bit string is grouped, every group of data can be carried out using various ways for N-bit Packet, can be being grouped by the way of adopting per group to include 1 bit, it would however also be possible to employ per group of mode including 2 bits is grouped, when data ratio When special string includes odd number, due to being grouped according to 2 bits completely, it can be grouped after carrying out mending 0 to data Bit String again, now, The receiving terminal of data transmission device and data presets or consults the mode of benefit 0, when starting to send data bit string from a high position for data, 0 is mended in the last position of Bit String, when starting to send data bit string from the low level of data, high-order in Bit String mends 0.Certainly, per group includes 3 The situation of bit and the above is referred to per group of mode for including 2 bits and is grouped, and will not be described here.
Step 106, according to the corresponding relation for obtaining, represents this group data with the corresponding time interval of the numerical value of every group of data by second interface Mode send this group of data.
In the present embodiment, the numerical value of every group of data can correspond to a time interval, it is also possible to the multiple identical time intervals of correspondence.For example, join According to Fig. 2,2 bits in one group of data, are included, the numerical value of this group of data can be 00,01,10 and 11, when the numerical value of this group of data is 00, Numerical value 00 can be represented with 1 time interval, now the corresponding time span of 1 time interval can be etu, i.e., the expression of this group data 00 Mode can be the time interval of 1 such as 10 μ s, when this group of data are 00, it is also possible to which 5 time intervals represent numerical value 00, now this 5 In time interval, the time span of each time interval can be etu, i.e., the expression way of this group data 00 can be 5 time interval identical letters Number, each time interval is the time interval of 10 μ s.Using numerical value one time interval of correspondence of every group of data, data transmission bauds is fast, efficiency It is high.Using the multiple time intervals of numerical value correspondence of every group of data, the corresponding numerical value of the time interval can be accurately judged, in preventing data transmission procedure Mistake caused by drop-out time interval.
The second interface of the present embodiment can be used for transmitting the data according to the present embodiment encoding and decoding protocol encoding and decoding, and the second interface can be one two Line communication interface, the i.e. second interface carry out transmission data merely with both threads, additionally, the second interface can also realize data transfer and power supply simultaneously. The second interface of the present embodiment can be attached to the interface of second terminal (equipment such as such as electronic payment devices), by the second interface by data Bit String is sent to electronic payment devices.The electronic payment devices can realize USBkey functions, OTP functions and intelligent card function etc..
Data conversion is carried out by the second interface, it is possible to achieve data of the data conversion that first terminal is sended over into suitable utilization the present embodiment The data of transmission method transmission, then second terminal is transmitted this data to, the number between different terminal equipment is realized so as to pass through the data transmission method According to conversion, the use range of the data transmission method of the present embodiment is expanded.
In an optional embodiment of the present embodiment, for every group of data, when second interface sends this group of data, can produce and send M Individual signal, wherein, the start time of each signal is corresponding with the numerical value that the time interval of the start time of an adjacent upper signal is this group of data Time interval, M >=1 and M are natural number.The time interval produced by the way of signal, is had and is easy to detection and the high effect of stability.
It is alternatively possible to the mode for producing M low level pulse according to time interval produces M signal, or produces according to time interval The mode of M high level pulse produces M signal.Low level pulse/the high level pulse can adopt square wave, sine wave, triangular wave Deng Ke areas The waveform of low and high level pulse is divided to represent that this is not restricted.It is preferred that low level pulse is produced using according to time interval, in transmitting terminal and receiving terminal During communication, transmitting terminal can be powered for receiving terminal using high level, the transmission information by way of low level pulse.Using the equipment of the method, When information exchange is carried out, same single line can be used while completing power supply and information transmission, equipment volume and manufacturing cost is reduced.
Certainly, the data transmission device of the present embodiment can also realize the data transmission method in embodiment 2 simultaneously, i.e. the data of the present embodiment are passed Defeated device is sent by second interface to the data transfer of second terminal after not only can realizing from after first interface receiving data being processed data Method, it is also possible to which realization is sent by first interface to the data transmission method of first terminal after being processed from after second interface receiving data.According to The mode of operation of the data transmission device is different, when which is only operated in simplex pattern, then the data transmission device synchronization only transmit from Data of the first interface to second interface, or only transmit the data from the second data to first interface;When which can be operated in duplex communication mode, The data transmission device can be with simultaneous transmission first interface to data transfer mutual between second interface.
I.e. in an alternate embodiment of the present invention where, the further comprising the steps of (not shown) of the data transmission method of the present embodiment, it is concrete real Existing method is no longer gone to live in the household of one's in-laws on getting married herein and is chatted referring to the description in embodiment 2.
Step 107, receives X signal by second interface, determines the time interval between the initial time of every two neighboring signal in X signal, X-1 time interval is obtained, wherein, X is positive integer, and X > 1;
Step 108, according to the time parameter for determining, in X-1 time interval of acquisition, in every continuous S time interval, single time interval is corresponding Numerical value, obtains the numerical value of S time interval transmission, and the numerical value of S time interval transmission is the corresponding numerical value of single time interval, and numerical value is N ratios Special packet contain 2NOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical, wherein, X and S are Positive integer, and S≤X-1, N >=1;
Step 109, according to the corresponding numerical value of single time interval in the S time interval for getting, obtains the second of X-1 time interval transmission Data bit string;
Step 110, according to the agreement of first interface support to the second data bit string is encoded, obtains the second data;
Step 111, sends the second data by first interface.
In an optional embodiment of the present embodiment, before first group of data of transmission in step 106, the method can also include:Step 106a, produces and sends K handshake, K >=2 and K is integer.Can just produce between a time due to only having between adjacent two signal Every, therefore, two handshake should be at least produced and send, to embody at least one time interval.Transmitting terminal sends handshake, receives End can judge the starting position of data transfer according to the handshake, improve data transmission efficiency.
Alternatively, preset relation can be met between K handshake.Transmitting terminal sends the handshake for meeting preset relation, and receiving terminal can basis The preset relation accurately judges whether the data for receiving are handshake.
Alternatively, time parameter can be included in handshake, receiving terminal can obtain time parameter according to the K handshake, so as in receiving terminal When receiving the signal of transmitting terminal transmission, time interval is obtained, the data that transmitting terminal sends are obtained by time parameter and time interval.Using this Kind of mode, receiving terminal can according to transmitting terminal using time parameter obtaining the time interval for representing data, solve the theoretical time parameter of receiving terminal With the unmatched problem of parameter actual time.
Alternatively, it can be that default closing is met between very first time interval and the second time interval that preset relation is met between above-mentioned K handshake System, wherein, the very first time at intervals of the time interval between the start time of i-th handshake and the start time of the i-th -1 handshake, the Two time intervals are the time interval between the start time of the start time of i-th handshake and i+1 handshake, i=2,4 ... ..., 2j, J=(K-1)/2, K >=3 and K are odd number.In this optional embodiment, the preset relation met between very first time interval and the second time interval The relation that can be any transmitting terminal be made an appointment with receiving terminal, such as the second time interval is two times of very first time interval.Transmitting terminal is full by sending The handshake of sufficient preset relation so that receiving terminal by whether the data for receiving meet preset relation can judge to receive whether signal is to shake hands Signal.For example, when producing and send 5 handshake, including 4 time intervals t0, t1, t2 and t3, wherein, very first time interval can With including t0 and t2, the second time interval can include t1 and t3, and the preset relation that wherein very first time interval is met with the second time interval can be with For:T1=2t0, t3=2t2.The very first time, the second time interval was t2 at intervals of t1,
Alternatively, can also be by the time parameter in the time interval transmitting step 103 between above-mentioned K handshake so that receiving terminal can be with The time parameter that transmitting terminal is used is got according to the K handshake, the time parameter that receiving terminal is used is further confirmed that.Specifically, transmitting terminal Very first time interval group and the second time interval group can be determined according to the time parameter in step 103, very first time interval group includes at least one the One time interval, the second time interval group include at least one second time intervals.
It is alternatively possible to the mode for producing K low level pulse according to very first time interval and the second time interval produces K handshake. Can be that the mode for producing K high level pulse according to very first time interval and the second time interval produces K handshake, the low level pulse/ High level pulse can adopt the waveform that square wave, sine wave, triangular wave etc. can distinguish low and high level pulse to represent that this is not restricted.It is preferred that adopting The form that low level pulse is produced according to time interval produces handshake, and when transmitting terminal is communicated with receiving terminal, transmitting terminal can be to connect using high level Receiving end is powered, the transmission information by way of low level pulse.Using the equipment of the method, when information exchange is carried out, same can be used Line completes power supply simultaneously and information sends, and reduces equipment volume and manufacturing cost.
In an optional embodiment of the present embodiment, after step 106, in order to meet the speed of present data transmission, when can also change Between parameter, i.e., after step 106 also include step 100, currently used time parameter can be replaced with into the new time according to preset rules Parameter, using new time parameter as present data transmission time parameter;Time parameter according to present data transmission updates corresponding relation;Rear In continuous data transmission procedure, carried out data transmission using the corresponding relation after renewal.In the present embodiment, the determination of new time parameter can be with Completed by the negotiation of transmitting terminal and receiving terminal, it is also possible to the time parameter table for prestoring is searched by transmitting terminal and receiving terminal and is completed, such as sent The time parameter that the data of determination the type of tabling look-up during certain categorical data should be used.The time parameter of transmitting terminal can be change, can match The receiving terminal of different pieces of information disposal ability, or different types of data are matched, can further improve the efficiency of data processing.
In an optional embodiment of the present embodiment, after completing to send last group of data in step 106, step 106b is may also include, sent out Verification data is sent, by the verification data, data receiver can determine whether that whether complete receiving data is correct.Verification data including but not limited to passes through MAC verifications, even-odd check, take and verify etc. the verification data that verification mode is calculated.
In an optional embodiment of the present embodiment, after completing to send last group of data in step 106, or complete to send in step 106 After last group of data, before step 106b, step 106c is may also include, send A end signal (A >=1 and be integer), terminate to believe Number can be identical with handshake, it is also possible to which different, by the end signal, receiving terminal can determine whether whether data receive to be terminated.
The technical scheme provided by the embodiments of the present invention can be seen that data transmission method using the present embodiment, and data transmission device is by the One interface conventional data, by the soft coral be the present invention two signals of utilization between time interval come represent transmission data believe Breath, and this is sent by second interface come the data message for representing transmission using the time interval between two signals, i.e., the second interface can So that the data for sending waveform are represented according to the time interval for sending waveform, such that it is able to realize the data communication of distinct device different agreement.The present embodiment The second interface of data transmission device the transmission of data only can be completed using two lines, when being suitable in the electronic device, electronics can be effectively reduced and set Standby volume.
Below with the first data bit string as 0011100100, N=2, simple example is carried out to data transmission method provided in an embodiment of the present invention and is said It is bright:
In step 101, first terminal is connected to by first interface, receives the first data that first terminal needs to send;
In step 102, to the first decoding data, it is 00111000100 that decoding obtains the first data bit string to the agreement supported according to first interface;
In step 103, the time parameter of current transmission is determined, optionally, it may be determined that go out two time parameters, very first time parameter etu and second Time parameter pdt, wherein etu=10 μ s, pdt=30 μ s, in embodiments of the present invention, time parameter is the time span that data is activation takes.Time There is no corresponding relation with N in the number of parameter, only consistent with receiving terminal, the present embodiment is not restricted to the concrete number of time parameter, As long as the corresponding time interval of the numerical value that data can be given expression to.
In step 104,2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval.Such as, in N=2 When, the corresponding relation of the different numerical value of 2 bit datas include 4 and time interval is obtained according to time parameter, you can thought for 00 corresponding time At intervals of etu, 01 corresponding time interval is etu+pdt, and 10 corresponding time intervals are etu+2pdt, and 11 corresponding time intervals are etu+3pdt, In the present invention, the multiple combination form of time parameter can be adopted to express the corresponding time interval of numerical value of 2 bit datas, it is not limited to this.
In step 105, data bit string 0011100100 is grouped, every group of data are 2 bits, i.e.,:0011100100;
In step 106, according to the corresponding relation for obtaining, the group is sent in the way of the corresponding time interval of the numerical value of every group of data represents this group of data Data.In the present embodiment, the numerical value of every group of data can correspond to a time interval, it is also possible to the multiple identical time intervals of correspondence, and such as 00 The time interval (such as 10 μ s) of an etu can be corresponded to, and another signal is sent with the time interval after a signal, so be formed The duration of etu represents numerical value 00;Certainly, 00 the time interval (such as each time interval is 10 μ s) of three etu can also be corresponded to, and at one Three signals are continuously transmitted with the time interval of etu after signal, receiving terminal only receives three durations of such identical and just will be considered that and have received number Value 00.When every group of data are represented using multiple identical time intervals, the number transmitting terminal of time interval is consistent with receiving terminal, concrete this reality Apply example not to be restricted.
In the present embodiment, transmission numerical value 00, the time interval table of etu+3pdt can be represented with the time interval of etu according to the order of data bit string Show transmission numerical value 11, the time interval of etu+2pdt represents transmission numerical value 10, and the time interval of etu+pdt represents transmission numerical value 01, between the time of etu Numerical value 00 is sent every representing.By taking numerical value one time interval of correspondence of every group of data as an example, the waveform of data bit string 0011100100 is sent as schemed Shown in 3, by the time interval between each signal, the transmission of the data bit string is completed.
Below with the first data bit string to be sent as 0011100100, N=1, letter is carried out to data transmission method provided in an embodiment of the present invention It is single to illustrate:
In step 101, first terminal is connected to by first interface, receives the first data that first terminal needs to send;
In step 102, to the first decoding data, it is 00111000100 that decoding obtains the first data bit string to the agreement supported according to first interface;
In step 103, the time parameter of current transmission is determined, optionally, it may be determined that go out two time parameters, very first time parameter etu and second Time parameter pdt, wherein etu=10 μ s, pdt=30 μ s.There is no corresponding relation with N in the number of time parameter, the present embodiment is not to the time The concrete number of parameter is restricted, as long as the corresponding time interval of the numerical value that can give expression to data.
In step 104,2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval.Such as, in N=1 When, the corresponding relation of the different numerical value of 1 bit data include 2 and time interval is obtained according to time parameter, you can be, 0 corresponding time At intervals of etu, 1 corresponding time interval is pdt, in the present invention it is possible to express 1 bit data using the multiple combination form of time parameter The corresponding time interval of numerical value, it is not limited to this.
In step 105, data bit string 0011100100 is grouped, every group of packet contains 1 bit, i.e.,:0011100100;This Step can also be omitted.
In step 106, according to the corresponding relation for obtaining, the group is sent in the way of the corresponding time interval of the numerical value of every group of data represents this group of data Data.In the present embodiment, the numerical value of every group of data can correspond to a time interval, it is also possible to the multiple identical time intervals of correspondence, and such as 0 can With the time interval (such as 10 μ s) of one etu of correspondence, and another signal, the etu for so being formed are sent with the time interval after a signal Duration represent numerical value 0;Certainly, 0 the time interval (such as each time interval is 10 μ s) of three etu can also be corresponded to, and in a signal Three signals are continuously transmitted with the time interval of etu afterwards, receiving terminal only receives three durations of such identical and just will be considered that and have received numerical value 0.
In the present embodiment, can send between the time that every group of data, the i.e. time interval of each signal are respectively etu according to the order of data bit string Every, the time interval of etu, the time interval of pdt, the time interval of pdt, the time interval of pdt, the time interval of etu, between the time of etu Every, the time interval of pdt, the time interval of etu, the time interval of etu.By taking numerical value one time interval of correspondence of every group of data as an example, send The waveform of data bit string 0011100100 is as shown in figure 4, by the time interval between each signal, complete the transmission of the data bit string.
Below with the first data bit string to be sent as 0011100100, N=3, letter is carried out to data transmission method provided in an embodiment of the present invention It is single to illustrate:
In step 101, first terminal is connected to by first interface, receives the first data that first terminal needs to send;
In step 102, to the first decoding data, it is 00111000100 that decoding obtains the first data bit string to the agreement supported according to first interface;
In step 103, the time parameter of current transmission is determined, optionally, it may be determined that go out two time parameters, very first time parameter etu and second Time parameter pdt, wherein etu=10 μ s, pdt=30 μ s.There is no corresponding relation with N in the number of time parameter, the present embodiment is not to the time The concrete number of parameter is restricted, as long as the corresponding time interval of numerical value can be given expression to.
In step 104,2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval.Such as, in N=3 When, the corresponding relation of the different numerical value of 3 bit datas include 8 and time interval is obtained according to time parameter, for example, between 000 corresponding time Etu is divided into, 001 corresponding time interval is etu+pdt, and 010 corresponding time interval is etu+2pdt, and 011 corresponding time interval is etu+3pdt, 100 corresponding time intervals be etu+4pdt, 101 corresponding time intervals be etu+5pdt, 110 corresponding time intervals be etu+6pdt, 111 Corresponding time interval is etu+7pdt, in the present invention it is possible to express the numerical value correspondence of 3 bit datas using the multiple combination form of time parameter Time interval, it is not limited to this.
In step 105, data bit string 0011100100 is grouped, every group of data are 3 bits, in the present embodiment, when the number for obtaining When not being the integral multiple of per group of bit number for including according to Bit String, zero padding operation is carried out to data Bit String, when the transmission order of data bit string is From low level to high-order transmission, then high-order zero padding is grouped into:000011100100, when the transmission order of data bit string is to send from a high position to low level, Then low level zero padding is grouped into 001110010000.
In step 106, according to the corresponding relation for obtaining, the group is sent in the way of the corresponding time interval of the numerical value of every group of data represents this group of data Data.In the present embodiment, the numerical value of every group of data can correspond to a time interval, it is also possible to the multiple identical time intervals of correspondence.
In the present embodiment, such as every group of data are sent according to the order from low to high of data bit string, that is, send the time interval of etu+4pdt Signal, the signal of the time interval of etu+4pdt, the signal of the time interval of etu+3pdt, the signal of the time interval of etu.With every group of data As a example by numerical value one time interval of correspondence, the waveform of data bit string 0011100100 is sent as shown in figure 5, by the time between each signal Interval, completes the transmission of the data bit string.Certainly, if the order from a high-order low level sends every group of data, it is only necessary in low level zero padding, The mode of data is activation is simply adopted from the high-order corresponding time interval of numerical value for starting successively sending signal using similar with low to high, This repeats no more.
When N >=4, data transmission method during N=2 or N=3 is can refer to, send data.
As N=1.5, data transmission method during N=2 is can refer to, send data, difference is:
Using the numerical value at least 2 time interval 3 bit datas of correspondence, i.e., when the value of N is non-integer, multiple time intervals pair can be used The different numerical value in B bit datas are answered, wherein, B is the integral multiple of N, and B is positive integer.
Embodiment 2
A kind of data transmission method is present embodiments provided, Fig. 6 is the flow chart of a kind of optional data transmission method of the present embodiment.With embodiment Unlike 1, after the present embodiment provides from second interface, data that the data transmission device receives that second terminal sends, after data are processed The concrete steps of the data transmission method sent by first interface.In the present embodiment, when the data transmission device is connected by second interface During to second terminal, the data transmission device may be considered the data receiver of the present embodiment data transmission method, and the second terminal may be considered The data sending terminal of the present embodiment data transmission method.
The executive agent of the embodiment of the present invention can be data transmission device, and the data that the data transmission device receiving end/sending end is sent simultaneously are carried out corresponding Process.The data transmission device has first interface and second interface, and the second interface can be a two line communication interfaces, i.e., second interface is utilized Realizing data transfer and power supply, data transmission device is connected to second terminal by the second interface to both threads, and the second terminal can be electronics The equipment such as dispensing apparatus, the electronic payment devices can realize USBkey functions, OTP functions and intelligent card function etc., and data transmission device passes through The second interface is connected to second terminal, receives the signal that second terminal sends.The first interface can be existing general-purpose interface, including wireless And wireline interface, such as interface such as USB interface, audio interface, serial ports, bluetooth, wifi, NFC, data transmission device pass through the first interface First terminal is may be coupled to, to send data to first terminal, first terminal can be the equipment such as mobile phone, computer, PAD.
As shown in fig. 6, the data transmission method is comprised the following steps:
Step 201, determines the time parameter of present data transmission;
In an optional embodiment of the present embodiment, the time parameter of present data transmission can be to preset and determine in the receiving terminal of data, Can also be to determine after the receiving terminal of data is obtained from transmitting terminal, can also be to determine after the receiving terminal of data is calculated by default mode , for example, receiving terminal can first receive handshake before receiving the data, determine the time parameter of present data transmission by handshake, The determination mode of the time parameter of present data transmission is the invention is not limited in, as long as the side of the time parameter of present data transmission may finally be determined Formula all should belong to protection scope of the present invention.
Step 202, receives X signal by second interface, determines between the time between the initial time of every two neighboring signal in X signal Every, X-1 time interval is obtained, wherein, X is positive integer, and X > 1.
In an optional embodiment of the present embodiment, it can detect X low level pulse, or detect X to receive X signal Secondary high level pulse.Low level pulse/the high level pulse can adopt square wave, sine wave, triangular wave etc. distinguish the waveform table of low and high level pulse Show, this is not restricted.What is preferably detected is low level pulse, i.e., transmitting terminal can be produced in the case where high level is provided for receiving terminal Low level pulse, adopts in this way, and when transmitting terminal is communicated with receiving terminal, receiving terminal can use the high level that transmitting terminal is provided as power supply, be The power consuming device of receiving terminal provides electric energy, and for example, receiving terminal can utilize the high level that transmitting terminal is provided to be charged, or not set inside receiving terminal Power supply is put, and the high level of transmitting terminal is directly used as power supply, using the equipment of the method, when information exchange is carried out, can use same single line Power supply is completed simultaneously and information is received, reduce equipment volume and manufacturing cost.
In an optional embodiment of the present embodiment, before step 202, also including step 202a, K signal is received, detect K Whether preset relation is met between individual signal, K >=2 and K is integer.A time interval can just be produced due to only having between adjacent two signal, Therefore, two handshake should be at least received, to obtain at least one time interval.Receiving terminal can be by judging whether meet between K signal Preset relation judges whether the K signal is handshake.Receiving terminal receives handshake, and the beginning of data transfer can be judged according to the handshake Position, improves data transmission efficiency.
Alternatively, in step 202a, the time interval between K signal can be detected, judge the very first time interval with the second time interval it Between whether meet preset relation, wherein, the very first time is at intervals of the time between the start time of i-th signal and the start time of the i-th -1 signal Interval, the second time interval is the time interval between the start time of the start time of i-th signal and i+1 signal, i=2,4 ... ..., 2j, J=(K-1)/2, K >=3 and K are odd number;If the very first time is spaced meets preset relation with the second time interval, the step of receiving X signal is performed, Determine that the K signal for receiving is handshake, the signal after K signal is data transfer signal, wherein, the value of K can be advance Predetermined.Further, if very first time interval is unsatisfactory for preset relation with the second time interval, continue between K follow-up signal of detection when Between be spaced, judge that the very first time of K follow-up signal is spaced and whether meet preset relation and the second time interval between and meet default up to detecting K signal of relation, i.e., in the case where handshake is not detected by, receiving terminal persistently detects handshake, until detecting handshake Start receiving data, such that it is able to avoid the situation in the case of the maloperation of transmitting terminal to receiving terminal sending signal, while data can also be judged Start.Further, the preset relation for meeting between very first time interval and the second time interval can be that any transmitting terminal is made an appointment with receiving terminal Relation, such as the second time interval is two times of very first time interval.Receiving terminal by whether the data for receiving meet preset relation can judge to connect Receive whether signal is handshake.For example, when 5 signals are received, including 4 time intervals t0, t1, t2 and t3, wherein, when first Between interval can include t0 and t2, the second time interval can include t1 and t3, and wherein very first time interval is default with what the second time interval met Relation can be:T1=2t0, t3=2t2.The very first time, the second time interval was t2 at intervals of t1,
Further, the K signal for receiving in step 202a can also carry time parameter, then in step 201, can be according to K signal Determine time parameter.It is alternatively possible to first determine very first time interval group and the second time interval group, wherein, very first time interval group is included at least One very first time interval, the second time interval group includes at least one second time intervals, then according to very first time interval group and between the second time Every a group determination time parameter.For example, if 5 handshake of transmitting terminal transmission, very first time interval group includes:T0=etu, t2=etu+pdt, Then receiving terminal can determine the value of time parameter etu and pdt according to t0 and t2.Time parameter is determined by K signal, receiving terminal can be overcome The theoretical time parameter situation inconsistent with parameter actual time, ensures the accuracy of data transfer.
Similar to the signal of transmission data, receiving terminal can confirm to receive K signal in the case where K low level pulse is detected.Or Person, or K high level pulse is detected, confirmation receives K signal.Low level/the high level pulse can adopt square wave, sine The modes such as ripple are realized.It is preferred that providing high level to receiving terminal using low level pulse, i.e. transmitting terminal is detected, when needing to send K signal, produce Raw K low level pulse, so, when transmitting terminal is communicated with receiving terminal, receiving terminal can use the high level that transmitting terminal is provided as power supply, or Power supply is not provided with inside receiving terminal, and the high level of transmitting terminal is directly used as power supply, using the equipment of the method, when information exchange is carried out, Same single line can be used while completing power supply and information reception, equipment volume and manufacturing cost is reduced.
In an optional embodiment of the present embodiment, receiving X signal includes:Z signal is received, the interference in Z signal is removed, Obtain X signal, wherein Z >=X.
Step 203, according to the time parameter of the present data transmission determined in step 201, obtains every continuous S time in X-1 time interval The corresponding numerical value of single time interval in interval, obtains the numerical value of S time interval transmission, and numerical value is 2 that N-bit packet containsNIndividual different numbers One in value, wherein, in the case of S > 1, S time interval is identical, and X and S is positive integer, and S≤X-1, N >=1.I.e. It is in X-1 time interval, in the case of S > 1, identical per S continuous time interval, wherein the corresponding N-bit number of single time interval According to numerical value be the numerical value of S time interval transmission.Such as, 7 signals are received, 6 time intervals are got, wherein 3 continuous Time interval is identical, i.e., transmitting terminal employs the numerical value that multiple identical time intervals illustrate N-bit data, is obtained in 3 time intervals The corresponding N-bit data of single time interval, further obtain the numerical value of 3 time intervals transmission, in the case of S=1, obtain 1 time The numerical value of interval transmission.
As an optional embodiment of the embodiment of the present invention, according to the time parameter of the present data transmission determined in step 201, X-1 is obtained Per the corresponding numerical value of single time interval in continuous S time interval in individual time interval, the numerical value that S time interval is transmitted is obtained, can be adopted Various calculations can be for example adopted being calculated the corresponding numerical value of single time interval:The computational methods numerical value for predefining or consulting Time interval=the etu+m*pdt's of m obtains the corresponding numerical value of time interval, for example receive a time interval, then according to etu and pdt come It is calculated the numerical value of m.For example as m=1, if the every group of data for presetting or consulting are 1 bit, the numerical value is 1, if often Group data are 2 bits, then the numerical value is 01, if every group of data are 3 bits, the numerical value is 001, and every group of data are 4 or above bit When, the mode for obtaining numerical value is identical, will not be described here.
As an optional embodiment of the embodiment of the present invention, according to the time parameter of the present data transmission for determining, X-1 time interval is obtained In per the corresponding numerical value of single time interval in continuous S time interval, obtain the numerical value that S time interval is transmitted, numerical value is N-bit packet 2 for containingNOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical, and X and S is positive integer, and S≤ X-1, N >=1 can be understood as:
According to the time parameter of the present data transmission for determining, single time interval pair in every continuous S time interval in X-1 time interval of acquisition The Bit String answered, obtains the Bit String of S time interval transmission, wherein, the numerical value of S time interval transmission is the corresponding ratio of single time interval Special string, in the case of S > 1, S time interval is identical, and S is positive integer, and S≤X-1.For example work as X=2, during S=1, only have one Individual time interval, obtains the corresponding Bit String of the time interval;When X be 3 or more than, during S=1, with multiple time intervals, obtain each The corresponding Bit String of time interval;Work as X=3, during S=2, with two time intervals, the two time intervals are identical, and the time interval correspondence One Bit String, the two time intervals represent the corresponding Bit String of a time interval;When X is 5 or the above, during S=2, with four Individual time interval, time interval one Bit String of correspondence in the continuous time interval of the first two, in latter two continuous time interval Time interval corresponds to another Bit String, i.e. the first two time interval and represents a Bit String, and latter two time interval represents another Bit String.When So, above citing is simply exemplary, as long as the mode that can obtain the Bit String of S time interval transmission all should belong to protection scope of the present invention.
Step 204, according to the corresponding numerical value of single time interval in the S time interval for getting, obtains the second of X-1 time interval transmission Data bit string;
In an embodiment of the present invention, after the corresponding numerical value of single time interval is obtained, need X-1 time interval corresponding to X signal Comprising the corresponding data of all numerical value combine acquisition the second data bit string waiting for transmission.
Step 205, according to the agreement of first interface support to the second data bit string is encoded, obtains the second data;
Specifically, first interface can be existing general-purpose interface, including wireless and wireline interface, such as USB interface, audio interface, string The interface such as mouth, bluetooth, wifi, NFC, may be coupled to first terminal by the first interface, so as to the second number that will be produced in embodiment itself Send to first terminal according to Bit String.First terminal can be the equipment such as mobile phone, computer, PAD.
Specifically, difference of the first interface according to its interface type, its agreement are different, in order to realize the direct data transfer of different pieces of information agreement, The agreement that first interface can utilize itself to support is encoded to the second data bit string for receiving, and for example, first interface can be according to USB Agreement, audio protocols, serial port protocol, Bluetooth protocol, wifi agreements, NFC protocol etc. are encoded to the second data bit string, are obtained to be sent The second data.Data conversion is carried out by the first interface, it is possible to achieve the data bit string of the generation of the present embodiment is converted to common interface protocol The data that can be supported, realize the conversion between distinct interface, expand the use range of the data transmission method of the present embodiment.
Step 206, sends the second data by first interface.
In an optional embodiment of the present embodiment, step 203 obtain X-1 time interval in first continuous S time interval Before the numerical value of transmission, step 203a can also be included, 2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value and time interval Corresponding relation, wherein, the corresponding time interval of different numerical value is different, N >=1, wherein, precalculate what N-bit packet contained using above-mentioned 2NThe mode of different numerical value and time interval determines the data of the time interval for receiving, and can further reduce the decoding time after receiving data.Make For an optional embodiment of the embodiment of the present invention, 2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value and time interval Corresponding relation, wherein, the corresponding time interval of different numerical value is different, and N >=1 can be understood as:2 are obtained according to time parameterNIndividual length is N's The corresponding relation of each Bit String and time interval in Bit String, wherein, 2NThe individual Bit String is different, and the different Bit Strings are corresponding Time interval is different, N >=1.
In an optional embodiment of the present embodiment, N-bit packet contain 2NIndividual different numerical value, it can be understood as:For example, during N=1, 1 bit data, which includes 21Individual different numerical value, respectively 0,1;During N=2,2 bit datas, which includes 22Individual different numerical value, respectively 00,01,10,11.2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are can be understood as with the corresponding relation of time interval:For example, As N=1,0 corresponding time interval is obtained according to time parameter, obtain 1 corresponding time interval according to time parameter;As N=2, press 00 corresponding time interval is obtained according to time parameter, 01 corresponding time interval is obtained according to time parameter, obtain 10 correspondences according to time parameter Time interval, according to time parameter obtain 11 corresponding time intervals.Certainly, it is when N is other values, identical with above-mentioned understanding mode, This repeats no more.
Alternatively, data transmission device (data receiver of the present embodiment) can be using (such as passing with the data of the present embodiment with the transmitting terminal of data The second terminal that defeated device second interface is connected) pre-set or the computational methods consulting to determine calculate the time interval of the data, as worked as N=n, The computational methods of time interval for sending data m are:Corresponding time interval=etu+m*pdt (wherein, 0≤m≤2 of numerical value mn- 1, etu are One time parameter, pdt are the second time parameter, for example etu=10 μ s, pdt=30 μ s), i.e. 11 corresponding time interval computational methods of numerical value can Think 10 μ s+3*30 μ s=100 μ s, the corresponding time interval of numerical value can be calculated by the optional embodiment.Certainly, the present invention can also be adopted Time interval is determined with other computational methods consulted in advance, this enforcement is not particularly limited to this.Calculated by the advance computational methods consulted The time interval of the data, it is ensured that the extensibility of data transfer, no matter that is, the value of N is how many, transmitting terminal and receiving terminal can be calculated The time interval of data.Afterwards, receiving terminal can be compared with the time interval for receiving according to the time interval for calculating, so as to directly really The corresponding numerical value of the fixed time interval, improves the efficiency for determining data.
Used as another optional embodiment of the embodiment of the present invention, data transmission device (data receiver of the present embodiment) may also be employed and data The transmitting terminal list consulting in advance and store determining the corresponding time interval of the numerical value, when determining that the numerical value is corresponding by the way of list is searched Between be spaced, raising obtains the efficiency of the corresponding time interval of the numerical value.
In an optional embodiment of the present embodiment, X-1=n*S, n >=1 and n are integer, using this optional embodiment, X signal N*S data can be just transmitted, leads to not the problem for decoding without there is unnecessary signal.
In an optional embodiment of the present embodiment, in data transmission procedure, can with replacing construction parameter, i.e., after step 203 or After either step after person's step 203, step 203b can also be included:According to preset rules, currently used time parameter is replaced with new Time parameter, using new time parameter as the time parameter of present data transmission, receives X signal, determines every adjacent two in X signal Time interval between the initial time of individual signal, obtains X-1 time interval, then using the time parameter of present data transmission, obtains X-1 Per the corresponding numerical value of single time interval in continuous S time interval in individual time interval, the numerical value that S time interval is transmitted, S time are obtained The numerical value of interval transmission is the corresponding numerical value of single time interval, and numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, In the case of S > 1, S time interval is identical.In the present embodiment, the determination of new time parameter can pass through transmitting terminal and receiving terminal Negotiation is completed, it is also possible to is searched the time parameter table for prestoring by transmitting terminal and receiving terminal and is completed, such as tables look-up really when certain categorical data is sent Determine the time parameter that the data of the type should be used.The time parameter of transmitting terminal can be change, can match connecing for different pieces of information disposal ability Receiving end, or different types of data are matched, can further improve the efficiency of data processing.
In an optional embodiment of the present embodiment, after step 203 completes to receive last signal, transmitting terminal can also send A End signal (A >=1 and be integer), and receiving terminal can also receive A end signal, end signal can it is identical with handshake, or The signal of other specific formats, by the end signal, receiving terminal can determine whether whether data receive to be terminated.
In an optional embodiment of the present embodiment, after step 203 completes to receive last signal, or complete to receive last After signal, receive A end signal before, receiving terminal can also receiving end/sending end transmission verification data, by the verification data, data transfer Device (data receiver of the present embodiment) can determine whether that whether complete receiving data is correct.Verification data include by MAC verifications, even-odd check, The verification data that verification mode is calculated such as take and verify.
The technical scheme provided by the embodiments of the present invention can be seen that the data transmission method by the present embodiment, and data transmission device can be with root The time interval that waveform is received according to second interface determines the data for receiving waveform, obtains time interval to represent the data message of transmission, the number that will be obtained It is believed that breath is encoded into the data protocol of general-purpose interface, and sent by first interface, such that it is able to realize that the data of distinct device different agreement are led to Letter.The second interface of the data transmission device of the present embodiment only can complete the reception of data using two lines, when being suitable in the electronic device, Ke Yiyou Effect reduces the volume of electronic equipment.
Used as an optional embodiment of the present invention, data transmission device can be used as a switching device, and which can be by first terminal and second eventually The communication at end is transferred, and carries out data conversion by the first interface and second interface, it is possible to achieve send the second terminals such as electronic payment devices The data conversion for coming over is into the data for being adapted to be communicated with the first terminal such as mobile phone.
Below with the second data bit string to be received as 0011100100, N=2, data transmission method provided in an embodiment of the present invention is carried out Simple example explanation:
In step 201, determine the time parameter of present data transmission, optionally, it may be determined that go out two time parameters, very first time parameter etu and Second time parameter pdt, wherein etu=10 μ s, pdt=30 μ s, in embodiments of the present invention, time parameter is the time span that data is activation takes. There is no corresponding relation with N in the number of time parameter, only consensus with transmitting terminal, the present embodiment concrete number not to time parameter It is restricted, as long as the corresponding time interval of the numerical value that data can be given expression to.
In step 202,6 signals are received, determine the time interval between the initial time of every two neighboring signal in 6 signals, obtain 5 Individual time interval etu, etu+3pdt, etu+2pdt, etu+pdt, etu.
In step 203, obtain above-mentioned 5 time intervals and distinguish corresponding 2 bit data, in the present embodiment, can according to data transmission device Computational methods Tm=etu+m*pdt consulted in advance obtain the corresponding numerical value of time interval, the time interval of a 100 μ s of such as receive, then M=3 is obtained, i.e. the numerical value of the time interval transmission is 11.Can also obtain what N-bit packet contained according to time parameter before this step 2NThe corresponding relation of individual different numerical value and time interval.Such as, in N=2,4 different numbers that 2 bit datas are included are obtained according to time parameter The corresponding relation of value and time interval, i.e., 00 corresponding time interval are etu, and 01 corresponding time interval is etu+pdt, between 10 corresponding times Etu+2pdt is divided into, 11 corresponding time intervals are etu+3pdt, i.e., such as receive the time interval of 100 μ s, can directly determine the time interval The numerical value of transmission is 11.It is finally completed the reception of Bit String.
In step 204, according to the corresponding numerical value of single time interval in the S time interval for getting, obtain that X-1 time interval transmit the Two data bit strings are 0011100100.
In step 205, according to the agreement of first interface support to the second data bit string is encoded, the second data are obtained.
In step 206, the second data are sent by first interface.
In the present embodiment, different according to the sending strategy of transmitting terminal, receiving terminal can receive a time interval and represent one group of data, such as only connect The time interval for receiving an etu represents 00, and data transmission bauds is fast, it is also possible to receives multiple identical time interval and represents one group of data, such as The time interval for receiving three etu represents 00, and data transfer degree of accuracy is high, can prevent time interval from losing the erroneous judgement for causing.
Below with the second data bit string to be received as 0011100100, N=1, the simple example explanation of data transmission method in the present invention is carried out:
In step 201, determine the time parameter of present data transmission, optionally, it may be determined that go out two time parameters, very first time parameter etu and Second time parameter pdt, wherein etu=10 μ s, pdt=30 μ s.There is no corresponding relation with N in the number of time parameter, the present embodiment is not right The concrete number of time parameter is restricted, as long as the corresponding time interval of the numerical value that can give expression to data.
In step 202,11 signals are received, determine the time interval between the initial time of every two neighboring signal in 11 signals, obtain 10 time intervals etu, etu, pdt, pdt, pdt, etu, etu, pdt, etu, etu;
Step 203, obtains above-mentioned 10 time intervals and distinguishes corresponding 1 bit data, obtain the numerical value 0 of etu time intervals transmission, obtain etu The numerical value 0 of time interval transmission, obtains the numerical value 1 of pdt time intervals transmission, and the numerical value 1 ... for obtaining the transmission of pdt time intervals obtains etu numbers According to the numerical value 0 of interval transmission, the reception of Bit String is finally completed.
In step 204, according to the corresponding numerical value of single time interval in the S time interval for getting, obtain that X-1 time interval transmit the Two data bit strings are 0011100100.
In step 205, according to the agreement of first interface support to the second data bit string is encoded, the second data are obtained.
In step 206, the second data are sent by first interface.
In the present embodiment, different according to the sending strategy of transmitting terminal, receiving terminal can receive a time interval and represent 1 bit data, such as only The time interval for receiving an etu represents numerical value 0, and data transmission bauds is fast, it is also possible to receives multiple identical time interval and represents 1 bit Data, the time interval for such as receiving three etu represent numerical value 0, and data transfer degree of accuracy is high, can prevent time interval from losing the erroneous judgement for causing.
Below with the second data bit string to be received as 0011100100, N=3, data transmission method provided in an embodiment of the present invention is carried out Simple example explanation:
In step 201, the time parameter of current transmission is determined, optionally, it may be determined that go out two time parameters, very first time parameter etu and second Time parameter pdt, wherein etu=10 μ s, pdt=30 μ s, in embodiments of the present invention, time parameter is the time span that data is activation takes.Time There is no corresponding relation with N in the number of parameter, only consensus with transmitting terminal, the present embodiment is not limited to the concrete number of time parameter System, as long as the corresponding time interval of the numerical value that data can be given expression to.
In step 202,5 signals are received, determine the time interval between the initial time of every two neighboring signal in 5 signals, obtain 4 Individual time interval etu, etu+3pdt, etu+4pdt, etu+4pdt.
In step 203, obtain above-mentioned 4 time intervals and distinguish corresponding 2 bit data, in the present embodiment, can be according to the transmitting terminal with data Computational methods Tm=etu+m*pdt consulted in advance obtain the corresponding numerical value of time interval, the time interval of a 100 μ s of such as receive, then M=3 is obtained, i.e., this group data are 011.2 for can also containing according to time parameter acquisition N-bit packet before this stepNIndividual different numbers The corresponding relation of value and time interval.Such as, in N=3,8 different numerical value and the time interval that 3 bit datas are included is obtained according to time parameter Corresponding relation, i.e., 000 corresponding time interval be etu, 001 corresponding time interval be etu+pdt, 010 corresponding time interval be etu+2pdt, 011 corresponding time interval be etu+3pdt, 100 corresponding time intervals be etu+4pdt, 101 corresponding time intervals be etu+5pdt, 110 Corresponding time interval is etu+6pdt, and 111 corresponding time intervals are etu+7pdt, i.e., such as receive the time interval of 100 μ s, can be direct Determine that the data are 011.The final data bits according to data sending terminal negotiation in advance, deletes zero padding position, completes the reception of Bit String.
In step 204, according to the corresponding numerical value of single time interval in the S time interval for getting, obtain that X-1 time interval transmit the Two data bit strings are 0011100100.
In step 205, according to the agreement of first interface support to the second data bit string is encoded, the second data are obtained.
In step 206, the second data are sent by first interface.
In the present embodiment, different according to the sending strategy of transmitting terminal, receiving terminal can receive a time interval and represent one group of data, such as only connect The time interval for receiving an etu represents 000, and data transmission bauds is fast, it is also possible to receives multiple identical time interval and represents one group of data, The time interval for such as receiving three etu represents 000, and data transfer degree of accuracy is high, can prevent time interval from losing the erroneous judgement for causing.
When N >=4, data transmission method during N=2 or N=3 is can refer to, receiving data will not be described here.
Embodiment 3
A kind of data transmission device is present embodiments provided, the device is one-to-one with the data transmission method in embodiment 1, and here is no longer gone to live in the household of one's in-laws on getting married State, be only briefly described as follows:
In the present embodiment, data transmission device can be a switching device, and the data transmission device has first interface and second interface, and this One interface can be existing general-purpose interface, including wireless and wireline interface, such as USB interface, audio interface, serial ports, bluetooth, wifi, NFC Deng interface, data transmission device may be coupled to first terminal by the first interface, to receive the first data for sending from first terminal, first Terminal can be the equipment such as mobile phone, computer, PAD.The second interface can be that a two line communication interfaces, i.e. second interface utilize both threads come real Existing data transfer and power supply, data transmission device are connected to second terminal by the second interface, and the second terminal can be that electronic payment devices etc. set Standby, the electronic payment devices can realize USBkey functions, OTP functions and intelligent card function etc..
In the present embodiment, when the data transmission device is connected to second terminal by second interface, the data transmission device sends as active and sets Standby to may be considered the data sending terminal of the present embodiment to second terminal transmission data, the i.e. data transmission device, the second terminal may be considered this The data receiver of embodiment.
Fig. 7 is the structural representation of a kind of optional data transmission device of the present embodiment, and the device includes:First interface 301, the first encoding and decoding Unit 302, time parameter determining unit 303, time interval acquiring unit 304, data bit string grouped element 305, second interface 306, its In:
First interface 301, for receiving the first data.Specifically, first data can be first terminal need transmission data, i.e., first Terminal needs to transmit to the data of second terminal, for example, could be for data, or other key messages such as Transaction Information in payment process Or non-critical information.
First codec unit 302, for the agreement supported according to first interface to first decoding data, obtains the first number to be sent According to Bit String.Specifically, difference of the first interface according to its interface type, the data protocol which is supported are also different, and first interface can be using certainly The agreement that body is supported to the first decoding data for receiving, for example, first interface can according to usb protocol, audio protocols, serial port protocol, Bluetooth protocol, wifi agreements, NFC protocol etc. obtain the corresponding data bit string of the first data to the first decoding data, are to be sent the One data bit string.Data conversion is carried out by the first interface, it is possible to achieve the data conversion for sending over terminal is into being adapted in the present embodiment The data transmitted in data transmission method, realize the conversion between distinct interface, expand the use range of the data transmission method of the present embodiment.
Time parameter determining unit 303, for determining the time parameter of present data transmission.
In an optional embodiment of the present embodiment, the time parameter of present data transmission can be to preset and determine in data transmission device, Can also determine from after other devices (such as connected first terminal) acquisition for data transmission device, can also pass through for data transmission device What default mode was determined after being calculated, the determination mode of the time parameter of present data transmission is the invention is not limited in, as long as may finally be true The mode for determining the time parameter of present data transmission all should belong to protection scope of the present invention.
Time interval acquiring unit 304, for according to time parameter obtain N-bit packet contain 2NIndividual different numerical value are corresponding with time interval to close System, wherein, the corresponding time interval of different numerical value is different, N >=1.
Alternatively, the corresponding time interval of same numerical value can be one, or it is multiple, as long as the corresponding time interval of different numerical value is differed , i.e., by being spaced at the same time, a numerical value can be uniquely corresponded to, such recipient can recognize that current time interval is transmitted Numerical value.
As an optional embodiment of the present embodiment, time interval acquiring unit 304 obtain that N-bit packet contains according to time parameter 2N The corresponding relation of individual different numerical value and time interval, wherein, the corresponding time interval of different numerical value is different, and N >=1 is it is also understood that be:
Obtain 2NCorresponding relation of the individual length for each Bit String and time interval in the Bit String of N, wherein, 2NIndividual Bit String is different, and The corresponding time interval of different Bit Strings is different, N >=1.For example as N=1,2 length be 1 Bit String in each Bit String be respectively 0 He 1, as N=2,4 length be 2 Bit String in each Bit String be respectively:00th, 01,10 and 11, as N=3 or the above, reference N=2, will not be described here.
In an optional embodiment of the present embodiment, N-bit packet contain 2NIndividual different numerical value, it can be understood as:For example, during N=1, 1 bit data, which includes 21Individual different numerical value, respectively 0,1;During N=2,2 bit datas, which includes 22Individual different numerical value, respectively 00,01,10,11.2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are can be understood as with the corresponding relation of time interval:For example, As N=1,0 corresponding time interval is obtained according to time parameter, obtain 1 corresponding time interval according to time parameter;As N=2, press 00 corresponding time interval is obtained according to time parameter, 01 corresponding time interval is obtained according to time parameter, obtain 10 correspondences according to time parameter Time interval, according to time parameter obtain 11 corresponding time intervals.Certainly, it is when N is other values, identical with above-mentioned understanding mode, This repeats no more.
In an optional embodiment of the present embodiment, the time interval acquiring unit 304 of data transmission device can be using pre- with data sink The computational methods for first consulting to determine calculate the corresponding time interval of the numerical value, such as N=n, send the calculating side of the corresponding time intervals of numerical value m Method can be:Corresponding time interval=etu+m*pdt (wherein, 0≤m≤2 of numerical value mn- 1, etu are very first time parameter, and pdt was the second time Parameter, for example etu=10 μ s, pdt=30 μ s), i.e., 11 corresponding time interval computational methods of numerical value can be 10 μ s+3*30 μ s=100 μ s, lead to Cross the optional embodiment and can calculate the corresponding time interval of numerical value.Certainly, the present invention can also adopt the computational methods of other negotiations in advance true Fix time interval, the present invention is without limitation.The corresponding time interval of the numerical value is calculated by the advance computational methods consulted, it is ensured that number According to the extensibility of transmission, no matter that is, the value of N is how many, data transmission device and data sink (the i.e. receiving terminal of data, such as with number According to the second terminal that transmitting device is connected) can calculate the corresponding relation of different numerical value and time interval.
Used as another optional embodiment of the embodiment of the present invention, the time interval acquiring unit 304 of data transmission device may also be employed connecing with data The list that receiving apparatus are consulted in advance and stored determines the numerical value corresponding time determining the corresponding time interval of the numerical value by the way of list is searched Interval, can improve the efficiency for obtaining the corresponding time interval of the numerical value.
Used as another optional embodiment of the embodiment of the present invention, the time interval acquiring unit 304 of data transmission device is adopted and is filled with data receiver Put after the computational methods for consulting in advance to determine calculate the corresponding time interval of the numerical value, the time interval acquiring unit 304 of data transmission device is searched The list for prestoring is judging whether the corresponding time interval of the calculated numerical value belongs to the range of receiving of data sink.Using calculating The mode that list is further searched for after the corresponding time interval of numerical value obtains the corresponding time interval of numerical value, can ensure that data sink can be just The autgmentability of data transfer is improved on the premise of often receiving.
Data bit string grouped element 305, data bit string is grouped, and every group of data are N-bit.
In an optional embodiment of the present invention, data bit string grouped element 305 can (such as mobile phone, computer etc. first be whole from other devices End) receive current data bit string to be sent.
In the present embodiment, alternatively, data bit string grouped element 305 can perform the operation for obtaining data bit string and packet with any time, As long as carrying out before second interface 306 carries out data is activation.In addition, data transmission device can be joined by the time before data are sent every time The N-bit packet obtained by number determining units 303, time interval acquiring unit 304 contain 2NIndividual different numerical value are corresponding with time interval to close System's operation, or, data transmission device first can also be operated by time parameter determining unit 303, time interval acquiring unit 304, subsequently Data are sent every time, and all using is carried out operating the N-bit packet of acquisition to contain by time parameter determining unit 303, time interval acquiring unit 304 2NThe corresponding relation of individual different numerical value and time interval, to be encoded to sent data, or, it is also possible to an expiry date is set, Data are sent in the expiry date, equal use time parameter determination unit 303, time interval acquiring unit 304 carry out the N-bit for operating acquisition Packet contain 2NThe corresponding relation of individual different numerical value and time interval, to be encoded to sent data.Or, it is also possible to according to event The mode of triggering, often receives an event triggering, and for example, the time parameter of user input present data transmission calculates a N-bit packet 2 for containingNThe corresponding relation of individual different numerical value and time interval.Concrete the present embodiment is not construed as limiting.
Used as an optional embodiment of the present invention, data bit string is grouped by data bit string grouped element 305, and every group of data are N ratios Spy can be grouped using various ways, can be being grouped by the way of including 1 bit using per group, it would however also be possible to employ per group includes 2 bits Mode is grouped, and when data bit string includes odd number, due to being grouped according to 2 bits completely, data Bit String can be mended It is grouped after 0 again, now, the receiving terminal of data transmission device and data presets or consults the mode of benefit 0, when the high position from data When starting to send data bit string, 0 is mended in the last position of Bit String, when starting to send data bit string from the low level of data, in a high position for Bit String Mend 0.Certainly, per group of situation for including 3 bits and the above is referred to per group of mode for including 2 bits and is grouped, and will not be described here.
Second interface 306, for according to the corresponding relation for obtaining, sending out in the way of the corresponding time interval of the numerical value of every group of data represents this group of data Give this group of data.
In the present embodiment, the numerical value of every group of data can correspond to a time interval, it is also possible to the multiple identical time intervals of correspondence.Using per group The multiple time intervals of numerical value correspondence of data, can accurately judge the corresponding numerical value of the time interval, prevent the drop-out time interval in data transmission procedure Caused mistake.
The second interface of the present embodiment can be used for transmitting the data according to the present embodiment encoding and decoding protocol encoding and decoding, and the second interface can be one two Line communication interface, the i.e. second interface carry out transmission data merely with both threads, additionally, the second interface can also realize data transfer and power supply simultaneously. The second interface of the present embodiment can be attached to the interface of second terminal (equipment such as such as electronic payment devices), by the second interface by data Bit String is sent to electronic payment devices.The electronic payment devices can realize USBkey functions, OTP functions and intelligent card function etc..
Data conversion is carried out by the second interface, it is possible to achieve the data conversion for sending over terminal is into the transmission side data being adapted in the present embodiment The data transmitted in method, then electronic payment devices are transmitted this data to, realize that the data between distinct device turn so as to pass through the data transmission method Change, expand the use range of the data transmission method of the present embodiment.
In an optional embodiment of the present embodiment, for every group of data, when second interface 306 sends this group of data, second interface 306 For producing and send M signal, wherein, the start time of each signal with the time interval of the start time of an adjacent upper signal is The corresponding time interval of this group of data, M >=1 and M are natural number.The time interval produced by the way of signal, is had and is easy to detect and stablizes Property it is high.
Alternatively, second interface 306 for according to time interval produce M low level pulse mode produce M signal, or according to Time interval produces the mode of M high level pulse and produces M signal.Low level pulse/the high level pulse can using square wave, sine wave, Triangular wave etc. can be distinguished the waveform of low and high level pulse and represent that this is not restricted.It is preferred that producing low level pulse using according to time interval, counting When communicating with data sink according to transmitting device, data transmission device can be powered for data sink using high level, by low level arteries and veins The mode transmission information of punching.Using the equipment of the method, when information exchange is carried out, same single line can be used while completing power supply and information transmission, Reduce equipment volume and manufacturing cost.
Certainly, the data transmission device of the present embodiment can also realize the function that the data transmission device in embodiment 4 is realized simultaneously, i.e. this enforcement The data transmission device of example is sent to second terminal by second interface after not only can realizing from after first interface receiving data being processed data Data transmission method, it is also possible to realization processed from after second interface receiving data after sent by first interface to the data transfer of first terminal Method.Different according to the mode of operation of the data transmission device, when which is only operated in simplex pattern, then the data transmission device is with for the moment Quarter only transmits the data from first interface to second interface, or only transmits the data from the second data to first interface;When which can be operated in duplex During communication pattern, the data transmission device can be with simultaneous transmission first interface to data transfer mutual between second interface.Particular content is in embodiment During 4 are described later in detail, only its structure is briefly described herein, no longer goes to live in the household of one's in-laws on getting married and chat, it is specific as follows:
The data transmission device of the present embodiment can also include:
Second interface 306, is additionally operable to, by receiving X signal, determine between the time between the initial time of every two neighboring signal in X signal Every, X-1 time interval is obtained, wherein, X is positive integer, and X > 1;
Data capture unit, for the time parameter according to determination, in X-1 time interval of acquisition in every continuous S time interval between the single time Every corresponding numerical value, the numerical value of S time interval transmission is obtained, the numerical value of S time interval transmission is the corresponding numerical value of single time interval, is counted It is worth 2 contained for N-bit packetNOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical, wherein, X Positive integer is with S, and S≤X-1, N >=1;
Bit String acquiring unit, for according to the corresponding numerical value of single time interval in the S time interval for getting, obtaining X-1 time interval Second data bit string of transmission;
Second codec unit, for the agreement supported according to first interface to the second data bit string is encoded, obtains the second data;
First interface 301, is additionally operable to send the second data.
In an optional embodiment of the present embodiment, data transmission device also includes handshake transmitting element, wherein:Handshake sends single Unit, for producing and sending K handshake, K >=2 and K is integer.Due to there was only between adjacent two signal the time that can just produce Interval, therefore, two handshake should be at least produced and send, to embody at least one time interval.Data transmission device sends letter of shaking hands Number, data sink can judge the starting position of data transfer according to the handshake, improve data transmission efficiency.
Alternatively, preset relation can be met between K handshake.The handshake transmitting element of data transmission device sends and meets preset relation Handshake, according to the preset relation, data sink can accurately judge whether the data for receiving are handshake.
Alternatively, time parameter can be included in handshake, data sink can obtain time parameter according to the K handshake, so as to When data sink receives the signal of transmitting terminal transmission, time interval is obtained, to obtain what transmitting terminal sent by time parameter and time interval Data.Adopt in this way, data sink can according to transmitting terminal using time parameter come obtain represent data time interval, solve number According to the theoretical time parameter and the unmatched problem of parameter actual time of reception device.
Alternatively, it can be that default closing is met between very first time interval and the second time interval that preset relation is met between above-mentioned K handshake System, wherein, the very first time at intervals of the time interval between the start time of i-th handshake and the start time of the i-th -1 handshake, the Two time intervals are the time interval between the start time of the start time of i-th handshake and i+1 handshake, i=2,4 ... ..., 2j, J=(K-1)/2, K >=3 and K are odd number.In this optional embodiment, the preset relation met between very first time interval and the second time interval The relation that can be any data transmission device be made an appointment with data sink, such as the second time interval is two times of very first time interval.Data Transmitting device meets the handshake of preset relation by sending so that data sink can by the data for receiving whether meet preset relation come Judgement receives whether signal is handshake.For example, when producing and send 5 handshake, including 4 time intervals t0, t1, t2 and T3, wherein, very first time interval can include t0 and t2, and the second time interval can include t1 and t3, wherein very first time interval and the second time Being spaced the preset relation for meeting can be:T1=2t0, t3=2t2.The very first time, the second time interval was t2 at intervals of t1,
Alternatively, can also be by the time interval transmission time parameter between above-mentioned K handshake so that data sink can be according to this K handshake gets the time parameter that data transmission device is used, and further confirms that the time parameter that data sink is used.Specifically, Data transmission device can also include handshake time interval determining unit, the unit for according to time parameter determine very first time interval group and/ Or the second time interval group, very first time interval group includes that at least one very first time was spaced, and the second time interval group included at least one second times Interval.
Alternatively:Handshake transmitting element includes for producing K handshake:The unit is for according to very first time interval and between the second time K handshake is produced every the mode for producing K low level pulse.Can also produce K time according to very first time interval and the second time interval The mode of high level pulse produces K handshake, and the low level pulse/high level pulse can adopt square wave, sine wave, triangular wave Deng Ke areas The waveform of low and high level pulse is divided to represent that this is not restricted.It is preferred that handshake is produced in the form of low level pulse is produced according to time interval, When data transmission device is communicated with data sink, data transmission device can be powered for data sink using high level, by low electricity The mode transmission information of flat pulse.Using the equipment of the method, when information exchange is carried out, same single line can be used while completing power supply and information Send, reduce equipment volume and manufacturing cost.
In an optional embodiment of the present embodiment, in the data transmission device of the present embodiment, in order to meet the speed of present data transmission, Time parameter updating block can also be included, for according to preset rules, currently used time parameter being replaced with new time parameter, will be new Time parameter of the time parameter as present data transmission;Triggered time interval acquiring unit 304 updates corresponding relation according to new time parameter;When Between interval acquiring unit 304, be additionally operable to for according to present data transmission time parameter update corresponding relation;Second interface 306, is additionally operable to profit Carried out data transmission with the corresponding relation after renewal.In the present embodiment, the determination of new time parameter can pass through data transmission device and data The negotiation of reception device is completed, it is also possible to is searched the time parameter table for prestoring by data transmission device and data sink and is completed, and is such as being sent out The time parameter that the data of determination the type of tabling look-up when giving certain categorical data should be used.The time parameter of data transmission device can be change, The data sink of different pieces of information disposal ability can be matched, or matches different types of data, can further improve the efficiency of data processing.
In an optional embodiment of the present embodiment, verification data transmitting element can also be included, complete to send last in second interface 306 After group data, verification data transmitting element sends verification data, and by the verification data, data receiver can determine whether whether receiving data is complete just Really.Verification data including but not limited to by MAC verifications, even-odd check, take and verify etc. the verification data that verification mode is calculated.
In an optional embodiment of the present embodiment, end signal transmitting element can also be included, the unit is for completing in transmitting element 304 After sending last group of data, or after verification data transmitting element is sent completely verification data, A (A >=1 and be integer) individual end is sent Signal, end signal can be identical with handshake, it is also possible to which different, by the end signal, data sink can determine whether whether data receive Terminate.
The technical scheme provided by the embodiments of the present invention can be seen that data transmission device and receive conventional data by first interface, and this is general Data are converted to time interval between two signals of utilization of the present invention to represent the data message of transmission, and by this using between two signals when Between interval sent by second interface the data message that represents transmission, i.e., the second interface can be represented according to the time interval for sending waveform and be sent out The data of waveform are sent, such that it is able to realize the data communication of distinct device different agreement.The second interface of the data transmission device of the present embodiment can be only The transmission of data is completed using two lines, when being suitable in the electronic device, the volume of electronic equipment can be effectively reduced.
Embodiment 4
A kind of data transmission device is present embodiments provided, the device is one-to-one with the data transmission method in embodiment 2, and here is no longer gone to live in the household of one's in-laws on getting married State, be only briefly described as follows:
Data transmission device can be a switching device, and the data transmission device has first interface and second interface, and the first interface can be existing Some general-purpose interfaces, including wireless and wireline interface, such as interface such as USB interface, audio interface, serial ports, bluetooth, wifi, NFC, data Transmitting device may be coupled to first terminal by the first interface, and to receive the first data sent from first terminal, first terminal can be handss The equipment such as mechanical, electrical brain, PAD.The second interface can be a two line communication interfaces, i.e. second interface realized using both threads data transfer and Power supply, data transmission device is connected to second terminal by the second interface, and the second terminal can be the equipment such as electronic payment devices, and the electronics is propped up Dispensing apparatus can realize USBkey functions, OTP functions and intelligent card function etc..
In the present embodiment, when the data transmission device is connected to second terminal by second interface, the data transmission device is connect as receiving device The data that second terminal sends are received, i.e. the data transmission device may be considered the data receiver of the present embodiment, and the second terminal may be considered The data sending terminal of the present embodiment.
Fig. 8 is the structural representation of a kind of optional data transmission device of the present embodiment, and the device includes:Time parameter determining unit 401, Two interfaces 402, data capture unit 403, Bit String acquiring unit 404, the second codec unit 405, first interface 406, wherein:
Time parameter determining unit 401, for determining the time parameter of present data transmission;
In an optional embodiment of the present embodiment, the time parameter of present data transmission can be to preset simultaneously in time parameter determining unit 401 It is determined that, or what time parameter determining unit 401 was determined from after data sending device acquisition, or time parameter determining unit 401 Determine after obtaining from other devices, can also be to determine after time parameter determining unit 401 is calculated by default mode, for example, number Handshake can first be received before receiving the data according to transmitting device, the time parameter of present data transmission is determined by handshake, the present invention The determination mode of the time parameter of present data transmission is not limited to, as long as may finally determine that the mode of the time parameter of present data transmission all should Belong to protection scope of the present invention.
Second interface 402, for receiving X signal, determines the time interval between the initial time of every two neighboring signal in X signal, X-1 time interval is obtained, wherein, X is positive integer, and X > 1;
In an optional embodiment of the present embodiment, it can detect X low level pulse that second interface 402 receives X signal, Can detect X high level pulse.Low level pulse/the high level pulse can distinguish height using square wave, sine wave, triangular wave etc. The waveform of level pulse represents that this is not restricted.What is preferably detected is low level pulse, i.e., data sending device can be for data transfer In the case that device provides high level, low level pulse is produced, is adopted in this way, when data sending device is communicated with data transmission device, number The high level that data transmission device is provided can be used as power supply according to dispensing device, the power consuming device for data transmission device provides electric energy, for example, number The high level that data sending device is provided can be utilized to be charged according to transmitting device, or inside data transmission device, be not provided with power supply, and directly be made With the high level of data sending device as power supply, using the equipment of the method, when information exchange is carried out, same single line can be used while completing to supply Electricity and information are received, and reduce equipment volume and manufacturing cost.
In an optional embodiment of the present embodiment, data transmission device also includes handshake receiving unit, and the unit is used to receive K Whether signal, meet preset relation between K signal of detection, K >=2 and K is integer.Can just produce due to only having between adjacent two signal One time interval, therefore, two handshake should be at least received, to obtain at least one time interval.Receiving terminal can be by judging K letter Preset relation whether is met between number and judges whether the K signal is handshake.Receiving terminal receives handshake, can be judged according to the handshake The starting position of data transfer, improves data transmission efficiency.
Further, handshake receiving unit can detect the time interval between K signal, judge very first time interval and the second time interval Between whether meet preset relation, wherein, the very first time at intervals of between the start time of i-th signal and the start time of the i-th -1 signal when Between be spaced, the second time interval is the time interval between the start time of the start time of i-th signal and i+1 signal, i=2,4 ... ..., 2j, J=(K-1)/2, K >=3 and K are odd number;If the very first time is spaced meets preset relation with the second time interval, the step of receiving X signal is performed, Determine that the K signal for receiving is handshake, the signal after K signal is data transfer signal, wherein, the value of K can be advance Predetermined.Further, if very first time interval is unsatisfactory for preset relation with the second time interval, continue between K follow-up signal of detection when Between be spaced, judge that the very first time of K follow-up signal is spaced and whether meet preset relation and the second time interval between and meet default up to detecting K signal of relation, i.e., in the case where handshake is not detected by, receiving terminal persistently detects handshake, until detecting handshake Start receiving data, such that it is able to avoid the situation in the case of the maloperation of transmitting terminal to receiving terminal sending signal, while data can also be judged Start.Further, the preset relation for meeting between very first time interval and the second time interval can be that any transmitting terminal is made an appointment with receiving terminal Relation, such as the second time interval is two times of very first time interval.Receiving terminal by whether the data for receiving meet preset relation can judge to connect Receive whether signal is handshake.For example, when 5 signals are received, including 4 time intervals t0, t1, t2 and t3, wherein, when first Between interval can include t0 and t2, the second time interval can include t1 and t3, and wherein very first time interval is default with what the second time interval met Relation can be:T1=2t0, t3=2t2.The very first time, the second time interval was t2 at intervals of t1,
Further, the K signal that handshake receiving unit is received can also carry time parameter, then the time of the present embodiment data transmission device Parameter determination unit 401, can be determining time parameter according to K signal.Alternatively, time parameter determining unit 401 can be used for first determining Very first time interval group and the second time interval group, wherein, very first time interval group includes that at least one very first time was spaced, the second time interval group Including at least one second time intervals, time parameter is determined according to very first time interval group and the second time interval group then.For example, if data 5 handshake that dispensing device sends, very first time interval group include:T0=etu, t2=etu+pdt, then data transmission device is according to t0 and t2 Can determine the value of time parameter etu and pdt.Time parameter is determined by K signal, the theoretical time parameter of data transmission device can be overcome The situation inconsistent with parameter actual time, ensures the accuracy of data transfer.
It is similar to the signal of transmission data, the handshake receiving unit of data transmission device in the case where K low level pulse is detected, Confirmation receives K signal.Or, or detect K high level pulse, confirmation receives K signal.Low level/the high level Pulse can be being realized using modes such as square wave, sine waves.It is preferred that high level is provided to receiving terminal using low level pulse, i.e. transmitting terminal is detected, When needing to send K signal, K low level pulse is produced, so, when transmitting terminal is communicated with receiving terminal, receiving terminal can be carried using transmitting terminal For high level as power supply, or inside receiving terminal, be not provided with power supply, and directly use the high level of transmitting terminal as power supply, using the method Equipment, when information exchange is carried out, can use same single line while completing power supply and information reception, reduce equipment volume and manufacturing cost.
In an optional embodiment of the present embodiment, also including filter unit, for receiving Z signal, the interference in Z signal is removed, X signal, wherein Z >=X are obtained, the filter unit can be arranged in second interface 402.I.e. second interface 402 is used to receive X signal Including:Second interface 402 is used to receive Z signal, removes the interference in Z signal, obtains X signal, wherein Z >=X.
Data capture unit 403, the time parameter of the present data transmission for being determined according to time parameter determining unit 401, when obtaining X-1 Between be spaced in per the corresponding numerical value of single time interval in continuous S time interval, obtain the numerical value that S time interval is transmitted, numerical value is N-bit Packet contain 2NOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical, and X and S are positive integer, And S≤X-1, N >=1.It is i.e. in X-1 time interval, in the case of S > 1, identical per S continuous time interval, wherein the single time The numerical value for being spaced corresponding N-bit data is the numerical value of the S time interval transmission.Such as, 7 signals are received, is got between 6 times Every, wherein 3 continuous time intervals are identicals, i.e., transmitting terminal employs the numerical value that multiple identical time intervals illustrate N-bit data, The corresponding N-bit data of single time interval in 3 time intervals are obtained, the numerical value of 3 time intervals transmission is further obtained, in the feelings of S=1 Under condition, the numerical value of 1 time interval transmission is obtained.
As an optional embodiment of the embodiment of the present invention, the time parameter of the present data transmission determined according to time parameter determining unit 401, Obtain in X-1 time interval per the corresponding numerical value of single time interval in continuous S time interval, obtain the numerical value that S time interval is transmitted, The corresponding numerical value of single time interval can be calculated using various calculations, for example, can be adopted:The calculating for predefining or consulting Time interval=the etu+m*pdt's of method numerical value m obtains the corresponding numerical value of time interval, for example receive a time interval, then according to etu The numerical value of m is calculated with pdt.For example as m=1, if the every group of data for presetting or consulting are 1 bit, the numerical value is 1, If every group of data are 2 bits, the numerical value is 01, if every group of data are 3 bits, the numerical value is 001, every group of data be 4 or with During upper bit, the mode for obtaining numerical value is identical, will not be described here.
As an optional embodiment of the embodiment of the present invention, according to the time parameter of the present data transmission for determining, X-1 time interval is obtained In per the corresponding numerical value of single time interval in continuous S time interval, obtain the numerical value that S time interval is transmitted, numerical value is N-bit packet 2 for containingNOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical, and X and S is positive integer, and S≤ X-1, N >=1 can be understood as:
According to the time parameter of the present data transmission for determining, single time interval pair in every continuous S time interval in X-1 time interval of acquisition The Bit String answered, obtains the Bit String of S time interval transmission, wherein, the numerical value of S time interval transmission is the corresponding ratio of single time interval Special string, in the case of S > 1, S time interval is identical, and S is positive integer, and S≤X-1.For example work as X=2, during S=1, only have one Individual time interval, obtains the corresponding Bit String of the time interval;When X be 3 or more than, during S=1, with multiple time intervals, obtain each The corresponding Bit String of time interval;Work as X=3, during S=2, with two time intervals, the two time intervals are identical, and the time interval correspondence One Bit String, the two time intervals represent the corresponding Bit String of a time interval;When X is 5 or the above, during S=2, with four Individual time interval, time interval one Bit String of correspondence in the continuous time interval of the first two, in latter two continuous time interval Time interval corresponds to another Bit String, i.e. the first two time interval and represents a Bit String, and latter two time interval represents another Bit String.When So, above citing is simply exemplary, as long as the mode that can obtain the Bit String of S time interval transmission all should belong to protection scope of the present invention.
Bit String acquiring unit 404, for the corresponding numerical value of single time interval in S time interval being got according to data capture unit 403, Obtain the second data bit string of the X-1 time interval transmission.
In an embodiment of the present invention, after the corresponding numerical value of single time interval is obtained, need X-1 time interval corresponding to X signal Comprising the corresponding data of all numerical value combine acquisition the second data bit string waiting for transmission.
Second codec unit 405, for the agreement supported according to first interface 406 to the second data bit string is encoded, obtains the Two data.
Specifically, first interface can be existing general-purpose interface, including wireless and wireline interface, such as USB interface, audio interface, string The interface such as mouth, bluetooth, wifi, NFC, may be coupled to first terminal by the first interface, so as to the second number that will be produced in embodiment itself Send to first terminal according to Bit String.First terminal can be the equipment such as mobile phone, computer, PAD.
Specifically, difference of the first interface according to its interface type, the agreement which is supported are also different, and second interface can utilize the association for itself supporting Discuss the second data bit string to receiving to encode, for example, first interface can be according to usb protocol, audio protocols, serial port protocol, indigo plant Tooth agreement, wifi agreements, NFC protocol etc. are encoded to the second data bit string, obtain the second data to be sent.Entered by the first interface Row data conversion, it is possible to achieve the data bit string of the generation of the present embodiment is converted to the data that common interface protocol can be supported, realizes distinct interface Between conversion, expand the use range of the data transmission method of the present embodiment.
First interface 406, for sending second data.
In an optional embodiment of the present embodiment, also including time interval acquiring unit, for obtaining X-1 in data capture unit 403 In time interval before the numerical value of first continuous S time interval transmission, 2 contained according to time parameter acquisition N-bit packetNIndividual different numbers Value and the corresponding relation of time interval, wherein, the corresponding time interval of different numerical value is different, N >=1, wherein, N ratios are precalculated using above-mentioned Special packet contain 2NThe mode of different numerical value and time interval determines the data of the time interval for receiving, and further can reduce after receiving data The decoding time.As an optional embodiment of the embodiment of the present invention, 2 contained according to time parameter acquisition N-bit packetNIndividual different numbers Value and the corresponding relation of time interval, wherein, the corresponding time interval of different numerical value is different, and N >=1 can be understood as:Obtain according to time parameter 2NCorresponding relation of the individual length for each Bit String and time interval in the Bit String of N, wherein, 2NIndividual Bit String is different, and different bits Corresponding time interval of going here and there is different, N >=1.
In an optional embodiment of the present embodiment, N-bit packet contain 2NIndividual different numerical value, it can be understood as:For example, during N=1, 1 bit data, which includes 21Individual different numerical value, respectively 0,1;During N=2,2 bit datas, which includes 22Individual different numerical value, respectively 00,01,10,11.2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are can be understood as with the corresponding relation of time interval:For example, As N=1,0 corresponding time interval is obtained according to time parameter, obtain 1 corresponding time interval according to time parameter;As N=2, press 00 corresponding time interval is obtained according to time parameter, 01 corresponding time interval is obtained according to time parameter, obtain 10 correspondences according to time parameter Time interval, according to time parameter obtain 11 corresponding time intervals.Certainly, it is when N is other values, identical with above-mentioned understanding mode, This repeats no more.
Alternatively, data transmission device (data receiver of the present embodiment) can using with data sending device (data sending terminal of the present embodiment, The second terminal being for example connected with data transmission device second interface) pre-set or consult determine computational methods calculate the data time between Every, such as work as N=n, the computational methods for sending the time interval of data m are:Corresponding time interval=etu+m*pdt (wherein, the 0≤m of numerical value m ≤2n- 1, etu are very first time parameter, and pdt is the second time parameter, for example etu=10 μ s, pdt=30 μ s), i.e. 11 corresponding time of numerical value Interval calculation method can be 10 μ s+3*30 μ s=100 μ s, can calculate the corresponding time interval of numerical value by the optional embodiment.Certainly, The present invention can also adopt other computational methods consulted in advance to determine time interval, and this enforcement is not particularly limited to this.By the advance meter consulted Calculation method calculates the time interval of the data, it is ensured that the extensibility of data transfer, no matter that is, the value of N is how many, data sending device The time interval of data can be calculated with data transmission device.Afterwards, data sending device can according to the time interval for calculating come with reception To time interval compare, so as to directly determine the corresponding numerical value of the time interval, improve the efficiency for determining data.
As another optional embodiment of the embodiment of the present invention.Data transmission device may also be employed coming with the list that data sending device is prestored Determine the time interval of the data, the time interval of the data is determined by the way of list is searched, the efficiency for obtaining data time interval can be improved.
In an optional embodiment of the present embodiment, X-1=n*S, n >=1 and n are integer, using this optional embodiment, X signal N*S data can be just transmitted, leads to not the problem for decoding without there is unnecessary signal.
In an optional embodiment of the present embodiment, data transmission device also includes time parameter updating block, and the unit can be also used for changing Currently used time parameter, according to preset rules, is replaced with new time parameter by time parameter, is passed new time parameter as current data Defeated time parameter, receives X signal, determines the time interval between the initial time of every two neighboring signal in X signal, obtains X-1 Individual time interval, then using the time parameter of present data transmission, the single time in every continuous S time interval in X-1 time interval of acquisition Corresponding numerical value is spaced, the numerical value of S time interval transmission is obtained, the numerical value of S time interval transmission is the corresponding numerical value of single time interval, Numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the case of S > 1, S time interval is identical.In this reality Apply in scheme, the determination of new time parameter can be completed by the negotiation of data sending device and data transmission device, it is also possible to by data is activation Device and data transmission device are searched the time parameter table for prestoring and are completed, and such as table look-up when certain categorical data is sent and determine that the data of the type should The time parameter for using.The time parameter of data sending device can be change, can match the data transmission device of different pieces of information disposal ability, Or different types of data are matched, can further improve the efficiency of data processing.
In an optional embodiment of the present embodiment, after second interface 402 completes to receive last signal, second interface 402 may be used also To receive A end signal (Z >=1 and as integer), end signal can, or other specific formats identical with handshake signal, By the end signal, data transmission device can determine whether whether data receive to be terminated.
In an optional embodiment of the present embodiment, after second interface 402 completes to receive last signal, or second interface 402 is complete Into after receiving last signal, before receiving A end signal, second interface 402 can also receive verification data, by the verification data, Data transmission device (data receiver of the present embodiment) can determine whether that whether complete receiving data is correct.Verification data include by MAC verification, Even-odd check, take and verify etc. the verification data that verification mode is calculated.
The technical scheme provided by the embodiments of the present invention can be seen that data transmission device and can determine reception according to the time interval for receiving waveform The data of waveform, only can complete the reception of data using two lines, when being suitable in the electronic device, can effectively reduce the volume of electronic equipment.
In flow chart or here any process described otherwise above or method description are construed as, expression includes one or more for reality The module of the code of the executable instruction of the step of existing specific logical function or process, fragment or part, and the model of the preferred embodiment of the present invention Enclose including other realization, wherein order that is shown or discussing can not be pressed, including according to involved function by it is basic simultaneously in the way of or by phase Anti- order, carrys out perform function, and this should be understood by embodiments of the invention person of ordinary skill in the field.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.In the above-described embodiment, it is multiple Software that step or method can be performed in memory and by suitable instruction execution system with storage or firmware are realizing.For example, if using hardware To realize, with another embodiment, can be realized with any one of following technology well known in the art or their combination:With use In the discrete logic of the logic gates that logic function is realized to data signal, the special IC with suitable combinational logic gate circuit, Programmable gate array (PGA), field programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize that all or part of step that above-described embodiment method is carried can be by program The related hardware of instruction is completed, program can be stored in a kind of computer-readable recording medium, the program upon execution, including embodiment of the method One or a combination set of the step of.
Additionally, during each functional unit in each embodiment of the invention can be integrated in a processing module, or the independent physics of unit Exist, it is also possible to which two or more units are integrated in a module.Above-mentioned integrated module both can be realized in the form of hardware, also might be used To be realized in the form of software function module.If integrated module using in the form of software function module is realized and as independent production marketing or is made Used time, it is also possible to be stored in a computer read/write memory medium.
Storage medium mentioned above can be read only memory, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specific example ", or " some examples " Deng description mean that the specific features described with reference to the embodiment or example, structure, material or feature are contained at least one embodiment of the present invention Or in example.In this manual, identical embodiment or example are not necessarily referring to the schematic representation of above-mentioned term.And, the tool of description Body characteristicses, structure, material or feature can be combined in one or more any embodiment or example in an appropriate manner.
Although embodiments of the invention have been shown and described above, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as right The restriction of the present invention, one of ordinary skill in the art within the scope of the invention can be in the case of the principle and objective without departing from the present invention State embodiment be changed, change, replacing and modification.The scope of the present invention is limited by claims and its equivalent.

Claims (10)

1. a kind of data transmission method, it is characterised in that include:
First data are received by first interface;
The agreement supported according to first interface obtains the first data bit string to be sent to first decoding data;
Determine the time parameter of present data transmission;
2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval, wherein, different numerical value pair The time interval answered is different, wherein, N >=1;
The first data bit string is grouped, every group of data are N-bit;
According to the corresponding relation for obtaining, send by way of second interface represents this group of data with the corresponding time interval of the numerical value of every group of data This group of data.
2. method according to claim 1, it is characterised in that for every group of data, send this group of data, including:
M signal is produced and sends, wherein, the start time of each signal with the time interval of the start time of an adjacent upper signal is The corresponding time interval of numerical value of this group of data, M >=1 and M are natural number.
3. method according to claim 2, it is characterised in that M signal of the generation includes:
M low level pulse is produced according to the time interval.
4. a kind of data transmission method, it is characterised in that include:
Determine the time parameter of present data transmission;
X signal is received by second interface, the time interval between the initial time of every two neighboring signal in the X signal is determined, is obtained To X-1 time interval, wherein, X is positive integer, and X > 1;
According to the time parameter for determining, the corresponding number of single time interval in often continuous S time interval is obtained in the X-1 time interval Value, obtains the numerical value of the S time interval transmission, and the numerical value of the S time interval transmission is the corresponding numerical value of the single time interval, The numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the case of S > 1, the S time interval is identical, Wherein, X and S are positive integer, and S≤X-1, N >=1;
According to the corresponding numerical value of single time interval in the S time interval for getting, the second data ratio of the X-1 time interval transmission is obtained Special string;
According to the agreement of first interface support to the second data bit string is encoded, the second data are obtained;
Second data are sent by the first interface.
5. method according to claim 4, it is characterised in that
In the X-1 time interval is obtained before the numerical value of first continuous S time interval transmission, methods described also includes:According to described Time parameter obtains 2 that N-bit packet containsNThe corresponding relation of individual different numerical value and time interval, wherein, the corresponding time interval of different numerical value It is different.
6. a kind of data transmission device, it is characterised in that include:
First interface, for receiving the first data;
First codec unit, for the agreement supported according to first interface to first decoding data, obtains the first data ratio to be sent Special string;
Time parameter determining unit, for determining the time parameter of present data transmission;
Time interval acquiring unit, 2 contained according to time parameter acquisition N-bit packetNThe corresponding relation of individual different numerical value and time interval, Wherein, the corresponding time interval of different numerical value is different, wherein, N >=1;
Data bit string grouped element, for the first data bit string is grouped, every group of data are N-bit;
Second interface, for according to the corresponding relation for obtaining, sending out in the way of the corresponding time interval of the numerical value of every group of data represents this group of data Give this group of data.
7. device according to claim 6, it is characterised in that for every group of data, the second interface is used to send this group of data, wraps Include:
The second interface is used to producing and sending M signal, wherein, the beginning of the start time of each signal and an adjacent upper signal The time interval at moment is the corresponding time interval of numerical value of this group of data, M >=1 and M is natural number.
8. device according to claim 7, it is characterised in that the second interface is used to producing M signal to be included:
The second interface is for according to time interval M low level pulse of generation.
9. a kind of data transmission device, it is characterised in that include:
Time parameter determining unit, for determining the time parameter of present data transmission;
Second interface, for receiving X signal, determines the time interval between the initial time of every two neighboring signal in the X signal, X-1 time interval is obtained, wherein, X is positive integer, and X > 1;
Data capture unit, it is single in every continuous S time interval in the X-1 time interval for according to the time parameter for determining, obtaining The corresponding numerical value of individual time interval, obtains the numerical value of the S time interval transmission, when the numerical value of the S time interval transmission is described single Between be spaced corresponding numerical value, the numerical value is 2 that N-bit packet containsNOne in individual different numerical value, wherein, in the case of S > 1, institute State S time interval identical, wherein, X and S is positive integer, and S≤X-1, N >=1;
Bit String acquiring unit, for according to the corresponding numerical value of single time interval in the S time interval for getting, obtaining the X-1 time Second data bit string of interval transmission;
Second codec unit, for the agreement supported according to first interface to the second data bit string is encoded, obtains the second data;
First interface, for sending second data.
10. device according to claim 9, it is characterised in that also include:
Time interval acquiring unit, for obtaining single in every continuous S time interval in the X-1 time interval in the data capture unit Before the corresponding numerical value of time interval, 2 contained according to time parameter acquisition N-bit packetNIndividual different numerical value are corresponding with time interval to close System, wherein, the corresponding time interval of different numerical value is different.
CN201510605275.2A 2015-09-21 2015-09-21 Data transmission method and device Active CN106549921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510605275.2A CN106549921B (en) 2015-09-21 2015-09-21 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510605275.2A CN106549921B (en) 2015-09-21 2015-09-21 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN106549921A true CN106549921A (en) 2017-03-29
CN106549921B CN106549921B (en) 2021-02-19

Family

ID=58364792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510605275.2A Active CN106549921B (en) 2015-09-21 2015-09-21 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN106549921B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270519A (en) * 2018-01-25 2018-07-10 上海星秒光电科技有限公司 Method for transmitting signals and device
CN110855713A (en) * 2019-11-28 2020-02-28 深圳大学 Cross-protocol communication method and system from WiFi device to ZigBee device
CN115080485A (en) * 2022-06-29 2022-09-20 慕思健康睡眠股份有限公司 Data transmission method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050185720A1 (en) * 2004-02-24 2005-08-25 Kwok Chung Y. Pseudo-synchronous one wire bidirectional bus interface
CN101431390A (en) * 2008-11-19 2009-05-13 北京巨数数字技术开发有限公司 Circuit and method for data serial transmission
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050185720A1 (en) * 2004-02-24 2005-08-25 Kwok Chung Y. Pseudo-synchronous one wire bidirectional bus interface
CN101431390A (en) * 2008-11-19 2009-05-13 北京巨数数字技术开发有限公司 Circuit and method for data serial transmission
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

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270519A (en) * 2018-01-25 2018-07-10 上海星秒光电科技有限公司 Method for transmitting signals and device
CN108270519B (en) * 2018-01-25 2020-09-15 上海星秒光电科技有限公司 Signal transmission method and device
CN110855713A (en) * 2019-11-28 2020-02-28 深圳大学 Cross-protocol communication method and system from WiFi device to ZigBee device
CN110855713B (en) * 2019-11-28 2020-10-30 深圳大学 Cross-protocol communication method and system from WiFi device to ZigBee device
CN115080485A (en) * 2022-06-29 2022-09-20 慕思健康睡眠股份有限公司 Data transmission method, device, equipment and storage medium
CN115080485B (en) * 2022-06-29 2024-02-09 慕思健康睡眠股份有限公司 Data transmission method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106549921B (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN106549748A (en) A kind of data transmission method and data handling equipment
CN106796563A (en) For the system and method for chip to chip communication
CN106549921A (en) Data transmission method and device
CN106255964A (en) Sensor global bus
CN105283862A (en) Camera control interface extension bus
CN101061468A (en) System, method, and apparatus for extended serial peripheral interface
CN107210615A (en) Fast charge method, mobile terminal and adapter
CN107580702A (en) The virtual GPIO of enhancing with multimode modulation
CN107454959A (en) Radix is the N translation method for counting to physical conductors state symbol
CN202495961U (en) Internet of things smart home system based on ZigBee
CN105993007A (en) Multipoint interface shortest pulse width priority resolution
CN106549729A (en) Data transmission method for uplink and device and data receiver method and device
CN106547711A (en) Data transmission method for uplink and device and data receiver method and device
CN106027196B (en) A kind of data transmission method and system
CN103812610B (en) A kind of data communications method, terminal and information safety devices
CN106549728A (en) A kind of data receiver method and device
CN106444560A (en) Intelligent control system of charger
CN106504446B (en) Hearing physical disabilities' bracelet vibrating alert doorbell
CN106227691B (en) A kind of reciprocity bi-directional single-wire serial communication method based between MCU
CN103001901B (en) Integrated circuit high-speed digital interface module based on modified difference pulse code modulation (MDPCM)
CN105389865B (en) Shorten the digital signal method of sending and receiving and mobile terminal of sending time
CN107124248B (en) A kind of communication means, apparatus and system
CN103298167A (en) Mobile data gateway of Internet of things
CN106549890A (en) A kind of data receiver method and device
CN107122325A (en) Data transmission system and method based on novel universal universal serial bus

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