Baud rate calibration method and circuit, storage medium and electronic equipment

Through a baud rate calibration method, the third baud rate calibration value is determined using the initial value and the calibration value of multiple data frames, which solves the problem of data transmission failure caused by baud rate differences in asynchronous communication, and improves the robustness and stability of data transmission.

CN120090765AActive Publication Date: 2025-06-03合肥智芯半导体有限公司 +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510565416.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-06-03
Estimated Expiration
2045-04-30

AI Technical Summary

Technical Problem

In asynchronous transceiver communication, the uncertainty of external environmental factors and clock crystal oscillator accuracy leads to the failure of data transmission between the transmitter and receiver of the bus system, especially when the baud rate difference between two adjacent data frames is large.

Method used

A baud rate calibration method is proposed, by calibrating the baud rate used for data transmission using the baud rate initial value and the synchronization segment of the current data frame, generating a first baud rate calibration value, and determining the third baud rate calibration value based on the initial value, the first baud rate calibration value and the second baud rate calibration value to enhance the data transmission robustness between multiple data frames.

Benefits of technology

Through this method, the data transmission robustness between multiple data frames in asynchronous communication is improved, communication failure caused by baud rate differences is reduced, and data transmission stability is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120090765A_ABST
    Figure CN120090765A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of asynchronous communication, and discloses a baud rate calibration method and circuit, a storage medium and electronic equipment, and the method comprises the steps: calibrating a baud rate used for data transmission through employing a baud rate initial value and a current data frame synchronization segment, and generating a first baud rate calibration value; a third baud rate calibration value is determined according to the baud rate initial value, the first baud rate calibration value and a second baud rate calibration value, the third baud rate calibration value is used for completing transmission of the current data frame data segment, and the second baud rate calibration value is the baud rate used for transmission of the previous data frame data segment. According to the method, the Baud rate calibration value used by the data segment of the current data frame is compensated and adjusted by using the Baud rate initial value, the first Baud rate calibration value and the Baud rate used by the data segment transmission of the previous data frame, so that the robustness of data transmission among a plurality of data frames in the transmission task is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of asynchronous communication, and in particular, to a baud rate calibration method, circuit, storage medium, and electronic device. Background Art

[0002] In asynchronous transceiver communication, external environmental factors and the accuracy of its own clock oscillator will affect data transmission between the transmitter of the bus and the receiver of the bus. The receiver receives incorrect data, resulting in communication transmission failure. A single transmission task in asynchronous communication usually includes multiple data frames, and each data frame includes a synchronization segment and subsequent data segments. After the transmission task is started, the receiver of the bus system generally calibrates the baud rate by collecting regular data sent by the transmitter based on the synchronization segment of the data frame, so as to achieve synchronous transmission between the transmitter and the receiver in the bus system and receive and transmit subsequent data segments.

[0003] Once the baud rates of two adjacent data frames of the bus system transmitter differ greatly, the baud rate calibration value of the previous data frame may not be able to detect the synchronization segment and data segment of the next data frame, resulting in communication failure of the bus system. Summary of the Invention

[0004] The present invention aims to at least solve one of the technical problems in the related art to some extent. To this end, an object of the present invention is to propose a baud rate calibration method, which enhances the robustness of data transmission between multiple data frames in a transmission task.

[0005] A second object of the present invention is to propose a baud rate calibration circuit.

[0006] A third object of the present invention is to propose a computer-readable storage medium.

[0007] A fourth object of the present invention is to propose an electronic device.

[0008] To achieve the above object, an embodiment of the first aspect of the present invention proposes a baud rate calibration method, the method including: calibrating the baud rate used for data transmission by using the initial baud rate and the synchronization segment of the current data frame to generate a first baud rate calibration value; determining a third baud rate calibration value according to the initial baud rate, the first baud rate calibration value, and a second baud rate calibration value, so as to complete the transmission of the data segment of the current data frame by using the third baud rate calibration value, where the second baud rate calibration value is the baud rate used for the transmission of the data segment of the previous data frame.

[0009] According to the baud rate calibration method of the embodiment of the present invention, by compensating and adjusting the first baud rate calibration value by using the initial baud rate and the second baud rate calibration value, the robustness of data transmission between multiple data frames in a transmission task is enhanced.

[0010] In addition, the baud rate calibration method proposed according to the above embodiments of the present invention may further have the following additional technical features: According to an embodiment of the present invention, determining the third baud rate calibration value according to the baud rate initial value, the first baud rate calibration value, and the second baud rate calibration value includes: obtaining the baud rate initial value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N-1 of the second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and calculating the third baud rate calibration value.

[0011] According to an embodiment of the present invention, obtaining the baud rate initial value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N-1 of the second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and calculating the third baud rate calibration value includes: if m = 1, obtaining the baud rate initial value and its influence ratio target value and the first baud rate calibration value and its influence ratio target value, and calculating the third baud rate calibration value; if m < N, obtaining the baud rate initial value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, the first m-1 of the second baud rate calibration values of the current data frame and their corresponding influence ratio target values, and calculating the third baud rate calibration value; if m ≥ N, obtaining the first baud rate calibration value and its influence ratio target value, the first N-1 of the second baud rate calibration values of the current data frame and their corresponding influence ratio target values, and calculating the third baud rate calibration value.

[0012] According to an embodiment of the present invention, the influence ratio target value includes an influence ratio generation value and an influence ratio preset value. Obtaining the initial baud rate value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N-1 second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames includes: determining whether the influence ratio automatic generation function is enabled; if enabled, using an influence ratio generation algorithm, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, generating the influence ratio generation value of the initial baud rate value, the influence ratio generation value of the first baud rate calibration value, and / or at most N-1 influence ratio generation values of the second baud rate calibration values, and recording the influence ratio generation value as the influence ratio target value; if not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtaining the influence ratio preset value of the initial baud rate value, the influence ratio preset value of the first baud rate calibration value, and / or at most N-1 influence ratio preset values corresponding to the second baud rate calibration values, and recording the influence ratio preset value as the influence ratio target value.

[0013] According to an embodiment of the present invention, the influence ratio preset value generation algorithm includes at least one of a difference range and influence ratio look-up table method, a difference and influence ratio function algorithm, and a balance filling algorithm.

[0014] According to an embodiment of the present invention, the method further includes: when it is determined that the third baud rate calibration value is greater than the preset baud rate calibration allowable range of the data segment, recording a synchronization segment baud rate calibration operation error event of the data frame.

