CN107241161B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN107241161B
CN107241161B CN201611051707.0A CN201611051707A CN107241161B CN 107241161 B CN107241161 B CN 107241161B CN 201611051707 A CN201611051707 A CN 201611051707A CN 107241161 B CN107241161 B CN 107241161B
Authority
CN
China
Prior art keywords
waveform
sequence
data
bit
waveform sequence
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611051707.0A
Other languages
Chinese (zh)
Other versions
CN107241161A (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 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 CN201611051707.0A priority Critical patent/CN107241161B/en
Publication of CN107241161A publication Critical patent/CN107241161A/en
Priority to PCT/CN2017/107600 priority patent/WO2018095181A1/en
Application granted granted Critical
Publication of CN107241161B publication Critical patent/CN107241161B/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
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0033Systems modifying transmission characteristics according to link quality, e.g. power backoff arrangements specific to the transmitter

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The invention provides a data transmission method and a device, wherein the method comprises the following steps: acquiring a bit sequence of first data to be transmitted, wherein the bit sequence of the first data to be transmitted at least comprises: the data to be transmitted at least comprises: baud rate parameters of the local support; acquiring a waveform sequence corresponding to bits in a bit sequence according to the bit sequence of the first data to be transmitted; and continuously transmitting a waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate. The invention can improve the success rate of data transmission.

Description

Data transmission method and device
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a data transmission method and apparatus.
Background
With the development and improvement of communication technology, the use of communication in life and work has become quite popular, and at the same time, higher and higher requirements are put on the reliability and transmission efficiency of signal transmission and reception in communication. In the existing communication mode, both communication parties generally adopt the baud rate negotiated in advance to perform data interaction, thereby ensuring correct transmission of data. However, data transmission is performed based on the baud rate negotiated in advance, the communication baud rate parameters adopted by the two communication parties can only be a certain fixed value and cannot be changed according to different communication environments, and when the two communication parties perform data interaction with other terminals, communication failure can be caused due to the possibility of incompatibility with the communication baud rates of the other terminals.
Disclosure of Invention
The present invention is directed to solving the above problems.
The invention mainly aims to provide a data transmission method.
Another object of the present invention is to provide a data transmission apparatus.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
scheme 1, a data transmission method, comprising:
acquiring a bit sequence of first data to be transmitted, wherein the bit sequence of the first data to be transmitted at least comprises: the data to be transmitted at least comprises: baud rate parameters of the local support;
according to a bit sequence of first data to be transmitted, acquiring a waveform sequence corresponding to bits in the bit sequence, wherein the first waveform sequence represents a first data bit, the second waveform sequence or a third waveform sequence represents a second data bit, the first data bit is one of bit 1 and bit 0, the second data bit is the other of bit 1 and bit 0, when at least two continuous bits in the bit sequence are the second data bit, the waveform sequence corresponding to the first bit of the at least two continuous bits is the second waveform sequence, and the waveform sequences corresponding to the second bit and subsequent bits are the third waveform sequence; wherein the characteristics of the waveform sequence include: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts with a high level and appears with a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences, the second waveform sequence continues with the high level within the transmission duration, the third waveform sequence starts with the low level and ends with the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences;
and continuously transmitting a waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate.
Scheme 2, according to the method in scheme 1, according to the baud rate currently used, continuously sending the waveform sequence corresponding to the bits in the bit sequence, including:
and according to the currently used baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence and the characteristics of the waveform sequence so as to transmit the first data to be transmitted.
Scheme 3, the method according to scheme 1 or 2,
before obtaining the bit sequence of the first data to be transmitted, the method further includes:
detecting a level change of a receiving port;
determining N waveform sequences corresponding to continuously transmitted first received data according to the level change and the characteristics of the waveform sequences, wherein N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of the following: the first, second, and third waveform sequences;
determining a bit sequence of the first received data according to the N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters.
Scheme 4, the method according to any one of schemes 1 to 3, further including, after the continuously transmitting, according to the bit sequence of the first data to be transmitted, a waveform sequence corresponding to a bit in the bit sequence, the method further including:
detecting a level change of a receiving port;
determining M waveform sequences corresponding to second received data continuously transmitted by an opposite terminal according to the level change and the characteristics of the waveform sequences, wherein M is a positive integer and is more than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences;
determining a bit sequence of the second received data according to the M waveform sequences corresponding to the continuously transmitted second received data;
analyzing the second received data to obtain the baud rate selected by the opposite terminal from the locally supported baud rate parameters;
acquiring a bit sequence of second data to be transmitted;
and sending a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, wherein the duration of the waveform sequence is inversely proportional to the selected baud rate.
In a scheme 5, according to the method in the scheme 4, a waveform sequence corresponding to the bit sequence of the second data to be transmitted is transmitted according to the selected baud rate, where a duration of the waveform sequence is inversely proportional to the selected baud rate, and the method includes:
and according to the selected baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence of the second data to be transmitted and the characteristics of the waveform sequence so as to transmit the second data to be transmitted.
Scheme 6 the method according to any one of schemes 1 to 5,
the locally supported baud rate parameters at least include: receiving the baud rate of the data and/or sending the baud rate of the data; wherein:
the baud rate of the received data comprises one or more;
the baud rate of the transmission data includes one or more.
Scheme 7, the method of any of schemes 1 to 6, the waveform sequence further characterized by:
the total duration of the low levels appearing in the first waveform sequence in the duration is less than one half of the duration; and/or
And the total time length of the low level appearing in the third waveform sequence in the duration is less than one half of the duration.
Scheme 8 the method according to any one of schemes 1 to 7,
the second preset time is equal to 0, and the third waveform sequence has only one level jump from low level to high level within the duration and is ended by high level;
the first waveform sequence starts with a high level, and only occurs once level jump from the high level to the low level in the duration time, and ends with the low level; alternatively, the first waveform sequence starts at a high level and ends at a high level with only one level transition from the high level to the low level within the duration.
Scheme 9 the method according to any one of schemes 1 to 8,
the bit sequence of the first data to be transmitted and the bit sequence of the second data to be transmitted each include a data frame, and the data frame includes: a data frame header, transmission data and a data frame tail; the data frame header at least comprises 1 bit, and the waveform sequence corresponding to the 1 st bit of the data frame header is the third waveform sequence or the first waveform sequence.
Scheme 10 the method according to any one of schemes 1 to 9,
the bit sequence of the first data to be transmitted and the bit sequence of the second data to be transmitted each include a data frame, and the data frame includes: a data frame header, transmission data and a data frame tail; the data frame header at least comprises M bits, wherein M is a positive integer and is more than or equal to 2;
the waveform sequences corresponding to the first M bits of the data frame header consist of M first waveform sequences; or
The waveform sequences corresponding to the first M bits of the data frame header consist of M third waveform sequences; or
The waveform sequences corresponding to the first M bits of the data frame header comprise at least one first waveform sequence and at least one third waveform sequence.
Scheme 11 the method according to scheme 10,
when the waveform sequences corresponding to the first M bits of the data frame header are composed of M first waveform sequences, the data frame header further includes: at least 1 anti-interference bit after the first M bits of the data frame header, wherein a waveform sequence corresponding to the at least 1 anti-interference bit is the second waveform sequence or the third waveform sequence;
when the waveform sequences corresponding to the first M bits of the data frame header are composed of M third waveform sequences, the data frame header further includes: at least 1 anti-interference bit after the first M bits of the data frame header, wherein a waveform sequence corresponding to the at least 1 anti-interference bit is the second waveform sequence or the first waveform sequence.
Scheme 12 the method according to any one of schemes 9 to 11,
the data frame header comprises 8 bits, and the waveform sequences corresponding to the 8 bits are the third waveform sequence, the second waveform sequence, the third waveform sequence, the second waveform sequence and the third waveform sequence in sequence.
Scheme 13 the method according to any one of schemes 9 to 12,
the data frame tail comprises 2 bits, wherein:
the waveform sequence corresponding to the first bit of the data frame tail is the second waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the second waveform sequence; alternatively, the first and second electrodes may be,
the waveform sequence corresponding to the first bit of the data frame tail is the third waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the second waveform sequence; alternatively, the first and second electrodes may be,
and the waveform sequence corresponding to the first bit of the data frame tail is the first waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the third waveform sequence.
Scheme 14, a data transmission apparatus, comprising:
a first obtaining module, configured to obtain a bit sequence of first data to be transmitted, where the bit sequence of the first data to be transmitted at least includes: the data to be transmitted at least comprises: baud rate parameters of the local support;
a second obtaining module, configured to obtain a waveform sequence corresponding to a bit in a bit sequence according to the bit sequence of first data to be transmitted, where the first waveform sequence represents a first data bit, the second waveform sequence or a third waveform sequence represents a second data bit, the first data bit is one of bit 1 and bit 0, the second data bit is the other of bit 1 and bit 0, and when at least two consecutive bits in the bit sequence are the second data bit, a waveform sequence corresponding to a first bit of the at least two consecutive bits is the second waveform sequence, and waveform sequences corresponding to the second bit and subsequent bits are the third waveform sequence; wherein the characteristics of the waveform sequence include: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts with a high level and appears with a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences, the second waveform sequence continues with the high level within the transmission duration, the third waveform sequence starts with the low level and ends with the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences;
and the first sending module is used for continuously sending the waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate.
Scheme 15, the apparatus of scheme 14, the first transmitting module is configured to continuously transmit the waveform sequence corresponding to the bits in the bit sequence as follows:
and according to the currently used baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence and the characteristics of the waveform sequence so as to transmit the first data to be transmitted.
Scheme 16, the apparatus of scheme 14 or 15, further comprising:
the first detection module is used for detecting the level change of a receiving port before the first acquisition module acquires the bit sequence of the first data to be sent;
a first determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, N waveform sequences corresponding to continuously transmitted first received data, where N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of the following: the first, second, and third waveform sequences;
a second determining module, configured to determine a bit sequence of the first received data according to N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters.
Scheme 17 the apparatus of any one of schemes 14 to 16, further comprising:
a second detecting module, configured to detect a level change of a receiving port after continuously sending a waveform sequence corresponding to a bit in the bit sequence according to the bit sequence of the first data to be sent;
a third determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, M waveform sequences corresponding to second received data that is continuously transmitted by an opposite end, where M is a positive integer and M is greater than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences;
a fourth determining module, configured to determine a bit sequence of the second received data according to M waveform sequences corresponding to the continuously transmitted second received data;
a third obtaining module, configured to analyze the second received data and obtain a baud rate selected by the opposite end from the locally supported baud rate parameters;
a fourth obtaining module, configured to obtain a bit sequence of second data to be sent;
and a second sending module, configured to send a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, where a duration of the waveform sequence is inversely proportional to the selected baud rate.
In scheme 18, according to the apparatus in scheme 17, the second sending module sends the waveform sequence corresponding to the bit sequence of the second data to be sent in the following manner:
and according to the selected baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence of the second data to be transmitted and the characteristics of the waveform sequence so as to transmit the second data to be transmitted.
According to the technical scheme provided by the invention, the local terminal sends the locally supported baud rate parameters to the opposite terminal in the bit sequence of the first data to be sent, so that the local terminal and the opposite terminal can carry out data interaction by adopting various baud rates, the opposite terminal can obtain the baud rate supported by the local terminal only by including the locally supported baud rate parameters in the data to be sent, and then the baud rates supported by the local terminal and the opposite terminal are selected for carrying out data transmission, and the success rate of data transmission is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a frame format of a data frame according to an embodiment of the present invention;
FIG. 3 is a waveform diagram of three first waveform sequences provided by an embodiment of the present invention;
FIG. 4 is a waveform diagram of a second waveform sequence according to an embodiment of the present invention;
fig. 5 is a schematic waveform diagram of three third waveform sequences according to the embodiment of the present invention;
fig. 6 is a schematic diagram of data frame header determination according to an embodiment of the present invention;
fig. 7 is a schematic waveform diagram corresponding to a bit sequence of first data to be transmitted according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a data transmission device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or quantity or location.
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
Example 1
The embodiment provides a data transmission method, in this embodiment, two devices that communicate with each other may be divided into a master device and a slave device, for example, the master device may be a mobile terminal such as a PC and a mobile phone, and a card reader, the slave device may be a USB, an electronic signature device (such as a task force U shield, a farm Key device), and a smart card, after the master device is electrically connected to the slave device, the slave device may get power from the master device, the master device may supply power to the slave device while communicating with the slave device, and in a silent state, a port where the master device is connected to the slave device is kept at a high level, and the master device and the slave device may supply power to the slave device through the high level master device, and both the master device and the slave device may perform data transmission by controlling a level change output from the port, and detect a level change input from the. In the method provided by this embodiment, before the local terminal and the opposite terminal transmit data, or during the process of transmitting data between the local terminal and the opposite terminal, the baud rate parameter supported by the local terminal is notified to the opposite terminal, so that the opposite terminal can perform data transmission by using the baud rate supported by the local terminal, and further the local terminal can communicate with the opposite terminal, thereby improving the success rate of communication between the local terminal and the opposite terminal.
Fig. 1 is a flowchart of a data transmission method provided in this embodiment, and as shown in fig. 1, the method mainly includes the following steps S101 to S103.
Step S101, acquiring a bit sequence of first data to be transmitted;
in this embodiment, in order to enable the opposite end to obtain the baud rate parameter locally supported by the local end, the bit sequence of the first data to be transmitted at least includes data to be transmitted, where the data to be transmitted at least includes: baud rate parameters supported locally.
In an optional implementation of the embodiment of the present invention, the bit sequence of the first data to be transmitted may be a compiled bit string, and the bit string carries the locally supported baud rate parameter.
In an optional implementation of the embodiment of the present invention, the bit sequence of the first data to be transmitted may be a data frame, the frame format of the data frame may adopt the structure shown in fig. 2, and a data frame may sequentially include: frame header (Start of Frame, short for SOF), transport data (Byte)0,Byte1……Byten-1,Byten) The method comprises the steps that (in a data Frame corresponding to a bit sequence of first data to be sent, transmission data comprise baud rate parameters locally supported by a local terminal) and a data Frame tail (End of Frame, EOF for short), wherein a data Frame head SOF is a waveform sequence corresponding to the bit sequence appointed by both communication sides, through the data Frame head, an opposite terminal can identify that a data Frame is started to be received currently, the initial position (or moment) of the data to be transmitted in the received data Frame can be determined, in addition, the data Frame head SOF can also indicate the baud rate of the transmission data of the local terminal, the baud rate of the transmission data of the local terminal can be obtained through analyzing the data Frame head opposite terminal, and the received data are analyzed through the baud rate; the data frame tail EOF is also a waveform sequence agreed by both communication parties, the receiving of the data is finished by the opposite end identification data through the data frame tail, and the data frame can be distinguished from normal data to be transmitted and the waveform sequence corresponding to the data frame head by setting the data frame as the EOF so as to identify the data frame tail EOF.
As an optionIn the embodiment of (1), the first Byte in the transmission data is Byte0Can be used to identify the type of message, e.g. Byte08 bits, as defined below:
Bit7 Bit[6:4] Bit[3:0]
Device_type Rev Packet_type
where Device _ type represents the message initiator Device type, e.g., 1 represents the master Device and 0 represents the slave Device, so that the subsequent analysis tool can distinguish whether a message is sent from the master Device or the slave Device. Rev is default data, Packet _ type represents a message type, for example 0001B represents an ATR message, the ATR message can be a parameter acquisition message, and an opposite end receives the ATR message and also returns a corresponding ATR message and carries corresponding parameters; for example, 0010B represents an ACK response packet, that is, a response packet indicating that data reception is successful, for example, 0011B represents a NAK response packet, that is, a response packet indicating that the device is not ready (or data reception is failed), and for example, in case of data reception error or data packet loss, the opposite end returns a NAK packet to the home end; for example, 0100B indicates a PKT packet, that is, the packet is a normal data packet, so that whether the packet is indication information or normal data can be distinguished by the packet type, and after receiving a packet of a corresponding type, the peer can make a corresponding response. As an optional implementation mode, the last two bytes of the data to be transmitted are Byten-1,BytenCan be used as CRC redundant check bitThe check bits are used to check the bit sequence of the received data frame in order to detect or check whether the received data is erroneous.
In this embodiment, because the locally supported baud rate parameter of the first to-be-transmitted data transmission is used, in a data frame corresponding to the bit sequence of the first to-be-transmitted data, the value of Packet _ type is 0001B, which indicates that the data frame is an ATR message, and the opposite end can obtain the locally supported baud rate parameter of the local end from the data frame according to the indication.
In this embodiment, data is transmitted between the local terminal and the opposite terminal through a waveform sequence, and the baud rate parameter locally supported by the local terminal is used to indicate the baud rate supported by the waveform sequence used for transmitting data when the local terminal transmits data (including receiving and sending data). The waveform sequence in this embodiment will be explained below.
In this embodiment, a first data bit is represented by a first waveform sequence, and a second data bit is represented by a second waveform sequence or a third waveform sequence, where the first data bit is one of bit 1 and bit 0, and the second data bit is the other of bit 1 and bit 0.
In this embodiment, the first waveform sequence, the second waveform sequence, and the third waveform sequence have the following specific characteristics: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts from a high level and appears at a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences, the second waveform sequence continues from the high level within the transmission duration, the third waveform sequence starts from the low level and ends at the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences. In the present embodiment, the durations of the different waveform sequences are the same, that is, one bit is transmitted by T, and compared with the prior art that one bit value needs to be transmitted by different time intervals, the time required for transmitting one bit in the present embodiment is shorter, so that the coding efficiency is higher, and the cost and burden of the local terminal and the opposite terminal are reduced.
In the present embodiment, the total duration of the low level appearing in the first waveform sequence in the transmission duration does not change with the change of the baud rate of the transmission waveform sequence; and/or the total duration of the low levels present in the third waveform sequence during the transmission duration does not vary with the baud rate of the transmitted waveform sequence. For example, the duration of the low level in the first waveform sequence and the third waveform sequence may be preset to be a fixed duration, and since the baud rate of the data frame transmitted by the master device and the slave device may be changed, the duty ratio of the low level to the transmission duration is changed instead of being a fixed ratio. For example, the duration of the low level is fixed to 10ns, and when the master device performs transmission of the waveform sequence at a baud rate of 50Mbs, that is, the transmission duration is 20ns, the duration of the low level occupies 50% of the transmission duration, that is, the power-taking efficiency of the slave device is 50%; when the master device transmits the waveform sequence with the baud rate of 25Mbs, namely the transmission duration is 40ns, the duration of the low level accounts for 25% of the transmission duration, namely the power taking efficiency of the slave device is 75%, therefore, when the duration of the low level is fixed, the total duration of the low level in the transmission duration has no linear relation with the baud rate, namely the total duration does not change along with the change of the baud rate of the transmission waveform sequence, therefore, the baud rate can be selected according to actual conditions, the time for keeping the high level of the interface of the master device and the interface of the slave device is as long as possible, and the power supply efficiency in two-wire communication is further improved.
In an optional implementation of the embodiment of the present invention, in order to further improve the power taking efficiency of the local terminal or the opposite terminal, the first waveform sequence may further have the following features: the total duration of the low level appearing in the first waveform sequence in the duration is less than one half of the duration; and/or, the third waveform sequence may also have the following characteristics: and the total time length of the low level appearing in the third waveform sequence in the duration is less than one half of the duration. That is, in this optional embodiment, in one duration, the total duration occupied by the low level in the first waveform sequence and/or the third waveform sequence is not more than one half of the duration, so that the time for maintaining the high level between the local terminal and the opposite terminal is ensured in the data transmission process, and the local terminal or the opposite terminal can obtain electric energy from the other terminal for a long time, thereby improving the power supply efficiency.
In this embodiment, one falling edge level jump (or rising edge level jump) or multiple falling edge level jumps (or rising edge level jumps) may occur in the first waveform sequence and the third waveform sequence, in this embodiment, since the level of one port between the silent state master device and the silent state slave device continues to be at a high level, the high level of the port is controlled to be at a low level through a hardware switch or software, etc., as a falling edge jump, and then the port is controlled to be at a high level again, a rising edge jump is formed. The first waveform sequence starts with a high level and only occurs once a level jump from the high level to a low level within a transmission duration and ends with the low level; alternatively, the first waveform sequence starts at high and only once during the transmission duration a level transition from high to low occurs and ends at high. Compared with the situation that one waveform sequence comprises multiple falling edge jumps or multiple rising edge jumps, the operation complexity of the control end can be reduced by only one falling edge level jump (or rising edge level jump) in one waveform sequence, one bit can be transmitted without controlling the level of the sending port to jump for multiple times, and the data transmission efficiency is improved.
An exemplary explanation is given below of the 3 kinds of waveform sequences in the present embodiment. Fig. 3 shows a schematic representation of three first waveform sequences, fig. 4 shows a schematic representation of a second waveform sequence, and fig. 5 shows a schematic representation of several third waveform sequences. As shown in fig. 3, the first waveform sequence starts with a high level and jumps to a low level after a period of time, and the total duration of the low level appearing in the first waveform sequence in the transmission duration does not change with the baud rate of the waveform sequence. For example, as shown in fig. 3(a), the first waveform sequence has a transmission duration of 40ns, a high level duration of 10ns, and 1/4 which is the duration of the first waveform sequence. In practical application, the master device and the slave device are always in a connected state, the master device outputs a high level in a default state to continuously supply power to the slave device, when the master device needs to send data, a low level is generated through an on-off switch of the master device, different waveform sequences are formed through the high level and the low level to transmit corresponding bit data, and when the master device outputs the low level, the master device cannot supply power to the slave device. Therefore, in order to power the slave device as efficiently as possible, it is preferable that the low levels appearing in the first waveform sequence occupy less than one-half of the transmission duration in total; thus, the longer the occurrence time of the high level in the transmitted data, the higher the power supply efficiency. As shown in fig. 3(b), the duration of the first waveform sequence is 40ns, the duration of the high level is 30ns, which is 3/4 of the transmission duration of the first waveform sequence, so that the power efficiency of the data transmission of the first waveform sequence is relatively high. Therefore, the first waveform sequence in fig. 3(b) has higher power supply efficiency than that in fig. 3 (a). Further, the waveform of the first waveform sequence may also end at a high level as shown in fig. 3 (c). The second waveform sequence shown in fig. 4 is always high for the duration, which in turn improves the power supply efficiency. The third waveform sequence starts at a low level and ends at a high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change with the change of the baud rate of the waveform sequence. For example, as shown in fig. 5(a), when the baud rate is 50Mbps, the transmission duration of the third waveform sequence is 20ns, and assuming that the duration of the low level is fixed to 10ns, the duration of the low level accounts for 1/2 of the transmission duration of the third waveform sequence, and the power extraction efficiency of the slave device at this time is 50%. For another example, as shown in fig. 5(b), when the baud rate is 25Mbps, the transmission duration of the third waveform sequence is 40ns, and if the duration of the low level is still fixed to 10ns, the duration of the low level accounts for 1/4 of the transmission duration of the third waveform sequence, at this time, the power taking efficiency of the slave device is 75%, and when the duration of the low level is fixed, the transmission duration becomes longer as the baud rate decreases, and the power taking efficiency improves, so that it can be seen that the total duration of the low level in the transmission duration does not change with the change of the baud rate of the waveform sequence, so as to improve the power taking efficiency. Therefore, the power supply efficiency of the third waveform serial transmission data in fig. 5(b) is higher than that in fig. 5 (a). In addition, the total duration of the low levels appearing in the third waveform sequence in fig. 5(b) in the transmission duration may be less than one-half of the transmission duration, which may further improve the power supply efficiency.
In this embodiment, the duration of the first waveform sequence, the second waveform sequence, and the third waveform sequence is determined by the baud rate currently used by the local terminal, and therefore, in this embodiment, the duration of the waveform sequence that can be analyzed by the local terminal and the duration that can be used by the waveform sequence sent by the local terminal can be determined according to the baud rate parameters locally supported.
In an optional implementation of the embodiment of the present invention, the locally supported baud rate parameters at least include: receiving the baud rate of the data and/or sending the baud rate of the data; wherein the baud rate of the received data comprises one or more; the baud rate of the transmission data includes one or more. The baud rate of the received data is used for indicating the baud rate of the waveform sequence of the received data which can be analyzed by the local terminal, the baud rate of the transmitted data is used for indicating the baud rate which can be used by the waveform sequence transmitted by the local terminal, and the opposite terminal can analyze the waveform sequence transmitted by the local terminal according to the baud rate of the transmitted data of the local terminal. In this embodiment, the baud rate of the received data and the baud rate of the transmitted data may both include a plurality of baud rates, and after the opposite end receives the baud rate, the baud rates suitable for the local end and the opposite end at the same time may be selected according to the baud rate parameter supported by the local end, so as to implement baud rate adaptation.
In this embodiment, the local end may actively send the locally supported baud rate parameter to the opposite end, or may send the locally supported baud rate parameter to the opposite end after receiving a request from the opposite end. Therefore, in an optional implementation manner of this embodiment, before step S101, the method may further include: detecting a level change of a receiving port; determining N waveform sequences corresponding to first received data which are continuously transmitted according to the level change and the characteristics of the waveform sequences, wherein N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of the following: the first, second, and third waveform sequences; determining a bit sequence of the first received data according to the N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters. Through the optional implementation manner, the local terminal may obtain the first data to be transmitted after receiving the indication information for indicating the acquisition of the baud rate parameter, which is sent by the opposite terminal.
In the above optional embodiment, the local end may know the baud rate used by the opposite end for transmitting the waveform sequence corresponding to the bit sequence of the first received data, for example, the opposite end transmits using a predetermined baud rate, and in this case, the local end may determine, according to the baud rate used by the opposite end and the detected level change, N waveform sequences corresponding to the first received data that is continuously transmitted.
In the foregoing optional implementation manner, optionally, the local end may not know in advance the baud rate used by the waveform sequence corresponding to the bit sequence of the first received data sent by the opposite end, and in this case, the local end may parse the duration of the waveform sequence corresponding to the bit sequence of the first received data from the data frame header of the bit sequence of the first received data according to the waveform sequence included in the preset data frame header and the detected level change, so as to obtain the baud rate used by the waveform sequence corresponding to the bit sequence of the first received data sent by the opposite end, and then parse the transmission data portion of the data frame according to the obtained baud rate, so as to obtain the first transmission data.
In an optional implementation of the embodiment of the present invention, a data frame header of a data frame transmitted between a home terminal and an opposite terminal includes at least 1 bit, a waveform sequence corresponding to the 1 st bit of the data frame header is the third waveform sequence or the first waveform sequence, and the home terminal and the opposite terminal negotiate to use the first waveform sequence or the third waveform sequence as the data frame header, so that when a detected level change of a receiving port forms the waveform sequence corresponding to the data frame header, it may be determined that a currently received waveform sequence is the data frame header, and a waveform sequence immediately after the data frame header is an initial position of the waveform sequence for transmitting data. In this embodiment, when both communication parties perform data transmission at a baud rate negotiated in advance, the data frame header can be identified by the waveform sequence.
In another optional implementation of the embodiment of the present invention, a data frame header of a data frame transmitted between the local end and the opposite end may include at least M bits, and a waveform sequence corresponding to the first M bits of the data frame header is composed of M first waveform sequences; or the waveform sequences corresponding to the first M bits of the data frame header consist of M third waveform sequences, wherein M is a positive integer and is more than or equal to 2; or the waveform sequences corresponding to the first M bits of the data frame header consist of at least one first waveform sequence and at least one third waveform sequence. Compared with the former optional implementation mode, the optional implementation mode can also determine the preset duration of a waveform sequence through the waveform sequences corresponding to the first M bits of the data frame header, namely determine the baud rate of data sent by a sending party, and can utilize the baud rate to receive and send the data, so as to realize baud rate self-adaptation.
Further, when the waveform sequences corresponding to the first several bits of the data frame header of the data frame transmitted between the local end and the peer end are the same continuous waveform sequences, in order to avoid single frequency interference, at least 1 waveform sequence different from the same continuous waveform sequence may be agreed after the same continuous waveform sequence (as long as after, for example, immediately after the same continuous waveform sequence, or after every several waveform sequences), that is, the waveform sequence corresponding to the anti-interference bits, for example, when the waveform sequences corresponding to the first M bits of the data frame header are composed of M first waveform sequences, the data frame header further includes: at least 1 interference rejection bit after the first M bits of the data frame header, where the at least 1 interference rejection bit is a second waveform sequence or a third waveform sequence, for example, the waveform sequence corresponding to the data frame header may be xxxxyyyz, where X is the first waveform sequence, Y is the second waveform sequence, and Z is the third waveform sequence; or, when the waveform sequences corresponding to the first M bits of the data frame header are formed by M third waveform sequences, the data frame header further includes: at least 1 interference-free bit after the first M bits of the data header, where a waveform sequence corresponding to at least one bit of the at least 1 interference-free bit is a first waveform sequence or a second waveform sequence, for example, the waveform sequence corresponding to the data header may be zzzzxyz. By adopting the data frame head structure, single-frequency interference can be prevented, the single-frequency interference can be understood as a pulse sequence generated in the same period, therefore, if the data frame head is composed of a plurality of continuous same waveform sequences, for example, 4 continuous Z, and the frequency of the single-frequency interference is exactly the same as the baud rate, namely, the local terminal identifies the waveform sequence the same as the data frame head through level change, at the moment, the local terminal can identify the single-frequency interference as the data frame head and generate the condition of error identification, and different waveform sequences which are generated after a plurality of continuous same waveform sequences in the data frame head in the third implementation mode can enable the data frame head to have different time intervals, namely, the waveform sequence the same as the single-frequency interference can not be generated, so that the single-frequency interference can be prevented through the data frame head in the implementation mode.
In this embodiment, the preset duration of one waveform sequence may be obtained by analyzing the header of the data frame mentioned in the above several embodiments, and the preset duration is used as the transmission duration of each waveform sequence, and the transmission data and the data frame in the received data are determined as the corresponding waveform sequence according to the level change and the characteristics of the waveform sequence.
Specific implementation ways of how to detect the level change of the receiving port and determine the N waveform sequences according to the level change are given below, and the present embodiment includes, but is not limited to, the following cases:
in an alternative embodiment, detecting a level change at the receive port comprises: continuously detecting S level jumps of a receiving port; and after S level jumps of the receiving port are detected, continuously detecting Q level jumps of the receiving port, wherein the S level jumps and the Q level jumps are changed from high level to low level, S, Q is a positive integer, and S >1 and Q > 1. Determining N waveform sequences for continuous transmission according to the level change and the characteristics of the waveform sequences, wherein the N waveform sequences comprise: acquiring L waveform sequences formed by S level jumps preset by a data frame header, wherein L is a positive integer and is more than 1 and less than L and less than N; calculating the duration of one waveform sequence according to the characteristics of the L waveform sequences and the time interval between any two detected S level jumps; and determining the transmission data and the waveform sequence corresponding to the data frame tail according to the Q level jumps and the characteristics of the waveform sequence by taking the duration obtained by the calculation as the duration of each waveform sequence. In this embodiment, the data sender and the data receiver pre-agree that the data frame header is a waveform sequence of L bits, the waveform sequence of L bits corresponds to S level jumps, the data receiver may default the detected S level jumps to S jumps corresponding to the data frame header in the process of continuously detecting the level change of the receiving port, and the detected level change (i.e., the detected Q jumps) after S jumps is used to determine the waveform sequence corresponding to the transmission data in the data frame and the data frame tail. Of course, when necessary, it may also be determined whether L waveform sequences formed according to the detected S level jumps correspond to L bit waveform sequences of a preset data frame header, so as to determine whether the S level jumps are data frame headers. After the data receiving party receives the data frame head according to the method, the duration time T of a waveform is determined according to the data frame head, and then whether level jump occurs in each time length T and the characteristics of each level jump are determined, so that waveform sequences corresponding to Q level jumps are determined, and the whole N waveform sequences are determined.
Specifically, it can be determined according to the foregoing description of the format in the data to be transmitted that, when the local terminal receives first received data sent by the opposite terminal, the local terminal receives a data frame header of several bits first and then receives subsequent transmission data and data frame tail information, where the data frame header carries some parameter information, for example, the local terminal and the opposite terminal agree in advance that L waveform sequences are used as the data frame header, and therefore, the local terminal can obtain the characteristics of the L waveform sequences from the opposite terminal or obtain the characteristics of the waveform sequences in the data frame header from its own memory, that is, the characteristics of the waveform sequences in the data frame header are known to the local terminal. As can be seen from the characteristics of the waveform sequences in the foregoing, the first waveform sequence X starts at a high level, and undergoes one level transition within the duration of the waveform with a transition time T1(T1 is from the time of the start of each waveform to the time of the transition, T1> 0); the second waveform sequence is a sustained high level that does not undergo a level jump for the duration of the waveform; the third waveform sequence starts at a low level, and since the default states of the local terminal and the opposite terminal are high levels, the third waveform sequence can be considered to undergo one level jump at the beginning of the waveform (which can be considered to be 0 time). For example, as shown in (a) of fig. 6, when the L waveform sequences of the pre-agreed data frame header are a 4-bit sequence "XZZZ", it may be considered that the data frame header needs to undergo 4 level jumps of falling edge (both X and Z have one falling edge jump), and when 4 falling edge jumps are detected in (a) of fig. 6, it is considered that the data frame header is completely received. Namely, the data frame header is corresponding to the 4 hops.
Then, the information such as the duration carried in the header of the data frame needs to be calculated according to the detected characteristics of the S hops and the L waveform sequences. Still to explain in detail by the foregoing example, as shown in (b) in fig. 6, the two parties have agreed that the data frame header format of L bits is a 4-bit sequence "XZZZ", and if no error occurs in data transmission, S hops received by the local end should be 4 falling edge hops. The 1 st waveform sequence in the header data of the known data frame at the end is a first waveform sequence X, and the transition time of the first waveform sequence X is T1 ═ a × T, where a is a preset high-level duty factor, the 2 nd waveform sequence is a third waveform sequence Z, and the third waveform sequence Z starts at a low level and transitions to a high level after a fixed duration (T2). The local terminal may detect a time interval τ between the 1 st level transition and the 2 nd level transition (a level transition refers to only a level transition from a high level to a low level) at the receiving port, and the time interval τ detected by the local terminal and the duration T should satisfy τ ═ T1, that is, τ ═ a ═ T. Therefore, the local terminal can calculate the duration time T of a waveform sequence according to the waveform characteristics of the data frame header sequence and the time interval (namely tau) between any two level jumps in the L level jumps, so that the local terminal can determine the baud rate (namely 1/T) adopted by the data sent by the opposite terminal through the data frame header data. When the first waveform sequence X ends at a high level and the third waveform sequence Z ends at a high level in fig. 6 (a) and 6 (b). The same is also obtained if the first waveform sequence ends with a low level, which is not described again here.
Since the end position of the header of the data frame is the start position of the transmission data, the transmission data can be analyzed from the end position of the header of the data frame after the duration T of each waveform is determined. When the local terminal determines the waveform type according to the level jump of the detection level from high level to low level, according to the previously known waveform characteristics, in each segment of duration T, when the falling edge level jump is detected to occur and the jump time is T1, the waveform is determined to be a first waveform sequence X; when detecting that a falling edge level jump occurs at the beginning of the duration of a certain waveform sequence, judging that the certain waveform sequence is a third waveform sequence Z; when it is detected that a model sequence does not generate a falling edge level jump within the duration of the waveform, it can be determined as a second waveform sequence Y. As can be seen from the analysis result, the data after the data header "XZZZ" is the determined transmission data and data frame end, and as can be seen from the analysis result, the waveform sequence after the data header "XZZZ" is "xyxxyzyy" in order as shown in fig. 6 (c), and once "YY" appears, it is considered as the data frame end, and it is seen that the real transmission data is "xyxxyzx", and if X represents 1 and Y or Z represents 0, the transmission data is finally analyzed as "10110001", as shown in fig. 6 (d).
Therefore, after the duration of each waveform sequence is determined, the waveform sequences corresponding to the transmission data represented by Q level jumps and the data frame end can be determined by using the method, and the L waveform sequences of the data frame head have been determined in the foregoing, so that the N continuous waveform sequences with varying levels can be determined, and the transmission data can be finally analyzed.
When determining the level change in this embodiment, a complete rule of the level change may be obtained by sampling, so as to obtain S level jumps, or only a circuit for monitoring the level change may be provided to monitor the level jumps, that is, as long as S jumps corresponding to the data frame header can be obtained, which is not limited by the present invention. If S level jumps are obtained by using a sampling mode, not only the characteristics of level jumps but also the waveform corresponding to complete level changes can be obtained, so that the characteristics of various waveform sequences do not need to be considered, the method can be applied to any type of waveform sequences, and the waveform sequences can be successfully analyzed. If the mode of monitoring the level jump is utilized, the level does not need to be sampled, the long-time sampling is avoided to restore the whole waveform, the N waveform sequences can be determined only according to the characteristics of the level jump, and the complexity of analysis is reduced.
In this embodiment, the sampling may use a sampling circuit to implement level detection of the receiving port, and a matching sampling frequency may be adopted according to different targets to be sampled.
In this embodiment, the level jump monitoring may be implemented by using a comparator, a differential amplifier, and other devices, and of course, any software and hardware capable of implementing the level jump monitoring is within the protection scope of the present invention.
As an optional implementation manner, in this embodiment, the local end and the peer end may agree in advance to transmit a waveform sequence corresponding to a data frame end of a data frame of data. Optionally, the data frame end may include 2 bits, and the corresponding waveform sequence includes one of the following 3 ways: the waveform sequence corresponding to the first bit of the data frame tail is a second waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is a second waveform sequence; or the waveform sequence corresponding to the first bit of the data frame tail is a third waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is a second waveform sequence; or the waveform sequence corresponding to the first bit of the data frame tail is the first waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the third waveform sequence. In this embodiment, when the waveform sequence determined according to the level variation and the characteristics of the waveform sequence is the waveform sequence corresponding to the preset data frame end, it indicates that the data reception is finished. In this embodiment, the waveform sequences corresponding to the data frame header and the data frame trailer are predetermined by the communication protocol, generally, it is predetermined that the same waveform sequence does not occur in the data frame header and the data frame trailer, so that the data frame header and the data frame trailer are more easily identified and distinguished, if the waveform sequence in the predetermined data frame header includes 2 waveform sequences in the data frame trailer, the data frame header and the data frame trailer can be distinguished by some strategies, for example, the data frame header can be determined to be 8 bits, i.e., composed of 8 waveform sequences, and the data frame trailer is composed of 2 waveform sequences, which are used as the difference between the two, since the level of the silent state receiving port is always high level, when the receiving port detects the first falling edge jump, the data frame header starts to be received, the waveform sequences corresponding to the 8 predetermined data frame headers are continuously detected, the data frame header is received and the data frame header can be distinguished in short, so the present embodiment does not specifically limit the waveform sequences corresponding to the data frame header and the data frame trailer.
Step S102, according to the bit sequence of the first data to be transmitted, acquiring a waveform sequence corresponding to the bit in the bit sequence.
In this embodiment, the home terminal and the opposite terminal performing data transmission may negotiate in advance a waveform sequence type used for representing bit 1 and bit 0, or the home terminal and the opposite terminal preset and store a waveform sequence type used for representing bit 1 and bit 0 before shipping from a factory, for example, the first waveform sequence represents bit 1, and the second waveform sequence and the third waveform sequence can both represent bit 0, at this time, for the data home terminal, when data bit 1 needs to be sent out, the home terminal generates the first waveform sequence, and when data bit 0 needs to be sent out, the home terminal generates the second waveform sequence or the third waveform sequence as needed; similarly, when the first waveform sequence represents bit 0, both the second waveform sequence and the third waveform sequence can represent bit 1, and for the local terminal, when the outgoing data bit 1 is needed, the local terminal generates the second waveform sequence or the third waveform sequence as required, and when the outgoing data bit 0 is needed, the local terminal generates the first waveform sequence; the bit 0 and the bit 1 are represented by different waveform sequences, so that normal data receiving and sending of two communication parties can be realized, and the correctness of data interaction is ensured;
in this embodiment, the first waveform sequence, the second waveform sequence, and the third waveform sequence are respectively three pulse waves with different waveforms, and the durations of the single pulses of the three waveforms of the first waveform sequence, the second waveform sequence, and the third waveform sequence are the same, that is, the durations of the single pulses of the three waveform sequences from the start of the pulse to the end of the pulse are the same; the duration of a single pulse of the three waveform sequences from the start of the pulse to the end of the pulse is T.
In this embodiment, the waveform of the first waveform sequence may have various forms, and the waveform pulses starting with a high level lasting for a first preset time and appearing at a low level within a single pulse duration can be used as the first waveform sequence in this embodiment; the second waveform sequence lasts high for the duration, i.e. the second waveform sequence remains high for a single pulse duration; the waveform of the third waveform sequence may also have various forms, and waveform pulses starting at a high level lasting for a second preset time and appearing at a low level within a single pulse duration can be used as the third waveform sequence in the present embodiment; the first preset time and the second preset time are different in duration, the first preset time and the second preset time can be stored in a communication terminal in advance, and can also be generated by negotiation of two communication parties in a communication process, and the duration of the first preset time is different from that of the second preset time so as to ensure that the two communication parties can normally identify a first waveform sequence and a second waveform sequence; in addition, since the first waveform sequence and the third waveform sequence both contain high level, the second waveform sequence is a high level signal, and the high level can supply power to the communication slave device, so that the power-taking operation of the communication terminal in the data communication process is realized.
In step S102, the local end obtains and analyzes the first data to be transmitted, and obtains a waveform sequence corresponding to the bit sequence of the first data to be transmitted according to the corresponding relationship between bit 1 and bit 0 in the first data to be transmitted and the first waveform sequence, the second waveform sequence, and the third waveform sequence. When at least two consecutive bits in the bit sequence are the second data bits, a waveform sequence corresponding to a first bit in the at least two consecutive bits is the second waveform sequence, and waveform sequences corresponding to a second bit and subsequent bits are the third waveform sequence; that is, when there are a (a ≧ 2) consecutive second data bits in the bit sequence of the first data to be transmitted, only the first second data bit is represented by the second waveform sequence, and the following a-1 second data bits are all represented by the third waveform sequence, thereby avoiding the situation that when the second data bits need to be transmitted continuously, the local terminal continuously outputs the second waveform sequence, that is, the local terminal continuously outputs a high-level signal, so that the opposite terminal cannot distinguish whether the received second data bits or the continuous high-level signal during no data transmission.
Step S103, according to the currently used baud rate, continuously sending a waveform sequence corresponding to the bits in the bit sequence, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate.
In this embodiment, the baud rate currently used by the local end may be a baud rate that is default by the local end, or, when the local end receives indication information that is sent by the opposite end and used for indicating to obtain the baud rate parameter, the baud rate currently used by the local end may be the baud rate that is sent by the opposite end and used for indicating to obtain the indication information of the baud rate parameter, so that it can be ensured that the baud rate currently used by the local end is the baud rate supported by the opposite end, and it is convenient for the opposite end to analyze data sent by the local end.
In an optional implementation manner of this embodiment, when step S103 is executed to transmit the waveform sequence corresponding to the bit in the bit sequence of the first data to be transmitted, the local end controls, according to the baud rate currently used, the level of the transmission port to change according to the waveform sequence corresponding to the bit in the bit sequence of the first data to be transmitted and the characteristics of the waveform sequence, so as to transmit the first data to be transmitted. For example, the communication protocol promises: in this embodiment, the waveform sequence corresponding to each bit in the bit sequence of the first data to be transmitted is determined, for example, the local terminal generates a high level and a low level by controlling the transmission port, that is, the port is controlled to change from the high level to the low level as a transition of a falling edge by a hardware switch or software, and then the port is controlled to return to the high level to form a transition of a rising edge. The waveform sequence is obtained by the variation of high and low levels generated by the transmitting port, so that the waveform sequence corresponding to each bit can be generated, and further the waveform sequence corresponding to one data frame is formed. For example, if the bit sequence of the first data to be transmitted is 11001000, then according to the convention of the communication protocol, the 8 waveform sequences corresponding to the bit sequence of the first data to be transmitted are XXYZXYZZ in sequence, where X is the first waveform sequence, Y is the second waveform sequence, and Z is the third waveform sequence, and according to the characteristics of the above waveform sequences of the respective waveform sequences, that is, the transmission durations of the first waveform sequence, the second waveform sequence, and the third waveform sequence are the same and inversely proportional to the currently used baud rate, such as T, the duration of the high level of the first waveform sequence is T1, and the fixed durations of the low levels in the first waveform sequence and the third waveform sequence are T2, then the 8 waveform sequences corresponding to the bit sequence of the first data to be transmitted of 11001000 can be as shown in fig. 7. When each bit of the bit sequence of the first data to be transmitted is transmitted, the level of the transmitting port is controlled to jump at the corresponding moment so as to form a waveform sequence corresponding to the bit, further form a waveform sequence corresponding to the bit sequence of a data frame, and transmit the bit sequence of the first data to be transmitted.
In an optional implementation of the embodiment of the present invention, after the step S103 is executed, the opposite end receives the locally supported baud rate parameter sent by the home end, and then the opposite end may select a baud rate for subsequent communication with the home end according to the locally supported baud rate parameter of the home end. Optionally, the opposite end may select the maximum baud rate supported by the home end according to the locally supported baud rate parameter, and return the selected baud rate to the home end, so that the transmission rate may be increased. In a specific application, when the opposite terminal sends the selected baud rate, the selected baud rate can be adopted for transmission, the baud rate parameter used when the local terminal sends the locally supported baud rate parameter to the opposite terminal can also be adopted, or the baud rate currently used by the opposite terminal can also be adopted for transmission. Therefore, in an alternative implementation of the embodiment of the present invention, after step S103, the method may further include: detecting a level change of a receiving port; determining M waveform sequences corresponding to second received data continuously transmitted by an opposite terminal according to the level change and the characteristics of the waveform sequences, wherein M is a positive integer and is more than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences; determining a bit sequence of the second received data according to the M waveform sequences corresponding to the continuously transmitted second received data; analyzing the second received data to obtain the baud rate selected by the opposite terminal from the locally supported baud rate parameters; acquiring a bit sequence of second data to be transmitted; and sending a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, wherein the duration of the waveform sequence is inversely proportional to the selected baud rate.
In the above embodiment, the local end determines, according to the level change of the receiving port and the characteristics of the waveform sequence, M waveform sequences corresponding to the second received data continuously transmitted by the opposite end, and the manner of obtaining the second received data by analysis is similar to the manner of determining N waveform sequences corresponding to the first received data and obtaining the first received data by analysis, which is not described herein again.
In the foregoing embodiment, after receiving the second received data, the local terminal obtains the baud rate selected by the opposite terminal, and when sending the second data to be sent, the local terminal sends the second data to be sent according to the selected baud rate, thereby implementing baud rate adaptation between the local terminal and the opposite terminal.
In the foregoing embodiment, the second data to be sent is data that the local terminal needs to transmit to the opposite terminal, and in a specific transmission process, the local terminal may send the second data to be sent in the structure of the data frame, where the specific content of the second data to be sent is not limited in this embodiment.
In the scheme provided by this embodiment, in order to ensure that an opposite end performs data interaction by using the baud rate supported by the home end in a subsequent data transmission process, the home end sends a locally supported baud rate parameter to the opposite end in a bit sequence of first data to be sent, so that the home end and the opposite end can perform data interaction by using multiple baud rates, and only by including the locally supported baud rate parameter in the data to be sent at the home end, the baud rate can be hopped in the data transmission process.
Example 2
This embodiment provides a data transmission apparatus, which can be disposed in the local terminal described in embodiment 1, and is configured to execute the data transmission method described in embodiment 1.
Fig. 8 is a schematic structural diagram of the data transmission device provided in this embodiment, and as shown in fig. 8, the data transmission device mainly includes: a first acquisition module 800, a second acquisition module 802, and a first sending module 804.
The following mainly describes the functions of the functional modules of the data transmission device provided in this embodiment, and reference may be made to the description of embodiment 1 for other matters.
A first obtaining module 800, configured to obtain a bit sequence of first data to be transmitted, where the bit sequence of the first data to be transmitted at least includes: the data to be transmitted at least comprises: baud rate parameters of the local support; a second obtaining module 802, configured to obtain, according to a bit sequence of first data to be transmitted, a waveform sequence corresponding to a bit in the bit sequence, where the first waveform sequence represents a first data bit, and the second waveform sequence or a third waveform sequence represents a second data bit, the first data bit is one of bit 1 and bit 0, the second data bit is the other of bit 1 and bit 0, and when at least two consecutive bits in the bit sequence are the second data bit, a waveform sequence corresponding to a first bit of the at least two consecutive bits is the second waveform sequence, and waveform sequences corresponding to a second bit and subsequent bits are the third waveform sequence; wherein the characteristics of the waveform sequence include: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts with a high level and appears with a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change with the change of the baud rate of the waveform sequences, the second waveform sequence continues with the high level within the transmission duration, the third waveform sequence starts with the low level and ends with the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change with the change of the baud rate of the waveform sequences.
In this embodiment, the locally supported baud rate parameter is used to indicate the baud rate supported by the waveform sequence used by the local terminal for transmitting data (including receiving and sending data). The waveform sequence in this embodiment will be explained below.
In this embodiment, a first data bit is represented by a first waveform sequence, and a second data bit is represented by a second waveform sequence or a third waveform sequence, where the first data bit is one of bit 1 and bit 0, and the second data bit is the other of bit 1 and bit 0.
In an optional implementation of the embodiment of the present invention, the first sending module 804 is configured to continuously send the waveform sequence corresponding to the bits in the bit sequence according to the following manner: and according to the currently used baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence and the characteristics of the waveform sequence so as to transmit the first data to be transmitted. For example, the communication protocol promises: in this embodiment, the waveform sequence corresponding to each bit in the bit sequence of the first data to be transmitted is determined, for example, the first transmitting module 804 generates a high level and a low level by controlling the transmitting port, that is, controls the high level of the port to be changed into the low level as a transition of a falling edge by a hardware switch or software, and then controls the port to be restored to the high level to form a transition of a rising edge. The waveform sequence is obtained by the variation of high and low levels generated by the transmitting port, so that the waveform sequence corresponding to each bit can be generated, and further the waveform sequence corresponding to one data frame is formed. For example, if the bit sequence of the first data to be transmitted is 11001000, then according to the convention of the communication protocol, the 8 waveform sequences corresponding to the bit sequence of the ith data frame are XXYZXYZZ in sequence, where X is the first waveform sequence, Y is the second waveform sequence, and Z is the third waveform sequence, and according to the characteristics of the above waveform sequences of the respective waveform sequences, that is, the transmission durations of the first waveform sequence, the second waveform sequence, and the third waveform sequence are the same and inversely proportional to the currently used baud rate, such as T, the first preset time is T1, and the second preset time is T2, then the 8 waveform sequences corresponding to the bit sequence of the first data to be transmitted of 11001000 can be as shown in fig. 7. When each bit of the bit sequence of the first data to be transmitted is transmitted, the level of the transmitting port is controlled to jump at the corresponding moment so as to form a waveform sequence corresponding to the bit, further form a waveform sequence corresponding to the bit sequence of a data frame, and transmit the bit sequence of the first data to be transmitted.
In an optional implementation of the embodiment of the present invention, the data transmission apparatus may further include: a first detecting module, configured to detect a level change of a receiving port before the first obtaining module 800 obtains the bit sequence of the first data to be sent; a first determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, N waveform sequences corresponding to continuously transmitted first received data, where N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of the following: the first, second, and third waveform sequences; a second determining module, configured to determine a bit sequence of the first received data according to N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters. Through this optional implementation, the first obtaining module 800 may obtain the first data to be transmitted after receiving the indication information, which is sent by the opposite end and used for indicating to obtain the baud rate parameter, that is, may send the locally supported baud rate parameter to the opposite end according to the request of the opposite end.
The optional implementation of determining, by the first determining module, N waveform sequences corresponding to continuously transmitted first received data according to the detected level change and the feature of the waveform sequence, and the optional implementation of determining, by the second determining module, the bit sequence of the first received data according to the N waveform sequences corresponding to the continuously transmitted first received data may refer to the description of the optional implementation of determining, by the local terminal, the N waveform sequences corresponding to the first received data and determining the bit sequence of the first received data in embodiment 1, and details of this embodiment are not repeated.
In an optional implementation of the embodiment of the present invention, the data transmission apparatus may further include: a second detecting module, configured to detect a level change of a receiving port after continuously sending a waveform sequence corresponding to a bit in the bit sequence according to the bit sequence of the first data to be sent; a third determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, M waveform sequences corresponding to second received data that is continuously transmitted by an opposite end, where M is a positive integer and M is greater than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences; a fourth determining module, configured to determine a bit sequence of the second received data according to M waveform sequences corresponding to the continuously transmitted second received data; a third obtaining module, configured to analyze the second received data and obtain a baud rate selected by the opposite end from the locally supported baud rate parameters; a fourth obtaining module, configured to obtain a bit sequence of second data to be sent; and a second sending module, configured to send a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, where a duration of the waveform sequence is inversely proportional to the selected baud rate. Through the optional implementation mode, the local terminal can acquire the baud rate selected by the opposite terminal according to the locally supported baud rate parameters, and transmit the bit sequence of the second data to be transmitted by adopting the baud rate selected by the opposite terminal, so as to realize the hopping of the baud rate.
In the above optional embodiment, optionally, the baud rate selected by the opposite end may be the maximum baud rate supported by the local end, so that the transmission rate may be increased.
In an optional implementation of the embodiment of the present invention, the second sending module sends a waveform sequence corresponding to a bit sequence of the second data to be sent according to the following manner: and according to the selected baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence of the second data to be transmitted and the characteristics of the waveform sequence so as to transmit the second data to be transmitted.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (18)

