CN114024795B - Baud rate self-adaption method, device, computer equipment and storage medium - Google Patents

Baud rate self-adaption method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN114024795B
CN114024795B CN202111306733.4A CN202111306733A CN114024795B CN 114024795 B CN114024795 B CN 114024795B CN 202111306733 A CN202111306733 A CN 202111306733A CN 114024795 B CN114024795 B CN 114024795B
Authority
CN
China
Prior art keywords
level width
baud rate
width
level
target
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
CN202111306733.4A
Other languages
Chinese (zh)
Other versions
CN114024795A (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.)
Shenzhen Xhorse Electronics Co Ltd
Original Assignee
Shenzhen Xhorse Electronics 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 Shenzhen Xhorse Electronics Co Ltd filed Critical Shenzhen Xhorse Electronics Co Ltd
Priority to CN202111306733.4A priority Critical patent/CN114024795B/en
Publication of CN114024795A publication Critical patent/CN114024795A/en
Application granted granted Critical
Publication of CN114024795B publication Critical patent/CN114024795B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/4013Management of data rate on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Communication Control (AREA)

Abstract

The application relates to a baud rate adaptive method, a baud rate adaptive device, a computer device and a storage medium. The method comprises the following steps: acquiring a first level width between adjacent jump edges; acquiring a second level width between adjacent backward jump edges; the first level width and the second level width are different; performing iterative subtraction on the first level width and the second level width to obtain a target level width set; determining a target baud rate of communication between devices according to the target level width set; and communicating based on the target baud rate. The method can improve the baud rate self-adaptive efficiency.

Description