[0015] To achieve the above object, an embodiment of the second aspect of the present invention proposes a baud rate calibration circuit, which includes: a first baud rate calibration module for calibrating the baud rate used for data transmission by using the initial baud rate value and the synchronization segment of the current data frame to generate a first baud rate calibration value; a second baud rate calibration module for determining a third baud rate calibration value according to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value to complete the transmission of the data segment of the current data frame by using the third baud rate calibration value, where the second baud rate calibration value is the baud rate used for the data segment transmission of the previous data frame; a baud rate recording module connected to the first baud rate calibration module and the second baud rate calibration module for recording the first baud rate calibration value generated by the first baud rate calibration module, the second baud rate calibration value, and the third baud rate calibration value generated by the second baud rate calibration module.

[0016] According to the baud rate calibration circuit of the embodiment of the present invention, a second baud rate calibration module is used to compensate and adjust the baud rate calibration value used in the current data frame data segment according to the baud rate initial value, the first baud rate calibration value and the baud rate used in the previous data frame data segment transmission, thereby enhancing the robustness of data transmission between multiple data frames in the transmission task.

[0017] In addition, the baud rate calibration circuit proposed in the above embodiment of the present invention may also have the following additional technical features: According to one embodiment of the present invention, the second baud rate calibration module includes: a baud rate generating unit connected to the baud rate recording module, used to obtain the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value and / or up to N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​according to the transmission order m of the current data frame and the preset number of valid previous data frames N, and calculate the third baud rate calibration value; an impact weight selection unit connected to the baud rate generating unit, used to send the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value and / or up to N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​to the baud rate generating unit, wherein when the automatic generation function of the impact weight is not enabled, the impact weight preset value of the baud rate initial value, the impact weight preset value of the first baud rate calibration value and / or up to N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​are obtained according to the transmission order m of the current data frame and the preset number of valid previous data frames N. The preset value of the impact ratio is obtained, and the preset value of the impact ratio is recorded as the target value of the impact ratio; when the automatic generation function of the impact ratio is enabled, according to the transmission order m of the current data frame and the preset valid number N of the previous data frames, the impact ratio generation value of the baud rate initial value, the impact ratio generation value of the first baud rate calibration value and / or the impact ratio generation value of up to N-1 second baud rate calibration values ​​are obtained, and the impact ratio generation value is recorded as the target value of the impact ratio; the automatic generation unit of the impact ratio is connected to the impact ratio selection unit Connecting, it is used to adopt the impact ratio generation algorithm when the impact ratio automatic generation function is enabled, and generate the impact ratio generation value of the baud rate initial value, the impact ratio generation value of the first baud rate calibration value and / or up to N-1 impact ratio generation values ​​of the second baud rate calibration value according to the transmission order m of the current data frame and the preset valid number N of the previous data frames; the baud rate threshold detection unit is used to record the synchronization segment baud rate calibration operation error event of the data frame when it is determined that the third baud rate calibration value is greater than the preset data segment baud rate calibration allowable range.

[0018] To achieve the above object, an embodiment of the third aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the baud rate calibration method proposed in the embodiment of the first aspect of the present invention is implemented.

[0019] To achieve the above object, an embodiment of the fourth aspect of the present invention provides an electronic device, including a memory and a processor. A computer program is stored on the memory. When the computer program is executed by the processor, the baud rate calibration method proposed in the embodiment of the first aspect of the present invention is implemented.

[0020] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of the baud rate calibration method according to an embodiment of the present invention; Figure 2 is the flowchart of the baud rate calibration method according to a specific embodiment of the present invention Figure 1 ; Figure 3 is the flowchart of the baud rate calibration method according to a specific embodiment of the present invention Figure 2 ; Figure 4 is a schematic diagram of the difference filling algorithm according to a specific embodiment of the present invention; Figure 5 is the flowchart of the baud rate calibration method according to a specific embodiment of the present invention Figure 3 ; Figure 6 is a schematic diagram of the baud rate calibration circuit according to an embodiment of the present invention; Figure 7 Schematic diagram of the second baud rate calibration module according to an embodiment of the present invention; Figure 8 is a block diagram of the structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0022] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and are intended to explain the present invention and should not be construed as limiting the present invention.

[0023] The baud rate calibration method, circuit, storage medium, and electronic device according to the embodiments of the present invention will be described in detail below with reference to the accompanying drawings of the specification and specific embodiments.

[0024] Figure 1It is a flowchart of the baud rate calibration method according to an embodiment of the present invention. As Figure 1 shown, the baud rate calibration method may include: S101, calibrating the baud rate used for data transmission by using the initial baud rate and the synchronization segment of the current data frame to generate a first baud rate calibration value; S102, determining a third baud rate calibration value according to the initial baud rate, the first baud rate calibration value, and the second baud rate calibration value to complete the transmission of the data segment of the current data frame by using the third baud rate calibration value, where the second baud rate calibration value is the baud rate used for the transmission of the data segment of the previous data frame.

[0025] It should be noted that a bus system transmission task includes at least one data frame. A data frame consists of a synchronization segment and a data segment. The synchronization segment is in the front and is used to synchronize the transmitter and the receiver in asynchronous communication. The data segment is in the back and represents the actual transmitted information. The baud rate used for data transmission is the baud rate after calibration of the synchronization segment.

[0026] To avoid the problem that the communication of the bus system fails due to a large difference in the baud rate between two adjacent data frames of the bus system transmitter, the embodiment of the present invention performs in-frame baud rate calibration on each data frame in the bus system transmission task, and performs inter-frame baud rate calibration based on the in-frame baud rate calibration result (the first baud rate calibration value), so as to perform the transmission of the data segment of the data frame according to the inter-frame baud rate calibration result (the third baud rate calibration value), improving the baud rate calibration accuracy during the data frame transmission process.

[0027] Before starting the system transmission task, set the initial baud rate BI. After starting the system transmission task, perform in-frame baud rate calibration on the current data frame according to the initial baud rate BI, and perform inter-frame baud rate calibration based on the in-frame baud rate calibration result to determine the baud rate used for the transmission of the data segment of the current data frame, that is, determine the third baud rate calibration value.

[0028] Specifically, starting from the transmission of the first data frame of the transmission task, calibrate the baud rate used for data transmission by using the initial baud rate BI and the synchronization segment of the current data frame. Implementably, usually the data frame synchronization segment information is an 8-bit special data, such as 0x55 / 0xAA. Inside the bus system receiver, according to this 8-bit data of the data frame synchronization segment and in combination with the initial baud rate BI, calibrate the baud rate of the current data frame itself (the current data frame synchronization segment) to generate a first baud rate calibration value BC0, and save the generated first baud rate calibration value BC0 in the bus system for use in the subsequent data segment data transmission of the current data frame.