1. A method of data transmission, comprising:
acquiring a bit sequence of first data to be transmitted, wherein the bit sequence of the first data to be transmitted at least comprises: the data to be transmitted at least comprises: baud rate parameters of the local support;
according to a bit sequence of first data to be transmitted, acquiring a waveform sequence corresponding to bits in the bit sequence, wherein the first waveform sequence represents a first data bit, the second waveform sequence or a third waveform sequence represents a second data bit, the first data bit is one of bit 1 and bit 0, the second data bit is the other of bit 1 and bit 0, when at least two continuous bits in the bit sequence are the second data bit, the waveform sequence corresponding to the first bit of the at least two continuous bits is the second waveform sequence, and the waveform sequences corresponding to the second bit and subsequent bits are the third waveform sequence; wherein the characteristics of the waveform sequence include: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts with a high level and appears with a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences, the second waveform sequence continues with the high level within the transmission duration, the third waveform sequence starts with the low level and ends with the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences;
and continuously transmitting a waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate.
2. The method of claim 1, wherein continuously transmitting the waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate comprises:
and according to the currently used baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence and the characteristics of the waveform sequence so as to transmit the first data to be transmitted.
3. The method according to claim 1 or 2, characterized in that before obtaining the bit sequence of the first data to be transmitted, the method further comprises:
detecting a level change of a receiving port;
determining N waveform sequences corresponding to first received data continuously transmitted by an opposite terminal according to the level change and the characteristics of the waveform sequences, wherein N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of the following: the first, second, and third waveform sequences;
determining a bit sequence of the first received data according to the N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters.
4. The method according to claim 1 or 2, wherein after the continuously transmitting the waveform sequence corresponding to the bits in the bit sequence according to the bit sequence of the first data to be transmitted, the method further comprises:
detecting a level change of a receiving port;
determining M waveform sequences corresponding to second received data continuously transmitted by an opposite terminal according to the level change and the characteristics of the waveform sequences, wherein M is a positive integer and is more than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences;
determining a bit sequence of the second received data according to the M waveform sequences corresponding to the continuously transmitted second received data;
analyzing the second received data to obtain the baud rate selected by the opposite terminal from the locally supported baud rate parameters;
acquiring a bit sequence of second data to be transmitted;
and sending a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, wherein the duration of the waveform sequence is inversely proportional to the selected baud rate.
5. The method of claim 4, wherein transmitting a waveform sequence corresponding to the bit sequence of the second data to be transmitted at the selected baud rate, wherein a duration of the waveform sequence is inversely proportional to the selected baud rate, comprises:
and according to the selected baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence of the second data to be transmitted and the characteristics of the waveform sequence so as to transmit the second data to be transmitted.
6. The method according to claim 1 or 2,
the locally supported baud rate parameters at least include: receiving the baud rate of the data and/or sending the baud rate of the data; wherein:
the baud rate of the received data comprises one or more;
the baud rate of the transmission data includes one or more.
7. The method of claim 1 or 2, wherein the sequence of waveforms is further characterized by:
the total duration of the low levels appearing in the first waveform sequence in the duration is less than one half of the duration; and/or
And the total time length of the low level appearing in the third waveform sequence in the duration is less than one half of the duration.
8. The method according to claim 1 or 2,
the third waveform sequence has only one level jump from low level to high level in the duration and is ended by high level;
the first waveform sequence starts with a high level, and only occurs once level jump from the high level to the low level in the duration time, and ends with the low level; alternatively, the first waveform sequence starts at a high level and ends at a high level with only one level transition from the high level to the low level within the duration.
9. The method of claim 4,
the bit sequence of the first data to be transmitted and the bit sequence of the second data to be transmitted each include a data frame, and the data frame includes: a data frame header, transmission data and a data frame tail; the data frame header at least comprises 1 bit, and the waveform sequence corresponding to the 1 st bit of the data frame header is the third waveform sequence or the first waveform sequence.
10. The method of claim 4,
the bit sequence of the first data to be transmitted and the bit sequence of the second data to be transmitted each include a data frame, and the data frame includes: a data frame header, transmission data and a data frame tail; the data frame header at least comprises M bits, wherein M is a positive integer and is more than or equal to 2;
the waveform sequences corresponding to the first M bits of the data frame header consist of M first waveform sequences; or
The waveform sequences corresponding to the first M bits of the data frame header consist of M third waveform sequences; or
The waveform sequences corresponding to the first M bits of the data frame header comprise at least one first waveform sequence and at least one third waveform sequence.
11. The method of claim 10,
when the waveform sequences corresponding to the first M bits of the data frame header are composed of M first waveform sequences, the data frame header further includes: at least 1 anti-interference bit after the first M bits of the data frame header, wherein a waveform sequence corresponding to the at least 1 anti-interference bit is the second waveform sequence or the third waveform sequence;
when the waveform sequences corresponding to the first M bits of the data frame header are composed of M third waveform sequences, the data frame header further includes: at least 1 anti-interference bit after the first M bits of the data frame header, wherein a waveform sequence corresponding to the at least 1 anti-interference bit is the second waveform sequence or the first waveform sequence.
12. The method according to any one of claims 9 to 11,
the data frame header comprises 8 bits, and the waveform sequences corresponding to the 8 bits are the third waveform sequence, the second waveform sequence, the third waveform sequence, the second waveform sequence and the third waveform sequence in sequence.
13. The method according to any one of claims 9 to 11,
the data frame tail comprises 2 bits, wherein:
the waveform sequence corresponding to the first bit of the data frame tail is the second waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the second waveform sequence; alternatively, the first and second electrodes may be,
the waveform sequence corresponding to the first bit of the data frame tail is the third waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the second waveform sequence; alternatively, the first and second electrodes may be,
and the waveform sequence corresponding to the first bit of the data frame tail is the first waveform sequence, and the waveform sequence corresponding to the second bit of the data frame tail is the third waveform sequence.
14. A data transmission apparatus, comprising:
a first obtaining module, configured to obtain a bit sequence of first data to be transmitted, where the bit sequence of the first data to be transmitted at least includes: the data to be transmitted at least comprises: baud rate parameters of the local support;
a second obtaining module, configured to obtain a waveform sequence corresponding to a bit in a bit sequence according to the bit sequence of first data to be transmitted, where the first waveform sequence represents a first data bit, the second waveform sequence or a third waveform sequence represents a second data bit, the first data bit is one of bit 1 and bit 0, the second data bit is the other of bit 1 and bit 0, and when at least two consecutive bits in the bit sequence are the second data bit, a waveform sequence corresponding to a first bit of the at least two consecutive bits is the second waveform sequence, and waveform sequences corresponding to the second bit and subsequent bits are the third waveform sequence; wherein the characteristics of the waveform sequence include: the duration of the first waveform sequence, the duration of the second waveform sequence and the duration of the third waveform sequence are the same, the transmission duration and the baud rate of the waveform sequences are in an inverse proportion relation, the first waveform sequence starts with a high level and appears with a low level within the transmission duration, wherein the total duration of the low level appearing in the first waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences, the second waveform sequence continues with the high level within the transmission duration, the third waveform sequence starts with the low level and ends with the high level, and the total duration of the low level appearing in the third waveform sequence within the transmission duration does not change along with the change of the baud rate of the waveform sequences;
and the first sending module is used for continuously sending the waveform sequence corresponding to the bits in the bit sequence according to the currently used baud rate, wherein the duration of the waveform sequence is in inverse proportion to the currently used baud rate.
15. The apparatus of claim 14, wherein the first transmitting module is configured to continuously transmit the waveform sequence corresponding to the bits in the bit sequence according to the following manner:
and according to the currently used baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence and the characteristics of the waveform sequence so as to transmit the first data to be transmitted.
16. The apparatus of claim 14 or 15, further comprising:
the first detection module is used for detecting the level change of a receiving port before the first acquisition module acquires the bit sequence of the first data to be sent;
a first determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, N waveform sequences corresponding to first received data that is continuously transmitted by an opposite end, where N is a positive integer, and each waveform sequence in the N waveform sequences corresponding to the first received data is one of: the first, second, and third waveform sequences;
a second determining module, configured to determine a bit sequence of the first received data according to N waveform sequences corresponding to the continuously transmitted first received data, where the bit sequence of the first received data at least includes: first transmission data, the first transmission data including at least: and the indication information is used for indicating the acquisition of the baud rate parameters.
17. The apparatus of claim 14 or 15, further comprising:
a second detecting module, configured to detect a level change of a receiving port after continuously sending a waveform sequence corresponding to a bit in the bit sequence according to the bit sequence of the first data to be sent;
a third determining module, configured to determine, according to the level change and the characteristics of the waveform sequence, M waveform sequences corresponding to second received data that is continuously transmitted by an opposite end, where M is a positive integer and M is greater than or equal to 2, and each waveform sequence in the M waveform sequences corresponding to the second received data is one of the following: the first, second, and third waveform sequences;
a fourth determining module, configured to determine a bit sequence of the second received data according to M waveform sequences corresponding to the continuously transmitted second received data;
a third obtaining module, configured to analyze the second received data and obtain a baud rate selected by the opposite end from the locally supported baud rate parameters;
a fourth obtaining module, configured to obtain a bit sequence of second data to be sent;
and a second sending module, configured to send a waveform sequence corresponding to the bit sequence of the second data to be sent according to the selected baud rate, where a duration of the waveform sequence is inversely proportional to the selected baud rate.
18. The apparatus of claim 17, wherein the second transmitting module transmits the waveform sequence corresponding to the bit sequence of the second data to be transmitted according to the following manner:
and according to the selected baud rate, controlling the level of a transmitting port to change according to the waveform of a waveform sequence corresponding to bits in the bit sequence of the second data to be transmitted and the characteristics of the waveform sequence so as to transmit the second data to be transmitted.
CN201611051707.0A 2016-11-24 2016-11-24 Data transmission method and device Active CN107241161B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201611051707.0A CN107241161B (en) 2016-11-24 2016-11-24 Data transmission method and device
PCT/CN2017/107600 WO2018095181A1 (en) 2016-11-24 2017-10-25 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611051707.0A CN107241161B (en) 2016-11-24 2016-11-24 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN107241161A CN107241161A (en) 2017-10-10
CN107241161B true CN107241161B (en) 2019-12-31