Baud rate self-adaption method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a baud rate adaptive method, apparatus, computer device, and computer readable storage medium.
Background
Baud rate is one of the most important parameters in serial communication, and the master and the slave must keep the baud rate consistent to establish communication. Thus, when the host transmits data at a particular baud rate, it is necessary to make the slave know the baud rate of the current communication by some method so that the slave can correctly receive and process the data. The application scene is mainly divided into two types: one is that the host and the slave are controllable, and the communication protocol can be modified or fine-tuned; the other is that the host is completely a black box, the host cannot be required to perform special operation, and the baud rate information is only extracted from waveforms sent by the host.
The common scheme is that the master transmits appointed characters, and the slave can calculate the baud rate by detecting the width of the low-level signal. For example, assuming that the master transmits 0x55, the slave's measured level clearly represents a 1bit time T(s), then the baud rate is (1/T). The return-to-zero code may also be used so that each bit of data is self-contained with baud rate information. Both methods are one hundred percent accurate and efficient in the case where both the master and the slave are controllable, but both change the communication protocol to some extent.
In the case that the host is a black box, only the communication protocol is known, the baud rate of the host is not known, and the host cannot transmit special characters, and in this case, the level width is generally used for judgment. The conventional method continuously measures a sufficient number of level pulse widths, the minimum necessarily being a 1bit corresponding pulse width T(s). The conventional method can cause errors under specific conditions in practical application, and the situation that the errors are not judged is not few, so that the new level width can not be judged all the time. The traditional baud rate self-adaption method has the problem of low self-adaption efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a baud rate adaptive method, apparatus, computer device, and storage medium capable of improving the baud rate adaptive efficiency.
A baud rate adaptation method, the method comprising:
acquiring a first level width between adjacent jump edges;
acquiring a second level width between adjacent backward jump edges; the first level width and the second level width are different;
performing iterative subtraction on the first level width and the second level width to obtain a target level width set;
determining a target baud rate of communication between devices according to the target level width set;
and communicating based on the target baud rate.
A baud rate adaptation device, the device comprising:
the first acquisition module is used for acquiring a first level width between adjacent jump edges;
the second acquisition module is used for acquiring a second level width between the backward adjacent jump edges; the first level width and the second level width are different;
the iterative difference making module is used for carrying out iterative difference making on the first level width and the second level width to obtain a target level width set;
a baud rate determining module, configured to determine a target baud rate of communication between devices according to the target level width set;
and the communication module is used for communicating based on the target baud rate.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method of the embodiments when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of the embodiments.
The baud rate self-adaption method, the device, the computer equipment and the storage medium can fully utilize the obtained level width to obtain a plurality of level widths by obtaining the first level width and the second level width and performing iterative difference, and can quickly obtain the baud rate through the plurality of level widths without waiting for new level width values all the time.
Drawings
FIG. 1 is a diagram of an application environment for baud rate adaptation in one embodiment;
FIG. 2 is a flow chart of a method of baud rate adaptation in one embodiment;
FIG. 3 is a schematic diagram of a level width in one embodiment;
FIG. 4 is a flowchart of another embodiment of a method for adaptive baud rate;
FIG. 5 is a block diagram of a baud rate adaptive device according to one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in the embodiments of the present invention, all directional indicators (such as up, down, left, right, front, and rear … …) are merely used to explain the relative positional relationship, movement conditions, and the like between the components in a specific posture (as shown in the drawings), if the specific posture is changed, the directional indicators correspondingly change, and the connection may be a direct connection or an indirect connection.
Furthermore, descriptions such as those referred to as "first," "second," and the like, are provided for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implying an order of magnitude of the indicated technical features in the present disclosure. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
In one embodiment, as shown in fig. 1, a graph of an application environment for baud rate adaptation in one embodiment is shown. Including a vehicle diagnostic instrument 110 and a vehicle 120. Since it is difficult for the vehicle diagnostic apparatus to know the type of the vehicle and the baud rate of the communication in advance, only the communication protocol used for the communication between the devices is known, and thus, it is necessary to perform baud rate adaptation. In the scenario of fig. 1, the vehicle diagnostic apparatus 110 may be considered a slave and the vehicle 120 as a master. In the case where the host is a black box, no matter what method the baud rate is obtained, the communication information carried by the waveform used to obtain the baud rate must be lost. The slave cannot receive and analyze the information correctly before the baud rate is obtained, so that the speed of obtaining the baud rate means the loss of information, and therefore, the efficiency of the baud rate self-adaption is important. It will be appreciated that embodiments of the present application may also be applied between two computer devices. The baud rate adaptive method is applied to a computer device, which is exemplified as a vehicle diagnostic apparatus.
In one embodiment, as shown in fig. 2, a flow chart of a baud rate adaptive method in one embodiment includes:
Step 202, a first level width between adjacent transition edges is obtained.
Specifically, the first level width between adjacent transition edges refers to a level width conforming to a communication protocol. For a communication protocol with a limited baud rate, for example, when the communication protocol is a CAN (Controller Area Network, controller area network bus) communication protocol, since the CAN communication protocol has a unique "full 5 plug 1" mechanism, 1 opposite level is inserted when there are 5 consecutive identical levels on the CAN bus, resulting in a jump edge for synchronization. Therefore, the first level width between adjacent jump edges in the CAN message with consistent baud rate is only 5 cases corresponding to 1bit, 2bit, 3bit, 4bit and 5 bit.
For a communication protocol with continuously variable baud rate, for example, when the communication protocol is UART (Universal Asynchronous Receiver/Transmitter, universal asynchronous receiver Transmitter), since the most commonly used UART format is idle+start bit+8 bit data+stop bit, it is obvious that the first level width in the waveform with consistent baud rate has 9 cases of 1bit, 2bit, 3bit, 4bit, 5bit, 6bit, 7bit, 8bit and 9 bit. A communication protocol in which the baud rate is continuously variable means that the baud rate supported by the communication protocol is not a specific few baud rates, but may be any baud rate. The vehicle transmits signals using only one baud rate of the communication protocol, i.e., the baud rate employed by signals transmitted by the same vehicle is generally the same.
It is understood that the first level width may be a high level width or a low level width. Since the communication bus is normally high when idle, the first level width is preferably the width of the low level. The vehicle diagnostic apparatus receives signals sent by the vehicle and acquires first level widths between adjacent jump edges in the signals in real time through the counter. The signal is a non-return to zero code signal.
Step 204, obtaining a second level width between backward adjacent jump edges; the first level width and the second level width are different.
Wherein the second level width is a level width subsequent to the first level width and between adjacent transition edges. And the value of the first level width and the value of the second level width are different. It is understood that the second level width may be a high level width or a low level width. Since the communication bus is normally high when idle, the second level width is preferably the width of the low level. The level type of the second level width may be the same as or different from the level type of the first level width.
Specifically, after the first level width is acquired, the vehicle diagnostic apparatus continues to acquire the level width, and when the acquired level width is the same as the first level width, the level width is not reserved. Until a second level width is obtained that is different from the value of the first level width.
In this embodiment, as shown in fig. 3, a schematic diagram of the level width in one embodiment is shown. Taking the example that the first level width and the second level width are both low level widths, fig. 3 (1) is the first level width and (2) is the second level width.
Step 206, performing iterative subtraction on the first level width and the second level width to obtain a target level width set.
The iterative difference making refers to a process of making a difference for a plurality of times, and the difference value obtained by making a difference for a plurality of times is not repeated. The target level width set includes differences. The set of target level widths may also include a difference value, a first level width, and a second level width.
Specifically, the vehicle diagnostic apparatus iteratively differends the first level width and the second level width until no new values appear, obtaining a set of target level widths. The new value is different from the value obtained.
Step 208, determining a target baud rate for communication between the devices based on the set of target level widths.
Specifically, the vehicle diagnostic apparatus determines a minimum level width from the set of target levels and determines a target baud rate of communication between the devices from the minimum level width. That is, after the iterative subtraction, the vehicle diagnostic apparatus may obtain a plurality of level widths, and then the vehicle diagnostic apparatus may determine a minimum level width from the set of target level widths, and use the baud rate corresponding to the minimum level width as the target baud rate. For example, the first level width is 4 and the second level width is 5, then the iterative difference is 5-4=1, 5-1=4, 4-1=3, 3-1=2 … and the difference includes 1, 2, 3 and 4. The device does not need to wait for 1 to appear, and can obtain the minimum level width through iterative subtraction, and the reciprocal of the minimum level width is the target baud rate. The above 1, 2, 3, 4 and 5 are used to represent relative widths.
Step 210, communicating based on the target baud rate.
Where the baud rate represents the number of symbol symbols transmitted in each, which is a measure of the symbol transmission rate. In the information transmission channel, the signal unit carrying data information is called symbol, and the number of symbols transmitted through the channel per second is called symbol transmission rate, abbreviated as baud rate.
Specifically, the vehicle diagnostic apparatus communicates with the vehicle based on the target baud rate.
According to the baud rate self-adaption method, the first level width and the second level width are obtained, and the difference is iterated, so that the obtained level widths can be fully utilized to obtain a plurality of level widths, new level width values do not need to be kept waiting all the time, and the baud rate can be quickly obtained through the plurality of level widths.
In one embodiment, the set of target level widths includes a difference value obtained by iterative differencing, a first level width, and a second level width.
Determining a target baud rate for communication between devices from a set of target level widths, comprising:
determining a minimum level width from the first level width, the second level width, and the difference when the difference is different from both the first level width and the second level width;
Determining the baud rate corresponding to the minimum level width;
and taking the baud rate corresponding to the minimum level width as a target baud rate of communication between the devices.
Specifically, when the difference obtained by the iterative difference includes a difference different from both the first level width and the second level width, the vehicle diagnostic apparatus determines the minimum level width from among the first level width, the second level width, and the difference. The vehicle diagnostic apparatus uses the baud rate corresponding to the minimum level width as a target baud rate for communication between devices. For example, the first level width is 3 and the second level width is 2, and then the iterative difference results include 1,1 and 2 and 3 each being different, so that the minimum level width 1 can be determined from among 1, 2 and 3, and the baud rate can be obtained.
In this embodiment, it is found by analysis that there are (2n+1) level widths for a communication protocol having a limited baud rate, such as CAN protocol. When the (n+1) level widths are obtained, an odd number can be necessarily obtained, and then the minimum level width can be obtained by iterative subtraction, so that the baud rate corresponding to the minimum level width can be used as the target baud rate.
However, for a communication protocol with a variable baud rate, such as UART protocol, there is no special level value of a limited number of baud rates, then, by sacrificing some accuracy, the baud rate corresponding to the minimum level width thereof can be taken as the target baud rate.
Table 1 below shows possible combinations of low level widths in one cycle for a communication protocol in which the baud rate can be continuously varied. A communication protocol in which the baud rate is continuously variable means that the baud rate supported by the communication protocol is not a specific few baud rates, but may be any baud rate. The vehicle transmits signals using only one baud rate of the communication protocol, i.e., the baud rate employed by signals transmitted by the same vehicle is generally the same. Taking UART protocol as an example, a maximum of 5 low levels occur in one cycle, and thus a fifth value is set. The first value refers to the first level width received, the second value refers to the second level width … received and the fifth value refers to the fifth level width received, these widths being possible in combination as shown in table 1. The considered position refers to a position where the obtained value (i.e., level width) is in the waveform, because there may be 9 levels in one period of UART. Taking the first value of 1 and the second value of 2 as examples, 1 may occur at a first location, a second location …, etc., 2 may occur at a second location, a third location, etc., i.e. low-high-low high-high, but also low high, there are 10 total possibilities of low high ….
Statistics were performed according to the data of table 1 below, for a total of 256 combinations. The probability of occurrence 1 is 207/256, the probability of occurrence 2 is 138/256, the probability of occurrence 3 is 74/256, the probability of occurrence 4 is 35/256, the probability of occurrence 5 is 16/256, the probability of occurrence 6 is 7/256, the probability of occurrence 7 is 3/256, the probability of occurrence 8 is 1/256, and the probability of occurrence 9 is 1/256. It is apparent that the probability of 1, 2 is much greater than the probability of 8, 9. It is hypothesized that under the condition of sacrificing a bit of accuracy, the situation that cannot be judged, such as the situation that 3, 6 and 9 or 2, 4 and 8 are received, is regarded as 1, 2 and 3, the efficiency can be greatly improved, and most of the situations that cannot be judged because of the new value at all times can be eliminated. The case where 3, 6 and 9 or 2, 4 and 8 are received is considered as a similar case where 1, 2 and 3 are received, and is called a large probability approximation.
TABLE 1
The probability that 1byte (byte) is received is not determined in table 2 below, and the probability that the baud rate cannot be determined after one byte is received. The probability of 1 being included in the difference or itself is the probability of the 1byte including the minimum level width itself or including the minimum level width after iterative difference. The probability of failing to determine but including 1 means the probability of failing to determine the baud rate but including the minimum level width in 1 byte. The probability of itself or the difference containing 1 and more than 3 means the probability of itself that the level width contains 1 and the value of the level width is more than 3. Taking 1byte as an example, the probability that 1 and more than 3 are included is the ratio of the probability that 1 and more than 3 are included per se or the sum of the probabilities that 1byte is not included in the probability that 1byte is not included. The mathematical meaning is that a large probability approximation mode is adopted, and the probability of the target baud rate can be determined from the situation that the probability cannot be judged. If it cannot be determined but contains 1 and more than 3 probabilities= 35.54688%/91.79688% ×100% = 38.72340%. That is, when the determination is not made, the correct baud rate can be determined with a 38.72340% probability.
TABLE 2
For a communication protocol with continuously variable baud rate, increasing the probability approximation can achieve a larger efficiency improvement at the expense of extremely low accuracy. Taking UART as an example, actually for UART waveforms that send random numbers, the probability of occurrence of different widths is not evenly distributed, the probability of occurrence of 1bit width is much higher than that of 9bit width, and the probability of occurrence from 1 to 9 is gradually reduced. The probabilities of 1byte judgment, 2byte judgment, 3byte judgment, and the probability of including a 1bit width in the case of failing to judge are calculated in consideration of judging the baud rate as early as possible. The probability of including a 1bit width in the case where 2byte is not judged was 95.33229%. Since the probability of 1, 2 and 2, 4 combinations, etc. are all high, and 2, 4 does not contain 1, if the accuracy needs to be improved, a constraint can be imposed: 3 widths need to appear in 3 bytes, so that the judging probability is reduced to 93.90364%, and the accuracy is improved to a certain extent.
Whereas the probability of including a 1bit width in the case of 3byte failure is 98.22860%. The case where 3byte cannot be judged may be the case where 1, 2 and 3 or 2, 3 and 4 are received, because it is unclear whether 1, 2 and 3 or 2, 4 and 6 or 3, 6 and 9 are actually received at 1, 2 and 3, and it is unclear whether 2, 3 and 4 or 4, 6 and 8 are actually received at 2, 3 and 4. The probability of 1bit width is up to 98.22860% in the case that 3byte cannot be judged, so that the 3byte cannot be judged in the application scene with high efficiency requirement and certain accuracy sacrifice permission can be considered to be 1bit width. I.e. if 3 level widths are obtained, the accuracy of the target baud rate can reach 93.90364 percent, which meets the requirements. The calculation of the target baud rate can be determined after the 4 level widths are obtained, and the calculation is actually a game between accuracy and efficiency.
For the special cases mentioned above which cannot be determined, it is known that the probabilities themselves or the differences obtained after iterative differencing contain a width representing 1 bit. One hundred percent reliability is not typically required in engineering applications, so long as the probability of error is within an acceptable range, so that considering the case where a large probability can be determined is also considered to be determinable, the relevant probabilities for such a process are given in table 3 below. Since the probability of 1 and 2 appearing is large, and if only the widths of 1, 2 are always given, it is difficult to distinguish whether 1, 2 or 2, 4 or 3, 6, etc., which results in that the probability of 1 and more than 3 being contained in the indistinguishable case does not appear to be high, most of the cases are not satisfied with the condition containing 1, but the different widths are not satisfied with more than 3, so that it is preferable to consider the minimum value directly as the 1-bit width in the case that the iteration difference cannot be obtained by five values when 3 or more different widths are obtained, and errors are hardly made.
As shown in table 3, the probability of presence or absence is expressed by comparing the approximate adaptive efficiency with the indistinguishable special case.
Table 3 above gives a comparison of the adaptation efficiency without taking into account the probabilistic approximation and with taking into account the probabilistic approximation. The number of different widths is required to be the same, but in the case of considering a large probability approximation, the probability that it can be judged is greatly increased regardless of whether several bytes are received. The 2-byte judging probability reaches more than 80%, and the 3-byte judging probability is close to 94%. The probability rises even further if the requirement is relaxed to 4 bytes, in contrast to the very high efficiency of baud rate adaptation achieved by iterative differencing with a level width that takes into account the approximation of the large probability for a variable baud rate communication protocol.
In this embodiment, when a difference value different from both the first level width and the second level width is obtained, the minimum level width is determined, so that the target baud rate is determined, and the new value in the signal does not need to be waited for, thereby improving the baud rate adaptive efficiency.
In one embodiment, determining a target baud rate for communication between devices based on the difference result comprises:
when the number value contained in the target level width set is smaller than three, acquiring a third level width; the third level width is the level width between adjacent jump edges backward to the second level width; the third level width is different from both the first level width and the second level width;
performing iterative difference making according to the target level width set and the third level width until no new value is iterated, and obtaining a plurality of level widths;
determining a minimum level width from the plurality of level widths;
and determining the baud rate corresponding to the minimum level width, and obtaining the target baud rate of the communication between the devices.
The target level width set comprises a result obtained by iterative subtraction, a first level width and a second level width.
Specifically, for the communication protocol with the maximum level width corresponding to the (2N) bit or the (2n+1) bit, only the level width between (n+1) different adjacent jump edges is needed to be obtained, and all possible low level widths can be obtained through iterative subtraction. Taking the CAN protocol as an example, the level width includes 1, 2, 3, 4 and 5, then when 2 and 4 are obtained, the iteration difference cannot obtain a new value, then a new level width is obtained, namely 1, 3 or 5, and then any odd number and 2 and 4 are subjected to the iteration difference, so that 1 CAN be necessarily obtained. The target baud rate can be determined by determining the minimum level width from among the plurality of level widths. Taking UART protocol as an example, the accuracy of calculating the target baud rate by obtaining 3 level widths can also reach 93.9%.
In this embodiment, when the number value included in the target level width set is smaller than three, a third level width different from the first level width and the second level width is obtained, so that the condition of (n+1) can be basically satisfied, and the baud rate adaptive accuracy and the baud rate adaptive efficiency are improved.
In one embodiment, determining the baud rate corresponding to the minimum level width includes:
performing width matching on the minimum level width, and determining a reference level width corresponding to the minimum level width;
and determining a reference baud rate corresponding to the reference level width.
The reference level width refers to a level width corresponding to the reference baud rate. For example, the reference level width corresponding to the baud rate of 1M is 1us, the reference level width corresponding to the baud rate of 250K is 4us, and so on.
Specifically, in the case where the communication protocol is a communication protocol having a limited baud rate, the vehicle diagnostic apparatus width-matches the minimum level width with each level width range, determines the corresponding level width range, and thereby obtains the reference level width. One level width range corresponds to one reference level width. The inverse of the reference level width is then the reference baud rate. For example, the minimum level width is 4.1 and the corresponding level width ranges from 3.6 to 4.4, then in practice the corresponding reference level width should be 4, resulting in a baud rate of 250K.
As in table 4, for a minimum level width match with a clock of 10 MHZ. As can be seen from table 4, when the baud rate is 1M, the reference level width is 10, the minimum value in the level width range is 9, and the maximum value is 11.
Table 4 minimum Length output match (10 MHz)
Baud rate/bsp Reference levelWidth of (L) min max
1M 10 9 11
500K 20 18 22
250K 40 36 44
100K 100 90 110
ERROR 5 Others Others
Table 5 minimum Length output match (50 MHz)
In this embodiment, the minimum level width is subjected to width matching, and the reference level width corresponding to the minimum level width is determined, so that the error of the minimum level width can be reduced to match the upper standard level width, and the reference baud rate corresponding to the reference level width is determined, so that the correct baud rate can be obtained.
In one embodiment, the set of target level widths includes differences resulting from the iterative differencing.
Determining a target baud rate for communication between devices from a set of target level widths, comprising:
when a target difference value in a preset level width set is obtained during iterative differencing, taking the baud rate corresponding to the target difference value as a target baud rate of communication between devices; the preset level widths in the preset level width set have and correspond to only one baud rate.
The preset level width in the preset level width set is one and corresponds to only one baud rate. And the preset level width may represent a level width within a range.
Specifically, for a communication protocol having a limited baud rate, for example, the baud rate can only be 1M, 500K, 250K, 100K, etc., it is known through analysis that the level width of some specific lengths exists only at a specific baud rate. For example, when the level width obtained when the iterative subtraction is 1us, the baud rate is necessarily 1M. Thus, when the target difference value in the preset level width set is obtained at the time of iterative differencing, the vehicle diagnostic apparatus can take the baud rate corresponding to the target difference value as the target baud rate of the communication between the devices.
In one embodiment, as in table 6, for a communication protocol containing a limited number of baud rates, the clock frequency is 10mhz, t=0.1 us, with:
where bsp denotes baud rate, 1/us denotes microseconds, ±10% denotes errors of 10% considered. For example, at a baud rate of 1M, the level width may be 1 microsecond, 2 microseconds, 3 microseconds, 4 microseconds, and 5 microseconds. The above table shows that the count is 10MHZ, i.e., 0.1us each time, the count is 9-11 for a level width of 1us, and 18-22 for a level width of 2 us. Because some values are repeated, repeated values 54, 55, 108, 109, and 110 are discarded. 9-11, 18-22, etc. are all level width ranges.
The preset level width sets include 1, 3, 5, 6, 12, 16, 30, 40, and 50. Or 10, 30, 50, 60, 120, 160, 300, 400 and 500, as counted. The preset set of level widths may also include 0.9-1.1, 2.7-3.3, 4.5-5.5, 5.4-6.6, 10.8-13.2, 14.4-17.6, 27-33, 36-44, and 45-55, taking into account errors in the level widths. Likewise, the set of preset level widths may also include 9-11, 27-33, 45-55, 5.4-6.6, 90-110, 108-132, 90-110.
As can be seen from the analysis table 6, taking the case where the unit of time length is microsecond as an example, when the level width between adjacent transition edges is 1, only the case where the baud rate is 1M occurs. And when 2 occurs between adjacent transition edges, it may be 1M or 500K baud rate. At this time, the second level width needs to be acquired again, if 8 occurs, then 8-2=6, 6-2=4, 4-2=2, then the minimum low level is 2, and the baud rate can be obtained to be 500K.
As in table 7, for a communication protocol with a limited baud rate, the clock frequency is 50mhz, t=20ns, there are;
disregarding the extreme case of just 10%; taking into account sampling errors; red characters in the table indicate overlapping portions; the green shading unit cell represents the situation that the baud rate can be directly judged, and an adaptive state machine is not required to be entered. The received 220-225, 265-280, 445, 535-555 are discarded.
For communication protocols with a limited number of common baud rates, there may be some special values that only occur at a particular baud rate. Taking CAN protocol as an example, looking up the above 2 tables, it CAN be found that if the input matches 1, 3, 5, then the direct access communication baud rate is 1MHz, if the input matches 6, then the baud rate is 500KHz, if the input matches 12, 16, then the baud rate corresponds to 250K, if the input matches 30, 40, 50, then the baud rate must be 100KHz. The following conclusions can be summarized: for a communication protocol with a limited number of common baud rates, there will be some special values that only occur at a specific baud rate, and if these values occur when input or difference is made, it can immediately determine that the baud rate jumps out of the cycle, so as to reduce the information that is missed due to the baud rate determination as much as possible.
In this embodiment, when the target difference value in the preset level width set is obtained during iterative subtraction, the baud rate corresponding to the target difference value is taken as the target baud rate, so that the target baud rate can be obtained without performing iterative subtraction, and the baud rate adaptive efficiency is improved.
In one embodiment, acquiring the second level width between adjacent transition edges in the backward direction comprises:
And when the first level width is not in the preset level width set, acquiring a second level width between backward adjacent jump edges. The preset level widths in the preset level width set have and correspond to only one baud rate.
Specifically, for a communication protocol with a limited baud rate, performing width matching on the first level width, and determining a reference level width corresponding to the first level width; and when the reference level width corresponding to the first level width is not in the preset level width set, acquiring a second level width between the backward adjacent jump edges.
In this embodiment, when the first level width is not in the preset level width set, it is explained that the target baud rate cannot be determined only by the first level width, so that the baud rate adaptation needs to be performed in combination with the second level width between the adjacent backward transition edges.
In one embodiment, the baud rate adaptation method further comprises: and when the first level width is in the preset level width set, taking the baud rate corresponding to the first level width as the target baud rate of the communication between the devices.
Specifically, for a communication protocol with a limited baud rate, performing width matching on the first level width, and determining a reference level width corresponding to the first level width; and when the reference level width corresponding to the first level width is in the preset level width set, taking the baud rate corresponding to the first level width as the baud rate of the communication between the devices.
In this embodiment, when the first level width is in the preset level width set, it is described that the target baud rate can be determined only by the first level width, so as to improve the baud rate adaptive efficiency.
In one embodiment, after communicating based on the target baud rate, the baud rate adaptation method further comprises:
monitoring the level width of the waveform obtained on the bus;
when it is determined that an abnormal width occurs based on the level width of the waveform, an alarm signal is issued and the step of acquiring the first level width between adjacent transition edges is re-performed.
In this embodiment, after the baud rate adaptation is completed, whether the waveform obtained on the bus has an abnormal pulse width that is too long or too short can be monitored, if the abnormal pulse width occurs, an error can be reported to the controller, and the controller can be reset when needed, and the adaptive baud rate is restarted.
In one embodiment, a baud rate adaptation method includes:
step a1, a first level width between adjacent jump edges is obtained.
And a step a2, when the first level width is in the preset level width set, taking the baud rate corresponding to the first level width as the target baud rate of the communication between the devices.
Step a3, when the first level width is not in the preset level width set, acquiring a second level width between backward adjacent jump edges; the preset level width in the preset level width set is one and corresponds to only one baud; the first level width and the second level width are different.
Step a4, carrying out iterative subtraction on the first level width and the second level width to obtain a target level width set; the target level width set includes a difference value obtained by iterative difference, a first level width and a second level width.
Step a5, when a target difference value in a preset level width set is obtained during iterative differencing, taking the baud rate corresponding to the target difference value as a target baud rate of communication between devices; the preset level widths in the preset level width set have and correspond to only one baud rate.
And a step a6 of determining a minimum level width from the first level width, the second level width and the difference when the difference is different from both the first level width and the second level width.
And a7, determining the baud rate corresponding to the minimum level width.
And a step a8, taking the baud rate corresponding to the minimum level width as a target baud rate of the communication between the devices.
Step a9, when the number value contained in the target level width set is less than three, acquiring a third level width; the third level width is the level width between adjacent jump edges backward to the second level width; the third level width is different from both the first level width and the second level width.
And a10, carrying out iterative difference operation according to the target level width set and the third level width until no new value is iterated, and obtaining a plurality of level widths.
Step a11, determining the minimum level width from the plurality of level widths.
And a12, performing width matching on the minimum level width, and determining the reference level width corresponding to the minimum level width.
And a step a13, determining a reference baud rate corresponding to the reference level width, and obtaining a target baud rate of communication between the devices.
And a step a14, performing communication based on the target baud rate.
Step a15, monitoring the level width of the waveform obtained on the bus.
And a step a16 of sending out an alarm signal and re-executing the step of acquiring the first level width between the adjacent jump edges when the abnormal width is determined to occur based on the level width of the waveform.
According to the baud rate self-adaptive method, the unique baud rate can be determined by screening through the preset level width set, and the baud rate can be obtained without making a complete sequence; various deviations and interferences under the actual application scene are considered, the situation that two very similar values are subtracted as different values to cause errors is avoided, and the situation that the baud rate cannot be judged because new widths are not generated in waveforms sent by a host machine all the time is greatly reduced.
In one embodiment, as shown in fig. 4, a flow chart of a baud rate adaptive method in another embodiment is shown.
Direct input or ADC sampling: the vehicle diagnostic apparatus receives a signal transmitted from the vehicle, or the vehicle diagnostic apparatus samples the signal through an ADC (Analog to Digital Converter, analog-to-digital converter).
Measuring low level width: the vehicle diagnostic instrument measures the low level width between adjacent transition edges.
Input matching: for a communication protocol with a limited baud rate, all the results of low-level width measured under a specific clock are predictable, the theoretical values of the standards are taken as the centers, errors introduced by factors such as clock offset and sampling are considered, the numbers between two adjacent centers are divided, the number of the overlapped part is abandoned, the efficiency is improved on the premise of ensuring the accuracy, the available values are increased, and the situation that two actually identical but different values due to the errors are judged to be 2 different values is avoided, so that a small number is obtained by difference, and the baud rate self-adaption error is caused.
For a communication protocol with a limited baud rate, there are some specific width values at a certain baud rate, and the baud rate value can be directly obtained. Taking CAN bus communication as an example, the baud rate of CAN is four of 1M, 500K, 250K and 100K, the 1bit width corresponding to 1M is 1,
When the input matching results are 1, 3 and 5, the baud rate can be determined to be 1M;
when the input matching result appears 6, the baud rate is necessarily 500K;
when 12 and 16 input matching results appear, the baud rate is necessarily 250K;
when 30, 40 and 50 input matching results appear, the baud rate is necessarily 100K;
similarly, the target baud rate can be obtained immediately upon occurrence of the above-described special value in the iterative difference result.
Input matching for baud rate continuous communication protocols: in the comparison of the level widths, there is a case where the values of the minute deviations should be theoretically equal to each other but actually have the minute deviations due to the influence of errors such as measurement errors and pulse width errors, and it is necessary to consider how the values of the minute deviations are classified into the same value. In contrast to the situation where there are a limited number of common baud rates, the possible values of baud rates for such protocols may in theory be any value, so that there is no so-called central value, and each measured value may be a standard, unbiased value. The processing is to take the first obtained number as a central value, and if the subsequent obtained number falls in the range divided by the central value, the subsequent obtained number is considered as the same value, so that the signal under a certain baud rate can be correctly received by using similar baud rates, and the result is not influenced by slight deviation of the central value. The specific implementation scheme is mainly 2, namely, the last n bits of the counter are ignored, and the specified deviation is considered to be the same within a certain proportion. The former is fixed value deviation correction, which leads to large value misjudgment due to large adaptive baud rate range span of target design, and the same value is written in; the latter is a fixed ratio deviation correction, considering that deviations within 1/16 are considered to be the same value, so that it is possible to prevent writing deviations that are small, values that should theoretically be equal, from causing the final baud rate determination result to be a large value. For a communication protocol in which the baud rate is changeable, when a preset ratio condition is satisfied, a minimum level width may be determined from among the level widths satisfying the preset ratio condition, thereby determining the target baud rate.
Iterative difference: the simplest utilization mode of the low level width is that the smallest one after receiving all possible widths is necessarily corresponding to 1bit, the baud rate is equal to the reciprocal of the smallest one, but the efficiency is extremely low, and if one of the widths does not appear, the lowest one is not judged all the time; and iterative differencing can make the most efficient use of these widths. Taking the low level widths of 1, 5 measured on the CAN bus as an example, we CAN obtain 5 possible widths by iterative subtraction, and the baud rate is obtained immediately. For any set of low level widths, the iterative differencing maximizes the utilization of the data until no new values appear, and maximizes the efficiency in the utilization of the low level widths. When the iterative difference is obtained as a new value, the minimum level width is found out from the obtained low level width and the difference obtained by the iterative difference. And when the iteration difference cannot obtain a new value, returning to the step of measuring the low level width.
Finding the minimum level width: and finding out the minimum level width from the obtained low level width and difference result.
Minimum level width matching: for a communication protocol with a limited number of common baud rates, there may be some values that fall in the matching gap after input matching due to excessive deviation or other reasons. The iterative difference between these values makes it possible to produce baud rate values that differ somewhat from the standard value of the minimum level width at several baud rates. Although the value thus obtained may be erroneous and should be discarded, there are cases where it can be utilized. In order to maximize the efficiency of the baud rate adaptive judgment, output matching is increased, and the minimum level width value obtained in the previous case is matched to the central value of the corresponding standard baud rate.
Since no error processing is performed on the value of the matching gap in the input matching, the adaptive phase is entered, and the set_error processing is required when the adaptive result cannot be matched. For example, 171 and 65 are values of matching gap at the input, the minimum value is 65 after the adaptation process is completed, the result matching cannot be completed, set_error is reported, and the channel is closed. Since the values of these gaps do not match with the input, the situation is still numerous, most of them will still fall in the gap of the result match after the adaptation process is completed, and set_error will be reported. And after the values of the gap between the input matching positions are self-adaptive for some reasons, the output result falls in the result matching area, the result can be solved, the channel can not be naturally closed by reporting the error, and if the result can be solved, the result is correct.
Target baud rate: and taking the baud rate corresponding to the minimum level width as a target baud rate.
And (3) a controller: the controller obtains a target baud rate and communicates between the devices based on the target baud rate.
In this embodiment, taking a limited number of baud rate communication protocols as an example, the cases that cannot be determined in one frame can only be the cases of 2, 4 and 4, 8 in table 6 or table 7, and only 2 values and the difference between 2 values are not new values, so that it cannot be determined, and 10000 times of tests are performed in order to evaluate the probability of occurrence of such cases. It can be seen that 9989 times of finishing baud rate setting in 10000 tests (last rst more, so the last rst times in the figure are 10002) are performed, the error judgment is only 12 times, the probability of special cases is about 0.12%, and the probability is a quite low value and is allowable. Whereas for communication protocols with variable baud rates, the probability of determining the target baud rate in the above manner is as high as 93.9%. Therefore, the efficiency of the baud rate can be improved while ensuring the accuracy rate.
It should be understood that, although the steps in the flowcharts of fig. 2 and 4 described above are sequentially shown as indicated by arrows, and the steps in steps (a 1) to (a 16) are sequentially shown as indicated by numerals, these steps are not necessarily sequentially performed in the order indicated by the arrows or numerals. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in fig. 2 and 4 may include a plurality of steps or stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily sequential, but may be performed in rotation or alternatively with at least a portion of the steps or stages in other steps or other steps thereof.
In one embodiment, as shown in fig. 5, a block diagram of a baud rate adaptive device in one embodiment, the device includes a first obtaining module 502, a second obtaining module 504, an iterative subtraction module 506, a baud rate determining module 508, and a communication module 510, where:
A first obtaining module 502, configured to obtain a first level width between adjacent transition edges;
a second obtaining module 504, configured to obtain a second level width between adjacent transition edges in the backward direction; the first level width and the second level width are different;
an iterative difference making module 506, configured to iteratively make a difference between the first level width and the second level width to obtain a target level width set;
a baud rate determining module 508 for determining a target baud rate of the communication between the devices based on the set of target level widths;
a communication module 510 for communicating based on the target baud rate.
According to the baud rate self-adaptive device, the first level width and the second level width are obtained, and the difference is iterated, so that the obtained level widths can be fully utilized to obtain a plurality of level widths, new level width values do not need to be kept waiting all the time, and the baud rate can be quickly obtained through the plurality of level widths.
In one embodiment, the set of target level widths includes a difference value obtained by iterative differencing, a first level width, and a second level width. A baud rate determining module 508, configured to determine a minimum level width from the first level width, the second level width, and the difference value when the difference value is different from both the first level width and the second level width;
Determining the baud rate corresponding to the minimum level width;
and taking the baud rate corresponding to the minimum level width as a target baud rate of communication between the devices.
In this embodiment, it is found by analysis that there are (2n+1) level widths for a communication protocol having a limited baud rate, such as CAN protocol. When the (n+1) level widths are obtained, an odd number can be necessarily obtained, and then the minimum level width can be obtained by iterative subtraction, so that the baud rate corresponding to the minimum level width can be used as the target baud rate.
In one embodiment, the baud rate determining module 508 is configured to obtain a third level width when the number of the target level width set is less than three; the third level width is the level width between adjacent jump edges backward to the second level width; the third level width is different from both the first level width and the second level width;
performing iterative difference making according to the target level width set and the third level width until no new value is iterated, and obtaining a plurality of level widths;
determining a minimum level width from the plurality of level widths;
and determining the baud rate corresponding to the minimum level width, and obtaining the target baud rate of the communication between the devices.
In this embodiment, when the number value included in the target level width set is smaller than three, a third level width different from the first level width and the second level width is obtained, so that the condition of (n+1) can be basically satisfied, and the baud rate adaptive accuracy and the baud rate adaptive efficiency are improved.
In one embodiment, the baud rate determining module 508 is configured to perform width matching on the minimum level width, and determine a reference level width corresponding to the minimum level width; and determining a reference baud rate corresponding to the reference level width.
In this embodiment, the minimum level width is subjected to width matching, and the reference level width corresponding to the minimum level width is determined, so that the error of the minimum level width can be reduced to match the upper standard level width, and the reference baud rate corresponding to the reference level width is determined, so that the correct baud rate can be obtained.
In one embodiment, the set of target level widths includes differences resulting from the iterative differencing. The baud rate determining module 508 is configured to, when a target difference value in a preset level width set is obtained during iterative differencing, use a baud rate corresponding to the target difference value as a target baud rate of communication between devices; the preset level widths in the preset level width set have and correspond to only one baud rate.
In this embodiment, when the target difference value in the preset level width set is obtained during iterative subtraction, the baud rate corresponding to the target difference value is taken as the target baud rate, so that the target baud rate can be obtained without performing iterative subtraction, and the baud rate adaptive efficiency is improved.
In one embodiment, the second obtaining module 504 is configured to obtain the second level width between adjacent transition edges in the backward direction when the first level width is not in the preset level width set. The preset level widths in the preset level width set have and correspond to only one baud rate.
In this embodiment, when the first level width is not in the preset level width set, it is explained that the target baud rate cannot be determined only by the first level width, so that the baud rate adaptation needs to be performed in combination with the second level width between the adjacent backward transition edges.
In one embodiment, the baud rate determining module 508 is further configured to, when the first level width is in the preset level width set, use the baud rate corresponding to the first level width as the target baud rate of the communication between the devices.
In this embodiment, when the first level width is in the preset level width set, it is described that the target baud rate can be determined only by the first level width, so as to improve the baud rate adaptive efficiency.
In one embodiment, the baud rate self-adaptive device further comprises an alarm module, wherein the alarm module is used for monitoring the level width of the waveform obtained on the bus;
when the abnormal width is determined to occur based on the level width of the waveform, an alarm signal is sent out;
the first acquisition module 502 is further configured to re-perform acquisition of the first level width between adjacent transition edges.
In this embodiment, after the baud rate adaptation is completed, whether the waveform obtained on the bus has an abnormal pulse width that is too long or too short can be monitored, if the abnormal pulse width occurs, an error can be reported to the controller, and the device can be reset when needed, and the adaptive baud rate can be restarted.
For specific limitations of the baud rate adaptation means, reference may be made to the limitations of the baud rate adaptation method hereinabove, and no further description is given here. The respective modules in the baud rate adaptive device described above may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal device, and the internal structure thereof may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a baud rate adaptation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the baud rate adaptive method embodiments described above when the computer program is executed.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the baud rate adaptation method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods in accordance with the embodiments may be accomplished by way of a computer program stored in a non-transitory computer readable storage medium, which when executed may comprise the steps of the above described embodiments of the methods. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Ramdom Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the invention, and all equivalent structures or equivalent processes using the descriptions and drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the invention.