[0029] Perform baud rate calibration between data frames based on the initial baud rate BI, the first baud rate calibration value BC0, and the second baud rate calibration value to generate a third baud rate calibration value BC1, so as to complete the transmission of subsequent data segments of the current data frame using the third baud rate calibration value BC1. It should be noted that after the baud rate calibration between data frames is completed, the generated third baud rate calibration value BC1 will be used for the data transmission of the data segment of the current data frame until the transmission of this data frame ends.

[0030] Before starting the transmission of the next data frame, the initial baud rate BI of the bus system can be adjusted by software as the baud rate for detecting the synchronization segment of the next data frame, or the third baud rate calibration value BC1 can be directly used as the baud rate for detecting the synchronization segment of the next data frame.

[0031] It should be noted that the baud rate calibration between data frames is based on the baud rate calibration result within the data frame. Therefore, the baud rate calibration within the data frame will be performed each time a data frame is transmitted. That is, the baud rate calibration within the data frame will occur in the synchronization segment of each data frame, and based on the baud rate calibration within this data frame, the baud rate calibration operation between data frames will be performed to obtain the baud rate calibration value between this data frame, and the data segment of each data frame will perform data transmission according to the baud rate calibration value between this data frame.

[0032] In an embodiment of the present invention, before determining the third baud rate calibration value according to the initial baud rate, the first baud rate calibration value, and the second baud rate calibration value, the baud rate calibration method further includes: determining the enable of the baud rate calibration between data frames.

[0033] Specifically, as Figure 2 shown, before performing the baud rate calibration between data frames, it is judged whether the enable of the baud rate calibration between data frames is enabled. If the enable of the baud rate calibration between data frames is enabled, then according to the initial baud rate BI, the first baud rate calibration value BC0, and the second baud rate calibration value, the third baud rate calibration value BC1 is calculated. If the baud rate calibration between data frames is not enabled, the first baud rate calibration value BC0 is recorded as the third baud rate calibration value BC1 to complete the transmission of subsequent data segments of the current data frame using the third baud rate calibration value BC1, that is, to complete the transmission of subsequent data segments of the current data frame using the first baud rate calibration value BC0.

[0034] Implementably, by software configuring the enable situation of the baud rate calibration between data frames, the flexibility of applying the baud rate calibration method in the embodiment of the present invention is increased, and at the same time, it is compatible with the communication behavior of the general bus system.

[0035] In an embodiment of the present invention, determining the third baud rate calibration value according to the initial baud rate, the first baud rate calibration value, and the second baud rate calibration value may include: Obtain the initial baud rate value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and calculate the third baud rate calibration value.

[0036] It should be noted that the preset number N of valid previous data frames can be set according to actual needs. Exemplarily, the preset number N of valid previous data frames can be 2, 4, 8, etc.

[0037] Specifically, obtain the initial baud rate value BI, the first baud rate calibration value BC0, and / or at most N - 1 second baud rate calibration values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and synchronously obtain the influence ratio target value of the initial baud rate value, the influence ratio target value of the first baud rate calibration value BC0, and / or the influence ratio target values corresponding to at most N - 1 second baud rate calibration values.

[0038] Using the preset baud rate calibration value algorithm, calculate the third baud rate calibration value BC1 according to the initial baud rate value BI and its influence ratio target value, the first baud rate calibration value BC0 and its influence ratio target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence ratio preset values, which can greatly reduce the influence caused by abnormal changes in the baud rate and reduce the consumption of software resources at the same time.

[0039] In an embodiment of the present invention, the precision (unit) of the influence ratio target value is 1 / 16, and the value range of the influence ratio target value is [0, 15] (in units of 1 / 16).

[0040] In an embodiment of the present invention, obtaining the initial baud rate value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and calculating the third baud rate calibration value may include: If m = 1, then obtain the initial baud rate value and its influence ratio target value and the first baud rate calibration value and its influence ratio target value, and calculate the third baud rate calibration value; If m < N, then obtain the initial baud rate value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, the first n - 1 second baud rate calibration values before the current data frame and their corresponding influence ratio target values, and calculate the third baud rate calibration value; If m ≥ N, then obtain the first baud rate calibration value and its influence ratio target value, the first N - 1 second baud rate calibration values before the current data frame and their corresponding influence ratio target values, and calculate the third baud rate calibration value.

[0041] Specifically, for the first data frame in the transmission task, obtain the initial baud rate BI and the first baud rate calibration value BC0, and synchronously obtain the influence ratio target value of the initial baud rate and the influence ratio target value of the first baud rate calibration value. Using a preset baud rate calibration value algorithm, calculate the third baud rate calibration value BC1 according to the initial baud rate and its influence ratio target value, the first baud rate calibration value and its influence ratio target value.

[0042] For the second data frame and subsequent data frames in the transmission task, calculate the third baud rate calibration value BC1 according to the size relationship between the transmission order m of the current data frame and the preset number N of valid previous data frames.

[0043] When m < N, obtain the initial baud rate, the first baud rate calibration value, and the first n - 1 second baud rate calibration values of the current data frame, and synchronously obtain the influence ratio target value of the initial baud rate, the influence ratio target value of the first baud rate calibration value, and the influence ratio target values corresponding to the first m - 1 second baud rate calibration values of the current data frame. Using a preset baud rate calibration value algorithm, calculate the third baud rate calibration value BC1 according to the initial baud rate and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and the first m - 1 second baud rate calibration values of the current data frame and their corresponding influence ratio target values.

[0044] When m ≥ N, obtain the first baud rate calibration value and the first N - 1 second baud rate calibration values of the current data frame, and synchronously obtain the influence ratio target value of the first baud rate calibration value and the influence ratio target values corresponding to the first N - 1 second baud rate calibration values of the current data frame. Using a preset baud rate calibration value algorithm, calculate the third baud rate calibration value BC1 according to the first baud rate calibration value and its influence ratio target value, the first N - 1 second baud rate calibration values of the current data frame and their corresponding influence ratio target values.

[0045] In the embodiments of the present invention, for different configurations of the preset number N of valid previous data frames, the baud rate calibration operations between data frames are different.

[0046] As an example, when the preset number N of valid previous data frames is 2, for the first data frame in the transmission task, when performing the baud rate calibration operation between data frames, only the initial baud rate BI and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the first data frame, so as to obtain the baud rate used for the transmission of the data segment of the first data frame. For subsequent data frames in the transmission task, when performing the baud rate calibration operation between data frames, only the baud rate used for the transmission of the data segment of the previous data frame of the subsequent data frame and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the subsequent data frame, so as to obtain the baud rate used for the transmission of the data segment of the subsequent data frame.