Family

ID=59982925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611051707.0A Active CN107241161B (en) 2016-11-24 2016-11-24 Data transmission method and device

Country Status (2)

Country Link
CN (1) CN107241161B (en)
WO (1) WO2018095181A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241161B (en) * 2016-11-24 2019-12-31 天地融科技股份有限公司 Data transmission method and device
WO2018095180A1 (en) * 2016-11-24 2018-05-31 天地融科技股份有限公司 Data transmission method, data receiving method and devices
CN112511334B (en) * 2020-10-13 2024-05-07 博流智能科技(南京)有限公司 Method and system for improving communication rate
CN112968752B (en) * 2021-01-28 2023-01-24 歌尔科技有限公司 Baud rate switching method and device for UART communication and initiator terminal
CN113742003B (en) * 2021-09-15 2023-08-22 深圳市朗强科技有限公司 Program code execution method and device based on FPGA chip
CN116886247B (en) * 2023-09-01 2023-11-21 珠海芯探索微电子有限公司 Baud rate self-adaption method and device based on UART communication, UART system and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101855878A (en) * 2007-11-13 2010-10-06 Nxp股份有限公司 Duty-cycle modulated 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
CN104796222A (en) * 2014-11-21 2015-07-22 湖南先步信息股份有限公司 A CAN baud-rate automatic matching method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7415543B2 (en) * 2003-11-12 2008-08-19 Lsi Corporation Serial port initialization in storage system controllers
JP2010147943A (en) * 2008-12-19 2010-07-01 Sony Corp Information processing apparatus and signal transmission method
CN101710857A (en) * 2009-11-05 2010-05-19 厦门敏讯信息技术股份有限公司 Serial communication baud rate adaptive method and device thereof
CN103716118B (en) * 2012-09-28 2017-03-29 京信通信***(中国)有限公司 The data is activation and method of reseptance of a kind of AMR and device
CN107241162B (en) * 2016-11-24 2020-04-10 天地融科技股份有限公司 Data transmission method and device
CN107241161B (en) * 2016-11-24 2019-12-31 天地融科技股份有限公司 Data transmission method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101855878A (en) * 2007-11-13 2010-10-06 Nxp股份有限公司 Duty-cycle modulated 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
CN104796222A (en) * 2014-11-21 2015-07-22 湖南先步信息股份有限公司 A CAN baud-rate automatic matching method