Claims (9)

1. A baud rate adaptation method, the method comprising:
acquiring a first level width between adjacent jump edges;
acquiring a second level width between adjacent backward jump edges; the first level width and the second level width are different;
performing iterative subtraction on the first level width and the second level width to obtain a target level width set; the target level width set comprises a difference value obtained by iterative difference, the first level width and the second level width; the iterative difference making refers to a process of obtaining a non-repeated difference value by making a difference for a plurality of times;
determining a minimum level width from the first level width, the second level width, and the difference when at least one of the differences is different from both the first level width and the second level width;
when the number value contained in the target level width set is smaller than three, acquiring a third level width; the third level width is the level width between adjacent jump edges backward to the second level width; the third level width is different from both the first level width and the second level width;
Performing iterative difference according to the target level width set and the third level width until no new value is iterated, and obtaining a plurality of level widths;
determining a minimum level width from the plurality of level widths; determining the baud rate corresponding to the minimum level width;
taking the baud rate corresponding to the minimum level width as a target baud rate of communication between devices;
and communicating based on the target baud rate.
2. The method of claim 1, wherein determining the baud rate corresponding to the minimum level width comprises:
performing width matching on the minimum level width, and determining a reference level width corresponding to the minimum level width;
and determining the reference baud rate corresponding to the reference level width.
3. The method according to claim 1, wherein the method further comprises:
when a target difference value in a preset level width set is obtained during iterative differencing, taking the baud rate corresponding to the target difference value as a target baud rate of communication between devices; the preset level width in the preset level width set is one and corresponds to only one baud rate.
4. The method of claim 1, wherein the acquiring a second level width between adjacent transition edges in the backward direction comprises:
When the first level width is not in the preset level width set, acquiring a second level width between backward adjacent jump edges; the preset level width in the preset level width set is one and corresponds to only one baud rate.
5. The method according to claim 4, wherein the method further comprises:
and when the first level width is in the preset level width set, taking the baud rate corresponding to the first level width as a target baud rate of communication between devices.
6. The method of claim 1, wherein after the communicating based on the target baud rate, the method further comprises:
monitoring the level width of the waveform obtained on the bus;
when the abnormal width is determined to occur based on the level width of the waveform, an alarm signal is sent out and the step of acquiring the first level width between the adjacent jump edges is re-executed.
7. A baud rate adaptation device, the device comprising:
the first acquisition module is used for acquiring a first level width between adjacent jump edges;
the second acquisition module is used for acquiring a second level width between the backward adjacent jump edges; the first level width and the second level width are different;
The iterative difference making module is used for carrying out iterative difference making on the first level width and the second level width to obtain a target level width set; the target level width set comprises a difference value obtained by iterative difference, the first level width and the second level width; the iterative difference making refers to a process of obtaining a non-repeated difference value by making a difference for a plurality of times;
the baud rate determining module is used for:
determining a minimum level width from the first level width, the second level width, and the difference when at least one of the differences is different from both the first level width and the second level width;
when the number value contained in the target level width set is smaller than three, acquiring a third level width; the third level width is the level width between adjacent jump edges backward to the second level width; the third level width is different from both the first level width and the second level width;
performing iterative difference according to the target level width set and the third level width until no new value is iterated, and obtaining a plurality of level widths;
determining a minimum level width from the plurality of level widths;
Determining the baud rate corresponding to the minimum level width;
taking the baud rate corresponding to the minimum level width as a target baud rate of communication between devices;
and the communication module is used for communicating based on the target baud rate.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202111306733.4A 2021-11-05 2021-11-05 Baud rate self-adaption method, device, computer equipment and storage medium Active CN114024795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111306733.4A CN114024795B (en) 2021-11-05 2021-11-05 Baud rate self-adaption method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111306733.4A CN114024795B (en) 2021-11-05 2021-11-05 Baud rate self-adaption method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114024795A CN114024795A (en) 2022-02-08
CN114024795B true CN114024795B (en) 2023-08-08