[0047] As another example, when the preset number N of valid prior data frames is 4, for the first data frame in the transmission task, when performing the baud rate calibration operation between data frames, the initial baud rate BI and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the first data frame, and the baud rate used for the transmission of the data segment of the first data frame is obtained. For the second data frame in the transmission task, the initial baud rate BI and its influence ratio target value, the baud rate used for the transmission of the data segment of the first data frame and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the second data frame, and the baud rate used for the transmission of the data segment of the second data frame is obtained. For the third data frame in the transmission task, the initial baud rate BI and its influence ratio target value, the baud rate used for the transmission of the data segment of the first data frame and its influence ratio target value, the baud rate used for the transmission of the data segment of the second data frame and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the third data frame, and the baud rate used for the transmission of the data segment of the third data frame is obtained. For the fourth data frame in the transmission task, the baud rate used for the transmission of the data segment of the first data frame and its influence ratio target value, the baud rate used for the transmission of the data segment of the second data frame and its influence ratio target value, the baud rate used for the transmission of the data segment of the third data frame and its influence ratio target value are used to adjust the first baud rate calibration value generated in the synchronization segment of the fourth data frame, and the baud rate used for the transmission of the data segment of the fourth data frame is obtained. For subsequent data frames in the transmission task, the baud rate used for the transmission of the data segments of the first three data frames of the subsequent data frame and their corresponding influence ratio target values are used to adjust the first baud rate calibration value generated in the synchronization segment of the subsequent data frame, and the baud rate used for the transmission of the data segment of the subsequent data frame is obtained.

[0048] It should be noted that to determine the baud rates used for transmitting the data segments of the first data frame, the second data frame, and the third data frame in the above example transmission task, the following method can also be adopted: For the first data frame in the transmission task, when performing the baud rate calibration operation between data frames, duplicate the baud rate initial value BI twice, and use three baud rate initial values BI and their influence ratio target values to adjust the first baud rate calibration value generated by the synchronization segment of the first data frame, so as to obtain the baud rate used for transmitting the data segment of the first data frame. For the second data frame in the transmission task, duplicate the baud rate initial value BI once, and use two baud rate initial values BI and their influence ratio target values, and the baud rate used for transmitting the data segment of the first data frame and its influence ratio target value to adjust the first baud rate calibration value generated by the synchronization segment of the second data frame, so as to obtain the baud rate used for transmitting the data segment of the second data frame. For the third data frame in the transmission task, use the baud rate initial value BI and its influence ratio target value, the baud rate used for transmitting the data segment of the first data frame and its influence ratio target value, and the baud rate used for transmitting the data segment of the second data frame and its influence ratio target value to adjust the first baud rate calibration value generated by the synchronization segment of the third data frame, so as to obtain the baud rate used for transmitting the data segment of the third data frame.

[0049] As another example, when the preset number N of valid prior data frames is 8, similar to the case where the preset number of valid prior data frames is 4, the baud rate initial value BI will be used when calculating the baud rates used for transmitting the data segments of the first 7 data frames. The baud rate used for transmitting the data segment of the 8th data frame is obtained based on the baud rates used for transmitting the data segments of its first 7 data frames, their corresponding influence ratio target values, and the first baud rate calibration value generated by the synchronization segment of the 8th data frame. The subsequent baud rate calibration values between data frames are the same as those of the 8th data frame, which will not be elaborated here.

[0050] It should be noted that the baud rate used for transmitting the data segment of a data frame may directly come from the baud rate calibration result within the data frame or the baud rate initial value BI.

[0051] In the embodiments of the present invention, the preset baud rate calibration value algorithms are not limited to the average algorithm with the same influence ratio, the weighted average algorithm with the changing influence ratio, the standard deviation algorithm with the changing influence ratio, etc.

[0052] In a specific example, when m≥N, the average value formula adopted by the average algorithm with the same influence ratio is: BA=(BC0 + B1 + B2 + …… + Bn) / (n + 1), where BA represents the average baud rate calibration value, BC0 represents the first baud rate calibration value, B1, B2, Bn represent the second baud rate calibration values, and n = N - 1.

[0053] In a specific example, using the weighted average algorithm, the third baud rate calibration value BC1 is calculated based on the initial baud rate value BI, the first baud rate calibration value, and the second baud rate calibration value in combination with the corresponding influence weights. Among them, when m≥N, the weighted average algorithm formula is: BA = (BC0*F0 + B1*F1 + B2*F2+……+Bn*Fn) / (n + 1), where BA represents the baud rate calibration value after weighted average, BC0 represents the first baud rate calibration value, F0 represents the influence weight target value of the first baud rate calibration value, B1, B2, Bn represent the second baud rate calibration values, F1, F2, Fn represent the influence weight target values corresponding to the second baud rate calibration values, and n = N - 1.

[0054] It should be noted that the third baud rate calibration value BC1 can also be calculated using the standard deviation algorithm, variance algorithm, etc.

[0055] In a specific example, when m≥N, the standard deviation formula adopted by the standard deviation algorithm is:

[0056] Among them, represents the standard deviation between the calibrated baud rate and the initial baud rate value, F0 represents the influence weight target value of the first baud rate calibration value, BC0 represents the first baud rate calibration value, BA represents the baud rate calibration value after weighted average, F1, F2, Fn represent the influence weight target values corresponding to the second baud rate calibration values, B1, B2, Bn represent the second baud rate calibration values, and n = N - 1. By comparing the relationship between the average value BA of the first baud rate calibration value and the second baud rate calibration value and the initial baud rate value BI, it is determined whether to add this standard deviation or subtract this standard deviation to determine the baud rate used for transmitting the data segment of the data frame.

[0057] In a specific embodiment of the present invention, as Figure 3 shown, the influence weight target value includes an influence weight generation value and an influence weight preset value. According to the transmission order m of the current data frame and the preset number N of valid previous data frames, the initial baud rate value and its influence weight target value, the first baud rate calibration value and its influence weight target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence weight target values are obtained, including: Determine whether the influence weight automatic generation function is enabled; If enabled, the influence ratio generation algorithm is adopted. According to the transmission order m of the current data frame and the preset number N of valid previous data frames, the influence ratio generation value of the baud rate initial value, the influence ratio generation value of the first baud rate calibration value, and / or the influence ratio generation values of at most N-1 second baud rate calibration values are generated, and the influence ratio generation value is recorded as the influence ratio target value. If not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, the preset influence ratio value of the baud rate initial value, the preset influence ratio value of the first baud rate calibration value, and / or the preset influence ratio values corresponding to at most N-1 second baud rate calibration values are obtained, and the preset influence ratio value is recorded as the influence ratio target value.

