Baud Rate Calibration Method, Circuit, Storage Medium, and Electronic Device
By determining the third baud rate calibration value using the baud rate initial value, the first and second baud rate calibration values in asynchronous communication, the communication failure problem caused by the difference in baud rate between data frames in asynchronous communication is solved, and the robustness of data transmission is improved.
Patent Information
- Application Number
- CN202510565416.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-04-30
AI Technical Summary
In asynchronous transceiver communication, external environmental factors and clock crystal oscillator accuracy influence cause data transmission failure between the transmitter and receiver of the bus system, especially when the baud rate difference between the two adjacent data frames is large, the synchronization segment and data segment of the next data frame cannot be detected, resulting in communication failure.
By determining the third baud rate calibration value with the baud rate initial value, the first baud rate calibration value and the second baud rate calibration value, the baud rate calibration within and between the data frames is performed, and the robustness of data transmission is enhanced.
It improves the baud rate calibration accuracy during data frame transmission, enhances the robustness of data transmission between multiple data frames, and avoids communication failure of bus system.
Smart Images

Figure CN120090765B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of asynchronous communication technologies, and in particular, to a baud rate calibration method, a circuit, a storage medium, and an electronic device. Background Art
[0002] In asynchronous transceiver communication, external environmental factors and the accuracy of its own clock crystal 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 an initial baud rate value and a synchronization segment of a current data frame to generate a first baud rate calibration value; determining a third baud rate calibration value according to the initial baud rate value, the first baud rate calibration value, and a 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, where the second baud rate calibration value is the baud rate used for transmitting the data segment of a 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 value 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:
[0011] According to an embodiment of the present invention, determining the third baud rate calibration value based on 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 proportion target value, the first baud rate calibration value and its influence proportion target value, and / or at most N-1 of the second baud rate calibration values and their corresponding influence proportion 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.
[0012] According to an embodiment of the present invention, obtaining the baud rate initial value and its influence proportion target value, the first baud rate calibration value and its influence proportion target value, and / or at most N-1 of the second baud rate calibration values and their corresponding influence proportion 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 proportion target value and the first baud rate calibration value and its influence proportion target value, and calculating the third baud rate calibration value; if m < N, obtaining the baud rate initial value and its influence proportion target value, the first baud rate calibration value and its influence proportion target value, the m-1 second baud rate calibration values before the current data frame and their corresponding influence proportion target values, and calculating the third baud rate calibration value; if m ≥ N, obtaining the first baud rate calibration value and its influence proportion target value, the N-1 second baud rate calibration values before the current data frame and their corresponding influence proportion target values, and calculating the third baud rate calibration value.
[0013] 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 to generate an influence ratio generation value of the initial baud rate value, an 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 according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and recording the influence ratio generation value as the influence ratio target value; if not enabled, obtaining an influence ratio preset value of the initial baud rate value, an 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 according to the transmission order m of the current data frame and the preset number N of valid previous data frames, and recording the influence ratio preset value as the influence ratio target value.
[0014] 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.
[0015] According to an embodiment of the present invention, the method further includes: when determining 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.
[0016] To achieve the above object, an embodiment of the second aspect of the present invention provides 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.
[0017] According to the baud rate calibration circuit of the embodiment of the present invention, by using the second baud rate calibration module, the baud rate calibration value used for the data segment of the current data frame is compensated and adjusted according to the baud rate initial value, the first baud rate calibration value, and the baud rate used for transmitting the data segment of the prior data frame, enhancing the robustness of data transmission between multiple data frames in the transmission task.
[0018] In addition, the baud rate calibration circuit proposed according to the above embodiment of the present invention may further have the following additional technical features:
[0019] According to an embodiment of the present invention, the second baud rate calibration module includes: a baud rate generation unit, connected to the baud rate recording module, for 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 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 prior data frames, and calculating the third baud rate calibration value; an influence ratio selection unit, connected to the baud rate generation unit, for sending 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 to the baud rate generation unit, wherein when the influence ratio automatic generation function is not enabled, obtaining the influence ratio preset value of the baud rate initial 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 according to the transmission order m of the current data frame and the preset number N of valid prior data frames, and recording the influence ratio preset value as the influence ratio target value; when the influence ratio automatic generation function is enabled, obtaining 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 at most N - 1 influence ratio generation values corresponding to the second baud rate calibration values according to the transmission order m of the current data frame and the preset number N of valid prior data frames, and recording the influence ratio generation value as the influence ratio target value; an influence ratio automatic generation unit, connected to the influence ratio selection unit, for when the influence ratio automatic generation function is enabled, using the influence ratio generation algorithm to generate 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 at most N - 1 influence ratio generation values corresponding to the second baud rate calibration values according to the transmission order m of the current data frame and the preset number N of valid prior data frames; a baud rate threshold detection unit, for recording 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 for the data segment.
[0020] 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.
[0021] 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.
[0022] 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. Description of the Drawings
[0023] Figure 1 is a flowchart of the baud rate calibration method according to an embodiment of the present invention;
[0024] Figure 2 is the flow of the baud rate calibration method according to a specific embodiment of the present invention Figure 1 ;
[0025] Figure 3 is the flow of the baud rate calibration method according to a specific embodiment of the present invention Figure 2 ;
[0026] Figure 4 is a schematic diagram of the difference filling algorithm according to a specific embodiment of the present invention;
[0027] Figure 5 is the flow of the baud rate calibration method according to a specific embodiment of the present invention Figure 3 ;
[0028] Figure 6 is a schematic diagram of the baud rate calibration circuit according to an embodiment of the present invention;
[0029] Figure 7 Schematic diagram of the second baud rate calibration module according to an embodiment of the present invention;
[0030] Figure 8 is a block diagram of the structure of the electronic device according to an embodiment of the present invention. Detailed Embodiments
[0031] 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.
[0032] 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 in conjunction with the accompanying drawings of the specification and specific embodiments.
[0033] Figure 1 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:
[0034] S101, calibrate the baud rate used for data transmission using the initial baud rate value and the current data frame synchronization segment to generate a first baud rate calibration value;
[0035] S102, 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, where the second baud rate calibration value is the baud rate used for the transmission of the data segment of the previous data frame.
[0036] It should be noted that one 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 achieve synchronization between 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.
[0037] 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 embodiments of the present invention perform in-frame baud rate calibration on each data frame in this bus system transmission task, and perform 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.
[0038] Before starting the system transmission task, set the initial baud rate value BI. After starting the system transmission task, perform in-frame baud rate calibration on the current data frame according to the initial baud rate value 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.
[0039] Specifically, starting from the transmission of the first data frame of the transmission task, the baud rate used for data transmission is calibrated by using the initial baud rate BI and the current data frame synchronization segment. Implementably, generally, the data frame synchronization segment information is an 8-bit special data, such as 0x55 / 0xAA. Inside the bus system receiver, based on this 8-bit data of the data frame synchronization segment and in combination with the initial baud rate BI, the baud rate of the current data frame itself (the current data frame synchronization segment) is calibrated to generate the first baud rate calibration value BC0, and the generated first baud rate calibration value BC0 is saved in the bus system for use in the data transmission of the subsequent data segments of the current data frame.
[0040] Based on the initial baud rate BI, the first baud rate calibration value BC0, and the second baud rate calibration value, the baud rate calibration between data frames is performed to generate the third baud rate calibration value BC1, so as to complete the transmission of the subsequent data segments of the current data frame by 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 segments of the current data frame until the transmission of this data frame ends.
[0041] 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.
[0042] 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 is performed for each data frame transmission. That is, the baud rate calibration within the data frame occurs for each data frame synchronization segment, and based on the baud rate calibration within this data frame, the baud rate calibration operation between data frames is executed to obtain the baud rate calibration value between data frames, and the data segments of each data frame are transmitted according to the baud rate calibration value between data frames.
[0043] 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 enabling of the baud rate calibration between data frames.
[0044] Specifically, as Figure 2As shown, before performing baud rate calibration between data frames, it is determined whether the baud rate calibration enabling between data frames is enabled. If the baud rate calibration enabling 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. When 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, so as to use the third baud rate calibration value BC1 to complete the transmission of subsequent data segments of the current data frame, that is, use the first baud rate calibration value BC0 to complete the transmission of subsequent data segments of the current data frame.
[0045] Implementably, by software-configuring the enabling situation of baud rate calibration between data frames, the flexibility of applying the baud rate calibration method in the embodiments of the present invention is increased, and at the same time, the communication behavior of a general bus system is compatible.
[0046] 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:
[0047] 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 and its influence proportion target value, the first baud rate calibration value and its influence proportion target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence proportion target values are obtained, and the third baud rate calibration value is calculated.
[0048] 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.
[0049] Specifically, 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 BI, the first baud rate calibration value BC0, and / or at most N - 1 second baud rate calibration values are obtained, and at the same time, the influence proportion target value of the initial baud rate, the influence proportion target value of the first baud rate calibration value BC0, and / or the influence proportion target values corresponding to at most N - 1 second baud rate calibration values are obtained synchronously.
[0050] Using the preset baud rate calibration value algorithm, according to the initial baud rate BI and its influence proportion target value, the first baud rate calibration value BC0 and its influence proportion target value, and / or at most N - 1 second baud rate calibration values and their corresponding influence proportion preset values, the third baud rate calibration value BC1 is calculated, which can greatly reduce the influence caused by abnormal baud rate changes and at the same time reduce software resource consumption.
[0051] In an embodiment of the present invention, the precision (unit) of the influence proportion target value is 1 / 16, and the value range of the influence proportion target value is [0, 15] (in units of 1 / 16).
[0052] In an embodiment of the present invention, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtaining the initial baud rate 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, and calculating the third baud rate calibration value may include:
[0053] If m = 1, obtain the initial baud rate and its influence ratio target value, the first baud rate calibration value and its influence ratio target value, and calculate the third baud rate calibration value;
[0054] If m < N, obtain the initial baud rate 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;
[0055] If m ≥ N, 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.
[0056] 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 the 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.
[0057] 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.
[0058] When m < N, obtain the initial baud rate, the first baud rate calibration value, and the first m - 1 second baud rate calibration values before 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 before the current data frame. Using the 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 before the current data frame and their corresponding influence ratio target values.
[0059] 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 proportion target value of the first baud rate calibration value and the influence proportion 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 proportion target value, the first N - 1 second baud rate calibration values of the current data frame and their corresponding influence proportion target values.
[0060] In the embodiments of the present invention, for different configurations of the preset number N of valid prior data frames, the baud rate calibration operations between data frames are different.
[0061] As an example, when the preset number N of valid prior 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 baud rate initial value BI and its influence proportion 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 proportion 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.
[0062] 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 first baud rate calibration value generated in the synchronization segment of the first data frame is adjusted using the initial baud rate BI and its influence ratio target value 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, the first baud rate calibration value generated in the synchronization segment of the second data frame is adjusted using the initial baud rate 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 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, the first baud rate calibration value generated in the synchronization segment of the third data frame is adjusted using the initial baud rate 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, the baud rate used for transmitting the data segment of the second data frame and its influence ratio target value to obtain the baud rate used for transmitting the data segment of the third data frame. For the fourth data frame in the transmission task, the first baud rate calibration value generated in the synchronization segment of the fourth data frame is adjusted using the baud rate used for transmitting the data segment of the first data frame and its influence ratio target value, the baud rate used for transmitting the data segment of the second data frame and its influence ratio target value, the baud rate used for transmitting the data segment of the third data frame and its influence ratio target value to obtain the baud rate used for transmitting the data segment of the fourth data frame. For subsequent data frames in the transmission task, the first baud rate calibration value generated in the synchronization segment of the subsequent data frame is adjusted using the baud rates used for transmitting the data segments of the first three data frames of the subsequent data frame and their corresponding influence ratio target values to obtain the baud rate used for transmitting the data segment of the subsequent data frame.
[0063] 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. 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 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. 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 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 to obtain the baud rate used for transmitting the data segment of the third data frame.
[0064] 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 for the 8th data frame, and will not be elaborated here.
[0065] 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.
[0066] 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 variable influence ratio, the standard deviation algorithm with variable influence ratio, etc.
[0067] 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.
[0068] In a specific example, using the weighted average algorithm, the third baud rate calibration value BC1 is calculated based on the initial baud rate 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.
[0069] It should be noted that the third baud rate calibration value BC1 can also be calculated using the standard deviation algorithm, variance algorithm, etc.
[0070] In a specific example, when m ≥ N, the standard deviation formula adopted by the standard deviation algorithm is:
[0071]
[0072] Among them, represents the standard deviation between the baud rate after calibration and the initial baud rate, 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 BI, it is determined whether the initial baud rate BI is added with this standard deviation or subtracted by this standard deviation to determine the baud rate used for data frame data segment transmission.
[0073] 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 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:
[0074] Judge whether the influence weight automatic generation function is enabled;
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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 allocated for each application scenario to obtain a more accurate baud rate for data frame data segment transmission.
[0080] In the embodiment of the present invention, the influence ratio preset 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 balance filling algorithm.
[0081] 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 to determine the influence proportion based on this look-up table. Calculation formulas such as the function relational expression between the difference and the influence proportion are set to determine the influence proportion according to this setting.
[0082] 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%).
[0083] Implementably, the differential complement algorithm 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.
[0084] 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 the influence proportion generation value is determined by looking up the table of this ratio and the influence proportion. Among them, when the preset number of valid prior data frames is 4, the ratio and influence proportion look-up table is shown in Table 1 below.
[0085] Table 1 Ratio and Influence Proportion Look-up Table
[0086]
[0087] 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%.
[0088] As a specific example, the function relational expression between the baud rate calibration value and the influence proportion is as follows: k = (16 * BC) / (preset number of valid prior data frames * 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.
[0089] As a specific example, the differential complement algorithm with the preset number of valid prior data frames being 4: For example 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 effective number 4 of the preset previous data frames are selectively filled into four positions BCⅠ, BCⅡ, BCⅢ, and BCⅣ. The default influence ratio values of the four positions are 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 influence ratio generated values of the four positions. When generating the influence ratio generated 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Ⅲ, and BCⅣ. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generated value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generated value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generated value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generated value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generated value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generated value of 5. If , the default influence ratio value is decreased by 1 to obtain an influence ratio generated value of 3, otherwise, the default influence ratio value is increased by 1 to obtain an influence ratio generated value of 5.
[0090] Implementably, the function of automatically generating the influence ratio can be controlled by software, which increases the flexibility of the application of the baud rate calibration method in the embodiments of the present invention.
[0091] 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 effective number of previous data frames, the preset value of the influence ratio, 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.
[0092] In one embodiment of the present invention, as Figure 5 shown, the baud rate calibration method may further include:
[0093] 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.
[0094] Specifically, to avoid the bus system from getting stuck or transmitting data 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.
[0095] In a specific embodiment of the present invention, the preset baud rate calibration allowable range may be the baud rate initial value BI ± a preset threshold, where the preset threshold may be 6.25%, 12.5%, or 25%.
[0096] 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%.
[0097] 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.
[0098] 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.
[0099] The present invention provides a baud rate calibration circuit.
[0100] Figure 6 It is a schematic diagram of the baud rate calibration circuit according to 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.
[0101] 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 a first baud rate calibration value;
[0102] 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.
[0103] 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.
[0104] In the baud rate calibration circuit according to 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.
[0105] In an embodiment of the present invention, as Figure 6 shown, the baud rate calibration circuit according to 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.).
[0106] The calibration control unit 40 according to the embodiment of the present invention provides operands and some control signals for the baud rate calibration operation between data frames.
[0107] 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.
[0108] The second baud rate calibration module 20 receives the control signal (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.
[0109] In an embodiment of the present invention, as Figure 6As shown in the figure, 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 when it is determined that the baud rate calibration between data frames is enabled, output a third baud rate calibration value, so that the bus system receiver completes 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, output a first baud rate calibration value, so that the bus system receiver completes the transmission of the data segment of the current data frame according to the first baud rate calibration value.
[0110] The baud rate calibration circuit in the embodiment of the present invention uses the third baud rate calibration value generated by the second baud rate calibration module 20 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.
[0111] In an embodiment of the present invention, as Figure 7 shown, the second baud rate calibration module 20 includes:
[0112] A baud rate generation unit 21, connected to the baud rate recording module, is configured to obtain a baud rate initial 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 a third baud rate calibration value;
[0113] An influence ratio selection unit 22, connected to the baud rate generation unit, is configured to send 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 to the baud rate generation unit. Among them, when the influence ratio automatic generation function is not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtain the influence ratio preset value of the baud rate initial value, the influence ratio preset value of the first baud rate calibration value, and / or the influence ratio preset values corresponding to at most N - 1 second baud rate calibration values, and record the obtained influence ratio preset values as the influence ratio target values; when the influence ratio automatic generation function is enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtain 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, and record the influence ratio generation values as the influence ratio target values;
[0114] 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 an influence ratio generation value for the initial baud rate value, an influence ratio generation value for the first baud rate calibration value, and / or influence ratio generation values for at most N-1 second baud rate calibration values when the influence ratio automatic generation function is enabled;
[0115] The baud rate threshold detection unit 24 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 the preset baud rate calibration allowable range of the data segment.
[0116] 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 influence ratio preset value.
[0117] 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 influence ratio preset 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.
[0118] 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 influence ratio preset 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.
[0119] 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.
[0120] 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 impact of abnormal baud rate changes in the bus system on data transmission and enhance the robustness of data transmission.
[0121] 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 greatly increased; the influence ratio automatic generation operation can simplify the software operation and reduce software resources.
[0122] 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.
[0123] 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 influence ratio values 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 influence ratio values 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 and the preset number N of valid previous data frames, as well as 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.
[0124] In some embodiments, it is a preferred solution to detect the third baud rate calibration value output by the baud rate generation unit 21. 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 reported to the bus system.
[0125] 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.
[0126] The above process occurs during the transmission of each data frame until the bus system transmitter ends the current transmission task.
[0127] 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.
[0128] The baud rate calibration circuit in the embodiments 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 data transmission robustness between multiple data frames during the transmission task.
[0129] The present invention provides a computer-readable storage medium.
[0130] 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.
[0131] The present invention provides an electronic device.
[0132] 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.
[0133] Figure 8 It is a structural block diagram of the electronic device in the embodiments of the present invention.
[0134] 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 practical 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.
[0135] 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 logic 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, and the like.
[0136] 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, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 8 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0137] The memory 503 is used to store a computer program corresponding to the baud rate calibration method of the above 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.
[0138] 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 only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0139] The computer-readable storage medium and the electronic device of the embodiments of the present invention, based on the above 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.
[0140] 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 used in combination with these instruction execution systems, apparatus 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 connection 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.
[0141] 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.
[0142] 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 any one or more embodiments or examples in a suitable manner.
[0143] In the description of the present invention, it should be understood that the orientation or positional relationships 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 relationships 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.
[0144] 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.
[0145] In the present invention, unless otherwise clearly defined 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 an integral body; 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.
[0146] In the present invention, unless otherwise clearly defined 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 indirectly in 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.
[0147] 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 includes: 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; 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, so as to complete the reception 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; The determining the 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 includes: According to the transmission order m of the current data frame and the preset number N of valid previous data frames, 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 of the second baud rate calibration values and their corresponding influence ratio target values, and calculating the third baud rate calibration value, where the 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 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 initial baud rate 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 initial baud rate 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.
2. The baud rate calibration method according to claim 1, characterized in that The influence ratio target value includes an influence ratio generation value and an influence ratio preset value, and the 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 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 includes: Judging whether the influence ratio automatic generation function is enabled; If it is enabled, adopting an influence ratio generation algorithm to generate an influence ratio generation value of the initial baud rate value, an influence ratio generation value of the first baud rate calibration value, and / or at most N-1 of the influence ratio generation values of the 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 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 prior data frames, obtain the preset value of the influence ratio of the initial baud rate, the preset value of the influence ratio of the first baud rate calibration value, and / or the preset values of the influence ratios corresponding to at most N-1 second baud rate calibration values, and record the preset value of the influence ratio as the target value of the influence ratio.
3. The baud rate calibration method according to claim 2, wherein The algorithm for generating the preset value of the influence ratio includes at least one of the difference range and influence ratio look-up table method, the difference and influence ratio function algorithm, and the balance filling algorithm.
4. The baud rate calibration method according to any one of claims 1-3, characterized in that The method further includes: 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 error event of the baud rate calibration operation in the synchronization segment of the data frame.
5. A baud rate calibration circuit, characterized in that, The circuit includes: A first baud rate calibration module, configured to calibrate the baud rate used for data transmission by using the initial baud rate and the synchronization segment of the current data frame, 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 initial baud rate, the first baud rate calibration value, and the second baud rate calibration value, so as to complete the reception 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 prior data frame; A baud rate recording module, connected to the first baud rate calibration module and the second baud rate calibration module, configured 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; The second baud rate calibration module includes: A baud rate generating unit, connected to the baud rate recording module, configured to obtain the initial baud rate and its target influence ratio value, the first baud rate calibration value and its target influence ratio value, and / or the target influence ratio values corresponding to 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 prior data frames, and calculate the third baud rate calibration value. Among them, obtaining the initial baud rate and its target influence ratio value, the first baud rate calibration value and its target influence ratio value, and / or the target influence ratio values corresponding to 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 prior data frames, and calculating the third baud rate calibration value includes: If m = 1, obtain the initial baud rate and its target influence ratio value and the first baud rate calibration value and its target influence ratio value, and calculate the third baud rate calibration value; If m < N, obtain the initial baud rate and its target influence ratio value, the first baud rate calibration value and its target influence ratio value, the target influence ratio values corresponding to the first m-1 second baud rate calibration values of the current data frame, and calculate the third baud rate calibration value; If m≥N, obtain the first baud rate calibration value and its influence proportion target value, the first N-1 second baud rate calibration values of the current data frame and their corresponding influence proportion target values, and calculate the third baud rate calibration value.
6. The baud rate calibration circuit according to claim 5, wherein The second baud rate calibration module includes: An influence proportion selection unit, connected to the baud rate generation unit, for sending the baud rate initial value and its influence proportion target value, the first baud rate calibration value and its influence proportion target value, and / or at most N-1 second baud rate calibration values of the current data frame and their corresponding influence proportion target values to the baud rate generation unit. Among them, when the influence proportion automatic generation function is not enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtain the preset value of the influence proportion of the baud rate initial value, the preset value of the influence proportion of the first baud rate calibration value, and / or the preset values of the influence proportions corresponding to at most N-1 second baud rate calibration values, and record the preset value of the influence proportion as the influence proportion target value; when the influence proportion automatic generation function is enabled, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, obtain the generated value of the influence proportion of the baud rate initial value, the generated value of the influence proportion of the first baud rate calibration value, and / or the generated values of the influence proportions corresponding to at most N-1 second baud rate calibration values, and record the generated value of the influence proportion as the influence proportion target value; An influence proportion automatic generation unit, connected to the influence proportion selection unit, for when the influence proportion automatic generation function is enabled, using the influence proportion generation algorithm, according to the transmission order m of the current data frame and the preset number N of valid previous data frames, generate the generated value of the influence proportion of the baud rate initial value, the generated value of the influence proportion of the first baud rate calibration value, and / or the generated values of the influence proportions corresponding to at most N-1 second baud rate calibration values; A baud rate threshold detection unit, for recording 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 the preset baud rate calibration allowable range of the data segment.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the baud rate calibration method according to any one of claims 1-4.
8. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, and characterized in that, When the computer program is executed by the processor, it implements the baud rate calibration method according to any one of claims 1-4.
Citation Information
Patent Citations
Uplink rate adjusting method and device, electronic equipment and storage medium
CN113423122A
Data sampling method and device
CN118689831A