Family

ID=80061602

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111306733.4A Active CN114024795B (en) 2021-11-05 2021-11-05 Baud rate self-adaption method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114024795B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116155645B (en) * 2023-02-27 2023-09-22 上海中韩杜科泵业制造有限公司 CAN bus-based equipment network access method, device, equipment and medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201960A (en) * 2011-04-28 2011-09-28 华南理工大学 Baud rate adaptive method based on sequencing pulse width differential
CN107038135A (en) * 2017-03-24 2017-08-11 深圳市顺讯电子有限公司 A kind of serial port baud rate Adaptable System and method
CN107368446A (en) * 2016-11-24 2017-11-21 天地融科技股份有限公司 A kind of configured transmission adaptive data transmission method and device
CN109274567A (en) * 2018-09-27 2019-01-25 潍柴动力股份有限公司 A kind of adaptive approach and system of baud rate
CN110581814A (en) * 2019-09-06 2019-12-17 惠州志顺电子实业有限公司 Baud rate adjusting method of communication equipment and communication equipment
CN110618729A (en) * 2018-06-19 2019-12-27 迈普通信技术股份有限公司 Baud rate generator, communication equipment and generation method of Baud rate clock signal
CN111211869A (en) * 2020-01-02 2020-05-29 深圳震有科技股份有限公司 Method for automatically adapting baud rate, intelligent terminal and storage medium
CN111427818A (en) * 2020-03-26 2020-07-17 重庆智慧水务有限公司 Method for identifying serial port communication baud rate and readable storage medium
CN111431783A (en) * 2020-04-02 2020-07-17 希尔塔(苏州)信息技术有限公司 CAN bus baud rate self-adaption method
CN112751738A (en) * 2020-12-29 2021-05-04 北京万集智能网联技术有限公司 Baud rate self-adaption method and device, computer equipment and readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4327764B2 (en) * 2005-04-28 2009-09-09 Necエレクトロニクス株式会社 Data receiving apparatus, sync signal detecting method and program
US7447262B2 (en) * 2005-05-12 2008-11-04 Rdc Semiconductor Co., Ltd. Adaptive blind start-up receiver architecture with fractional baud rate sampling for full-duplex multi-level PAM systems
JP5238369B2 (en) * 2008-06-17 2013-07-17 ルネサスエレクトロニクス株式会社 Data receiving apparatus, data receiving method, and data receiving program
US10038569B2 (en) * 2016-03-29 2018-07-31 Intel IP Corporation Self-adapting baud rate

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102201960A (en) * 2011-04-28 2011-09-28 华南理工大学 Baud rate adaptive method based on sequencing pulse width differential
CN107368446A (en) * 2016-11-24 2017-11-21 天地融科技股份有限公司 A kind of configured transmission adaptive data transmission method and device
CN107038135A (en) * 2017-03-24 2017-08-11 深圳市顺讯电子有限公司 A kind of serial port baud rate Adaptable System and method
CN110618729A (en) * 2018-06-19 2019-12-27 迈普通信技术股份有限公司 Baud rate generator, communication equipment and generation method of Baud rate clock signal
CN109274567A (en) * 2018-09-27 2019-01-25 潍柴动力股份有限公司 A kind of adaptive approach and system of baud rate
CN110581814A (en) * 2019-09-06 2019-12-17 惠州志顺电子实业有限公司 Baud rate adjusting method of communication equipment and communication equipment
CN111211869A (en) * 2020-01-02 2020-05-29 深圳震有科技股份有限公司 Method for automatically adapting baud rate, intelligent terminal and storage medium
CN111427818A (en) * 2020-03-26 2020-07-17 重庆智慧水务有限公司 Method for identifying serial port communication baud rate and readable storage medium
CN111431783A (en) * 2020-04-02 2020-07-17 希尔塔(苏州)信息技术有限公司 CAN bus baud rate self-adaption method
CN112751738A (en) * 2020-12-29 2021-05-04 北京万集智能网联技术有限公司 Baud rate self-adaption method and device, computer equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于迭代和修正的波特率自适应算法;方利缘等;《探测与控制学报》;20110226(第01期);全文 *