[0058] Specifically, when determining the influence ratio target value, it is judged whether the influence ratio automatic generation function is enabled. When the influence ratio automatic generation is enabled, the influence ratio generation algorithm is adopted. According to the transmission order m of the current data frame and the preset number N of valid previous data frames, the influence ratio generation value of the baud rate initial value, the influence ratio generation value of the first baud rate calibration value, and / or the influence ratio generation values of at most N-1 second baud rate calibration values are generated. The influence ratio generation value of the baud rate initial value is recorded as the influence ratio target value of the baud rate initial value, the influence ratio generation value of the first baud rate calibration value is recorded as the influence ratio target value of the first baud rate calibration value, and the influence ratio generation value of the second baud rate calibration value is recorded as the influence ratio target value of the second baud rate calibration value.

[0059] When the influence ratio automatic generation is not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, the preset influence ratio value of the baud rate initial value, the preset influence ratio value of the first baud rate calibration value, and / or the preset influence ratio values corresponding to at most N-1 second baud rate calibration values are obtained. The preset influence ratio value of the baud rate initial value is recorded as the influence ratio target value of the baud rate initial value, the preset influence ratio value of the first baud rate calibration value is recorded as the influence ratio target value of the first baud rate calibration value, and the preset influence ratio value of the second baud rate calibration value is recorded as the influence ratio target value of the second baud rate calibration value.

[0060] Implementably, the preset influence ratio values of the baud rate initial value, the first baud rate calibration value, and the second baud rate calibration value that can be flexibly configured by software. When flexibly configuring the preset influence ratio value by software, a more matching preset influence ratio value can be assigned for each application scenario to obtain a more accurate baud rate for data frame data segment transmission.

[0061] In the embodiments of the present invention, the preset influence ratio value generation algorithm at least includes one of the difference range and influence ratio look-up table method, the difference and influence ratio function algorithm, and the difference filling algorithm.

[0062] Implementably, when determining the influence proportion generation value by using the difference range and influence proportion look-up table method, a look-up table representing the relationship between the difference range and the influence proportion is set up to determine the influence proportion based on this look-up table. Calculation formulas such as the function relation formula between the difference and the influence proportion are set up to determine the influence proportion according to this setting.

[0063] Implementably, when determining the influence proportion generation value by using the difference and influence proportion function algorithm, according to the difference between the first baud rate calibration value BC0, the second baud rate calibration value and the baud rate initial value BI, the influence proportion generation values of the current data frame and each prior data frame are allocated (the sum of these influence proportions is 100%).

[0064] Implementably, an algorithm for filling the difference is adopted. After equal division according to the relationship between the preset number N of valid prior data frames and the value 16, the influence proportion of the prior baud rate calibration value with the largest difference is reduced, and the influence proportion of the prior baud rate calibration value with the smallest difference is increased.

[0065] As a specific example, when determining the influence proportion generation value by using the difference range and influence proportion look-up table method, the ratio of the baud rate calibration value to the baud rate initial value is calculated, and by looking up the table of this ratio and the influence proportion, the influence proportion generation value is determined. Among them, when the preset number of valid prior data frames is 4, the look-up table of the ratio and the influence proportion is shown in Table 1 below.

[0066] Table 1 Look-up table of ratio and influence proportion

[0067] Among them, the unit of the influence proportion is 1 / 16, which can vary between 0 and 15, and the difference between the baud rate calibration value and the baud rate initial value BI can be between 0 and 50%.

[0068] As a specific example, the function relation formula between the baud rate calibration value and the influence proportion is as follows: k = (16 * BC) / (the preset number of valid prior data frames * the baud rate initial value), where k is the influence proportion corresponding to the baud rate initial value, the second baud rate calibration value or the first baud rate calibration value, the unit is 1 / 16, and BC can be the baud rate initial value, the second baud rate calibration value or the first baud rate calibration value.

[0069] As a specific example, the algorithm for filling the difference with the preset number of valid prior data frames being 4 is as follows Figure 4As shown, the initial baud rate BI, the first baud rate calibration value BC0, the second baud rate calibration value, and the size relationship between the transmission order m of the current data frame and the preset number 4 of valid previous data frames are selectively filled into four positions BCⅠ, BCⅡ, BCⅢ, BCⅣ. The default influence ratio value of the four positions is 4 (in units of 1 / 16). Finally, the third baud rate calibration value BC1 is obtained through an average algorithm from the baud rate values and the influence ratio generation values of the four positions. When generating the influence ratio generation value, calculate the absolute value of the difference between the baud rate value of each position and the default influence ratio value, and then calculate the average value BX of the four absolute differences. Compare the absolute value of the difference between the baud rate value of each position and the initial baud rate BI with the average value BX. If it exceeds the average value BX, the default influence ratio value is decreased by 1, otherwise the default influence ratio value is increased by 1. Exemplarily, denote the baud rate values of the four positions as BCⅠ, BCⅡ, BCⅢ, BCⅣ respectively. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generation value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generation value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generation value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generation value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generation value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generation value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generation value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generation value of 5.

[0070] Implementably, the function of automatically generating the influence ratio can be software-controlled through software, increasing the flexibility of the application of the baud rate calibration method in the embodiments of the present invention.

[0071] In the embodiments of the present invention, the baud rate calibration method between data frames can be set before performing the transmission task, such as: the enabling situation of baud rate calibration between data frames, the number of valid previous data frames, the preset influence ratio value, the enabling situation of automatic generation of the influence ratio, the preset allowable range of baud rate calibration, etc. Then, the data frames are transmitted according to the baud rate calibration method between data frames.

[0072] In one embodiment of the present invention, as Figure 5 shown, the baud rate calibration method may further include: When it is determined that the third baud rate calibration value is greater than the preset allowable range of baud rate calibration for the data segment, record the synchronization segment baud rate calibration operation error event of the data frame.

[0073] Specifically, to avoid the bus system from getting stuck or data being transmitted at an incorrect baud rate, the embodiment of the present invention detects the third baud rate calibration value BC1 and determines whether the third baud rate calibration value BC1 is greater than the preset baud rate calibration allowable range. When it is detected that the third baud rate calibration value BC1 is greater than the preset baud rate calibration allowable range, an error event of the baud rate calibration operation in the synchronization segment of the data frame is recorded to report the error to the bus system in real time.

[0074] In a specific embodiment of the present invention, the preset baud rate calibration allowable range can be the baud rate initial value BI ± a preset threshold, where the preset threshold can be 6.25%, 12.5%, 25%.