Also Published As

Publication number Publication date
CN107241161A (en) 2017-10-10
WO2018095181A1 (en) 2018-05-31

Similar Documents

Publication Publication Date Title
CN107241161B (en) Data transmission method and device
CN107241162B (en) Data transmission method and device
US20060136015A1 (en) Human body communication device, human body communication system and method using the same
US8422596B2 (en) Communication device, communication method, and program
US10608778B2 (en) Data transmission method and terminal
KR20160017029A (en) Digital radio communication
KR20160017028A (en) Digital radio communication
US9906385B2 (en) Communication devices
CN103812535A (en) Bluetooth equipment connecting method and Bluetooth equipment
CN107346997A (en) A kind of data transmission method and terminal
CN107359964B (en) Data sending method and device
CN107404319B (en) Data receiving method and device
CN107359963B (en) Data transmission method and terminal
CN107368446B (en) Transmission parameter adaptive data transmission method and device
CN107346999B (en) data frame tail detection method and data transmission device
CN107346998B (en) Data frame tail detection method and data transmission device
CN107423248B (en) Data frame header sending method and sending device
CN107359962B (en) Data receiving method and device
CN113098809B (en) Software self-adaptive decoding method, device and wireless charging system
CN107370565B (en) Transmission parameter adaptive data transmission method and device
CN107404366B (en) Data sending method and device
WO2018095180A1 (en) Data transmission method, data receiving method and devices
CN107453838B (en) Data frame header sending method and sending device
CN112564820B (en) Signal receiving and transmitting method and device and electric kettle
CN107465498B (en) Transmission parameter acquisition method and terminal

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