Also Published As

Publication number Publication date
CN114024795A (en) 2022-02-08

Similar Documents

Publication Publication Date Title
CN107147553B (en) Method, device and equipment for adjusting Baud rate and frame format of slave station
CN105468662B (en) Energy consumption data processing method and system based on table code values
CN114024795B (en) Baud rate self-adaption method, device, computer equipment and storage medium
JP2001352350A (en) Measurement system and method by statistic eye-diagram of continuous bit stream
CN108170630B (en) Serial port communication baud rate self-adaption method, system and equipment
CN112069098B (en) Baud rate identification method and device
CN111813638B (en) Alarm information processing method and device and terminal equipment
WO2022089035A1 (en) Communication method and related device
CN115658408A (en) Sensor state detection method and device and readable storage medium
CN114039807B (en) Baud rate self-adaption method, device, computer equipment and storage medium
CN109743228A (en) A kind of measuring method and system of sampling point position
JP5250505B2 (en) Mobile communication device test system and test method
CN111007709A (en) Method, device and system for detecting daily timing error of electric energy meter
CN111611186B (en) Transmission control method and device in embedded chip
CN109582378A (en) A kind of starting up's method, apparatus, equipment and storage medium
US9143247B2 (en) Wireless communication method and apparatus
CN116915367B (en) Data detection method, storage medium and electronic device
TW200303676A (en) System for providing a calibrated clock and methods thereof
CN110557223A (en) Detection method and terminal for Physical Downlink Control Channel (PDCCH)
CN111427818A (en) Method for identifying serial port communication baud rate and readable storage medium
CN112468423B (en) Signal decoding method, signal decoding device, electronic equipment and storage medium
CN114024882B (en) Router performance test method, device, system and storage medium
CN116742763B (en) Fast charging protocol chip, method executed by fast charging protocol chip and electronic equipment
CN116582772B (en) Electric energy data acquisition method, system, electronic equipment and medium
CN116312682B (en) Eye pattern center determining method and device, electronic equipment and storage medium

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