[0075] Implementably, the software selects the preset baud rate calibration allowable range according to the actual requirements of data transmission. For example, when the preset threshold is selected as 12.5%, it means that the preset baud rate calibration allowable range is between the baud rate initial value BI ± 12.5%.

[0076] In the baud rate calibration method of the embodiment of the present invention, during the transmission of each data frame, the synchronization segment of the data frame is detected to calibrate the baud rate within the data frame, and the first baud rate calibration value BC0 is saved. After the baud rate calibration within the data frame is completed, in combination with the baud rate initial value BI, the first baud rate calibration value BC0, and the second baud rate calibration value, the baud rate calibration operation between data frames is performed to determine the third baud rate calibration value BC1, so as to use the third baud rate calibration value BC1 to complete the transmission of the data segment of the current data frame.

[0077] In the baud rate calibration method of the embodiment of the present invention, by using the baud rate initial value BI and the second baud rate calibration value to compensate and adjust the first baud rate calibration value BC0, the robustness of data transmission between multiple data frames in the transmission task is enhanced.

[0078] The present invention provides a baud rate calibration circuit.

[0079] Figure 6 is a schematic diagram of the baud rate calibration circuit of an embodiment of the present invention. As Figure 6 shown, the baud rate calibration circuit may include a first baud rate calibration module 10, a second baud rate calibration module 20, and a baud rate recording module 30.

[0080] The first baud rate calibration module 10 is used to calibrate the baud rate used for data transmission by using the baud rate initial value and the synchronization segment of the current data frame, and generate the first baud rate calibration value; The second baud rate calibration module 20 is used to determine a third baud rate calibration value according to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value, so as to complete the transmission of the data segment of the current data frame using the third baud rate calibration value. The second baud rate calibration value is the baud rate used for the transmission of the data segment of the previous data frame. The baud rate recording module 30 is respectively connected to the first baud rate calibration module 10 and the second baud rate calibration module 20, and is used to record the first baud rate calibration value generated by the first baud rate calibration module, the second baud rate calibration value, and the third baud rate calibration value generated by the second baud rate calibration module.

[0081] In the baud rate calibration circuit in the embodiment of the present invention, the first baud rate calibration module 10 is used to perform the baud rate calibration operation within the data frame. The second baud rate calibration module 20 is used to perform the baud rate calibration operation between data frames. The baud rate recording module 30 is respectively connected to the first baud rate calibration module 10 and the second baud rate calibration module 20, so as to store the first baud rate calibration value generated by the first baud rate calibration module 10 and the third baud rate calibration value generated by the second baud rate calibration module 20, and output the second baud rate calibration value to the second baud rate calibration module 20.

[0082] In an embodiment of the present invention, as Figure 6 shown, the baud rate calibration circuit in the embodiment of the present invention further includes: a calibration control unit 40, which is used to set the initial baud rate value BI and the baud rate calibration method between data frames (such as: baud rate calibration enable control between data frames, the number of valid previous data frames, the preset value of the influence ratio, the enable control of automatic generation of the influence ratio, the preset allowable range of baud rate calibration, etc.).

[0083] The calibration control unit 40 in the embodiment of the present invention provides operands and some control signals for the baud rate calibration operation between data frames.

[0084] The first baud rate calibration module 10 receives the initial baud rate value BI of the calibration control unit 40, generates the first baud rate calibration value BC0, and sends the first baud rate calibration value BC0 to the baud rate recording module 30 and the baud rate selection module 50.

[0085] The second baud rate calibration module 20 receives the control signal (the baud rate calibration enable signal between data frames) of the calibration control unit 40, the first baud rate calibration value and the second baud rate calibration value in the baud rate recording module 30, and outputs the third baud rate calibration value to the baud rate selection module 50.

[0086] In an embodiment of the present invention, as Figure 6As shown, the baud rate calibration circuit further includes a baud rate selection module 50, which is configured to receive the baud rate calibration enable control between data frames from the calibration control unit 40, and output a third baud rate calibration value when it is determined that the baud rate calibration between data frames is enabled, so that the bus system receiver can complete the transmission of the data segment of the current data frame according to the third baud rate calibration value. When it is determined that the baud rate calibration between data frames is not enabled, a first baud rate calibration value is output, so that the bus system receiver can complete the transmission of the data segment of the current data frame according to the first baud rate calibration value.

[0087] In the baud rate calibration circuit according to the embodiment of the present invention, the third baud rate calibration value generated by the second baud rate calibration module 20 is used to complete the transmission of the data segment of the current data frame, so as to compensate, adjust, and detect the first baud rate calibration value generated by the baud rate calibration operation within the data frame of the first baud rate calibration module 10, and enhance the robustness of the data transmission of the bus system.

[0088] In an embodiment of the present invention, as Figure 7 shown, the second baud rate calibration module 20 includes: A baud rate generation unit 21, connected to the baud rate recording module, is configured to obtain an initial baud rate value and its influence ratio target value, a first baud rate calibration value and its influence ratio target value, and / or at most N-1 second baud rate calibration values and their corresponding influence ratio target values according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and calculate the third baud rate calibration value; An influence ratio selection unit 22, connected to the baud rate generation unit, is configured to send the initial baud rate value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N-1 second baud rate calibration values and their corresponding influence ratio target values to the baud rate generation unit. Among them, when the automatic generation function of the influence ratio is not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, the preset influence ratio value of the initial baud rate value, the preset influence ratio value of the first baud rate calibration value, and / or the preset influence ratio values corresponding to at most N-1 second baud rate calibration values are obtained, and the obtained preset influence ratio values are recorded as the influence ratio target values; when the automatic generation function of the influence ratio is enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, the generated influence ratio value of the initial baud rate value, the generated influence ratio value of the first baud rate calibration value, and / or the generated influence ratio values of at most N-1 second baud rate calibration values are obtained, and the generated influence ratio values are recorded as the influence ratio target values; The influence ratio automatic generation unit 23, connected to the influence ratio selection unit, is used to adopt an influence ratio generation algorithm according to the transmission order m of the current data frame and the preset number N of valid previous data frames to generate the influence ratio generation value of the initial baud rate value, the influence ratio generation value of the first baud rate calibration value, and / or the influence ratio generation values of up to N-1 second baud rate calibration values when the influence ratio automatic generation function is enabled; The baud rate threshold detection unit 24 is used to record the synchronization segment baud rate calibration operation error event of the data frame when it is determined that the third baud rate calibration value is greater than the preset baud rate calibration allowable range of the data segment.

[0089] The baud rate generation unit 21 in the embodiment of the present invention receives the initial baud rate value BI of the calibration control unit 40, the preset number N of valid previous data frames, and the influence ratio target values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value, and calculates the third baud rate calibration value. Specifically, when the influence ratio automatic generation is enabled, the third baud rate calibration value is calculated based on the influence ratio generation value. When the influence ratio automatic generation is not enabled, the third baud rate calibration value is calculated based on the preset influence ratio value.

[0090] The influence ratio selection unit 22 in the embodiment of the present invention receives the influence ratio generation values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value output by the influence ratio automatic generation unit 23, the influence ratio automatic generation enable control output by the calibration control unit 40, and the preset influence ratio values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value, and outputs the influence ratio target values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value.

[0091] The influence ratio automatic generation unit 23 in the embodiment of the present invention receives the initial baud rate value BI of the calibration control unit 40, the preset number N of valid previous data frames, the first baud rate calibration value and the second baud rate calibration value saved by the baud rate recording module 30, and outputs the influence ratio generation values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value. Specifically, when the influence ratio selection unit 22 receives the influence ratio automatic generation enable instruction issued by the calibration control unit 40, it outputs the influence ratio generation values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value output by the influence ratio automatic generation unit 23 to the baud rate generation unit 21. When it receives the influence ratio automatic generation disable instruction issued by the calibration control unit 40, it outputs the preset influence ratio values corresponding to the initial baud rate value, the first baud rate calibration value, and the second baud rate calibration value to the baud rate generation unit 21.

[0092] In the embodiment of the present invention, the baud rate threshold detection unit 24 receives the preset baud rate calibration allowable range of the calibration control unit 40, collects the third baud rate calibration value, and outputs a detection error signal to the bus system when the third baud rate calibration value exceeds the preset baud rate calibration allowable range.

[0093] In the baud rate calibration circuit of the embodiment of the present invention, the second baud rate calibration module 20 is used to perform the baud rate calibration operation between data frames, and the result obtained from the baud rate calibration operation between data frames is detected, which can effectively reduce the influence of abnormal baud rate changes in the bus system on data transmission and enhance the robustness of data transmission.

[0094] In the embodiment of the present invention, by software controlling the calibration function, the influence ratio automatic generation function, the number of valid previous data frames, the influence ratio, and the preset baud rate calibration allowable range, the application flexibility is increased to a great extent; the influence ratio automatic generation operation can simplify the software operation and reduce software resources.

[0095] It should be noted that when the calibration enable between data frames is invalid, the baud rate selection module 50 outputs the first baud rate calibration value BC0, and directly uses the first baud rate calibration value BC0 as the baud rate for data segment transmission of the data frame. When the calibration enable between data frames is valid, the second baud rate calibration module 20 calculates the third baud rate calibration value BC1 according to the calibration enable signal between data frames.

[0096] In some embodiments, in order to adapt to a specific operating environment and obtain a more accurate baud rate, the bus system selects the number of valid previous data frames, the baud rate initial value BI, the first baud rate calibration value BC0, and the preset value of the influence ratio corresponding to the second baud rate calibration value through software. When the influence ratio automatic generation control is in an invalid state, the influence ratio selection unit 22 outputs the baud rate initial value, the first baud rate calibration value, and the preset value of the influence ratio corresponding to the second baud rate calibration value to the baud rate generation unit 21. The baud rate generation unit 21 calculates the third baud rate calibration value according to the transmission order m of the current data frame, the preset number N of valid previous data frames, the baud rate initial value and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence ratio target values.

[0097] In some embodiments, detecting the third baud rate calibration value output by the baud rate generation unit 21 is a preferred solution. The baud rate threshold detection unit 24 detects the third baud rate calibration value according to the preset baud rate calibration allowable range when the baud rate calibration between data frames is completed. A detection error state is generated after the third baud rate calibration value exceeds the preset baud rate calibration allowable range and is reported to the bus system.

[0098] Generally, the threshold range is set as a percentage of the initial baud rate value. For example, 0 means no detection, 1 means 10%, 12.5%, etc. It can also be set as the upper and lower limits of the actual baud rate. When the baud rate is between the upper and lower limits, no error will be detected.

[0099] The above process occurs during the transmission of each data frame until the bus system transmitter ends the current transmission task.

[0100] It should be noted that for other specific embodiments of the baud rate calibration circuit provided in the embodiments of the present invention, reference can be made to other specific embodiments of the baud rate calibration method in the above embodiments of the present invention.

[0101] The baud rate calibration circuit according to the embodiment of the present invention compensates and adjusts the first baud rate calibration value BC0 by using the initial baud rate BI and the second baud rate calibration value, enhancing the robustness of data transmission between multiple data frames during the transmission task.

[0102] The present invention provides a computer-readable storage medium.

[0103] In this embodiment, a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the baud rate calibration method as described above is implemented.

[0104] The present invention provides an electronic device.

[0105] In this embodiment, the electronic device may include a memory and a processor. A computer program is stored on the memory. When the computer program is executed by the processor, the baud rate calibration method as described above is implemented.

[0106] Figure 8 It is a structural block diagram of the electronic device according to the embodiment of the present invention.

[0107] As Figure 8 shown, the electronic device 500 includes: a processor 501 and a memory 503. Among them, the processor 501 and the memory 503 are connected, such as connected through a bus 502. Optionally, the electronic device 500 may further include a transceiver 504. It should be noted that in actual applications, the transceiver 504 is not limited to one, and the structure of the electronic device 500 does not constitute a limitation to the embodiments of the present invention.

[0108] The processor 501 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of the present invention. The processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0109] The bus 502 may include a path for transmitting information between the above components. The bus 502 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0110] The memory 503 is used to store a computer program corresponding to the baud rate calibration method of the foregoing embodiments of the present invention, and the execution of this computer program is controlled by the processor 501. The processor 501 is used to execute the computer program stored in the memory 503 to implement the content shown in the foregoing method embodiments.

[0111] Among them, the electronic device 500 includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The illustrated electronic device 500 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.

[0112] The computer-readable storage medium and the electronic device of the embodiments of the present invention, based on the foregoing baud rate calibration method, use the baud rate initial value BI and the second baud rate calibration value to compensate for and adjust the first baud rate calibration value BC0, enhancing the data transmission robustness between multiple data frames in a transmission task.

[0113] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion having one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0114] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0115] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0116] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation on the present invention.

[0117] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In the description of the present invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically and clearly defined.

[0118] In the present invention, unless otherwise clearly specified and limited, the terms "mounted", "connected", "coupled", "fixed", etc. shall be construed in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two elements or the interaction relationship between two elements, unless otherwise clearly limited. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0119] In the present invention, unless otherwise clearly specified and limited, the first feature being "on" or "under" the second feature may be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, the first feature being "above", "over" and "on top of" the second feature may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the first feature has a higher horizontal height than the second feature. The first feature being "under", "beneath" and "underneath" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the first feature has a lower horizontal height than the second feature.

[0120] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as a limitation on the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A baud rate calibration method, characterized in that: The method comprises: Calibrate the baud rate used for data transmission using the baud rate initial value and the current data frame synchronization segment to generate a first baud rate calibration value; A third baud rate calibration value is determined based on the baud rate initial value, the first baud rate calibration value and the second baud rate calibration value, so as to use the third baud rate calibration value to complete the transmission of the current data frame data segment, wherein the second baud rate calibration value is the baud rate used in the transmission of the previous data frame data segment.

2. The baud rate calibration method according to claim 1, characterized in that: The determining a third baud rate calibration value according to the baud rate initial value, the first baud rate calibration value and the second baud rate calibration value comprises: According to the transmission order m of the current data frame and the preset valid number N of previous data frames, the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value and / or up to N-1 of the second baud rate calibration values ​​and their corresponding impact weight target values ​​are obtained, and the third baud rate calibration value is calculated.

3. The baud rate calibration method according to claim 2, characterized in that: The step of obtaining the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value, and / or at most N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​according to the transmission order m of the current data frame and the preset valid number N of previous data frames, and calculating the third baud rate calibration value includes: If m=1, the baud rate initial value and its impact weight target value and the first baud rate calibration value and its impact weight target value are obtained, and the third baud rate calibration value is calculated; If m<N, then obtain the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value, the m-1 second baud rate calibration values ​​before the current data frame and their corresponding impact weight target values, and calculate the third baud rate calibration value; If m≥N, the first baud rate calibration value and its impact weight target value, the N-1 second baud rate calibration values ​​before the current data frame and their corresponding impact weight target values ​​are obtained, and the third baud rate calibration value is calculated.

4. The baud rate calibration method according to claim 2, characterized in that: The impact weight target value includes an impact weight generation value and an impact weight preset value, and the obtaining of the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value, and / or at most N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​according to the transmission order m of the current data frame and the preset valid number N of previous data frames includes: Determine whether the automatic generation function of impact weight is enabled; If enabled, an impact ratio generation algorithm is used to generate an impact ratio generation value of the baud rate initial value, an impact ratio generation value of the first baud rate calibration value, and / or impact ratio generation values ​​of up to N-1 second baud rate calibration values ​​according to the transmission order m of the current data frame and the preset valid number N of previous data frames, and the impact ratio generation value is recorded as the impact ratio target value; If it is not enabled, then based on the transmission order m of the current data frame and the preset valid number N of previous data frames, obtain the impact ratio preset value of the baud rate initial value, the impact ratio preset value of the first baud rate calibration value and / or the impact ratio preset values ​​corresponding to up to N-1 of the second baud rate calibration values, and record the impact ratio preset value as the impact ratio target value.

5. The baud rate calibration method according to claim 4, characterized in that: The algorithm for generating the preset value of the influence ratio includes at least one of a difference range and influence ratio table lookup method, a difference and influence ratio function algorithm, and a difference filling algorithm.

6. The baud rate calibration method according to any one of claims 1 to 5, characterized in that: The method further comprises: When it is determined that the third baud rate calibration value is greater than the preset data segment baud rate calibration allowable range, a synchronization segment baud rate calibration operation error event of the data frame is recorded.

7. A baud rate calibration circuit, characterized in that: The circuit comprises: A first baud rate calibration module, used to calibrate the baud rate used for data transmission using the baud rate initial value and the current data frame synchronization segment, and generate a first baud rate calibration value; a second baud rate calibration module, configured to determine a third baud rate calibration value according to the baud rate initial value, the first baud rate calibration value and the second baud rate calibration value, so as to use the third baud rate calibration value to complete the transmission of the data segment of the current data frame, wherein the second baud rate calibration value is the baud rate used for the transmission of the data segment of the previous data frame; A baud rate recording module is connected to the first baud rate calibration module and the second baud rate calibration module, and is used to record the first baud rate calibration value generated by the first baud rate calibration module, the second baud rate calibration value and the third baud rate calibration value generated by the second baud rate calibration module.

8. The baud rate calibration circuit according to claim 7, characterized in that: The second baud rate calibration module comprises: a baud rate generating unit connected to the baud rate recording module, configured to obtain the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value, and / or at most N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​according to the transmission order m of the current data frame and the preset valid number N of previous data frames, and calculate the third baud rate calibration value; an impact weight selection unit, connected to the baud rate generation unit, for sending the baud rate initial value and its impact weight target value, the first baud rate calibration value and its impact weight target value, and / or up to N-1 second baud rate calibration values ​​and their corresponding impact weight target values ​​to the baud rate generation unit, wherein, when the impact weight automatic generation function is not enabled, the impact weight preset value of the baud rate initial value and the impact weight of the first baud rate calibration value are obtained according to the transmission order m of the current data frame and the preset number of valid previous data frames N. A preset value and / or a maximum of N-1 impact weight preset values ​​corresponding to the second baud rate calibration values, and the impact weight preset value is recorded as the impact weight target value; when the automatic generation function of the impact weight is enabled, according to the transmission order m of the current data frame and the preset valid number N of the previous data frames, the impact weight generation value of the baud rate initial value, the impact weight generation value of the first baud rate calibration value and / or a maximum of N-1 impact weight generation values ​​of the second baud rate calibration values ​​are obtained, and the impact weight generation value is recorded as the impact weight target value; an impact weight automatic generation unit, connected to the impact weight selection unit, for, when the impact weight automatic generation function is enabled, using an impact weight generation algorithm to generate an impact weight generation value of the baud rate initial value, an impact weight generation value of the first baud rate calibration value, and / or a maximum of N-1 impact weight generation values ​​of the second baud rate calibration value according to a transmission order m of the current data frame and a preset valid number N of previous data frames; The baud rate threshold detection unit is used to record a synchronization segment baud rate calibration operation error event of the data frame when it is determined that the third baud rate calibration value is greater than a preset data segment baud rate calibration allowable range.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the baud rate calibration method according to any one of claims 1 to 6 is implemented.

10. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the baud rate calibration method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Baud rate calibration circuit and serial port chip

    CN109075742A

  • Uplink rate adjusting method and device, electronic equipment and storage medium

    CN113423122A

  • Data sampling method and device

    CN118689831A

  • Baud rate adjusting method of transceiver, computer equipment and computer program product

    CN118713789A

  • Baud rate adjusting method and device, electronic equipment and storage medium

    CN119788241A