A method, system and medium for automatically detecting transmission rate based on SENT protocol
Through synchronous frame detection and frame format verification, the SENT protocol transmission rate is automatically detected, which solves the problem of tedious configuration steps of the SENT protocol controller and achieves more efficient data reception and a simple configuration process.
Patent Information
- Application Number
- CN202410888516.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The existing SENT protocol controller has cumbersome steps when configuring the transmission rate, making the configuration process inconvenient. Especially when the transmission demand increases, the increase in the number of channels leads to increased configuration complexity.
Through the combination of synchronization frame detection, frame format verification and synchronization frame verification stages, the transmission rate is automatically detected, omitting the configuration steps of sensor characteristics and working clock, and directly outputting the Tick time to determine whether the transmission rate complies with the SENT protocol.
It realizes automatic detection of transmission rate when receiving SENT protocol messages, simplifies the configuration process, and improves ease of use and data reception efficiency.
Smart Images

Figure CN118433077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a method, system and medium for automatically detecting transmission rate based on a SENT protocol. Background Art
[0002] With the continuous development of automotive electronic technology, the SENT protocol is increasingly widely used in automotive sensor applications. The SENT bus protocol is a single bus protocol, so the transmission rate of the SENT protocol needs to be agreed upon by both parties. Currently, the SENT protocol controllers launched on the market all achieve data transmission by configuring the same transmission rate as the sensor.
[0003] As the SENT transmission requirements increase, the number of controller channels also increases exponentially, so this configuration step makes the configuration process of the SENT controller relatively cumbersome. Summary of the invention
[0004] The purpose of the present invention is to overcome the deficiencies of the prior art and to provide a method, system and medium for automatically detecting transmission rate based on the SENT protocol.
[0005] The objective of the present invention is achieved through the following technical solutions: The first aspect of the present invention provides: a method for automatically detecting a transmission rate based on a SENT protocol, comprising the following steps:
[0006] S1: Synchronous frame detection stage, the SENT signal is detected according to the system clock signal, and the synchronous frame detection method is used to detect whether each frame may be a synchronous frame in turn according to the high and low level ratio range of the synchronous frame in the SENT standard protocol. If it is detected that it may be a synchronous frame, its Tick time is calculated and S2 is executed;
[0007] S2: Frame format verification stage: according to the Tick time of the synchronization frame, the frame format verification method is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn. At the same time, it is confirmed whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, S3 is executed;
[0008] S3: Synchronous frame verification stage, detect the synchronous frame at this time, calculate its Tick time and determine whether the error between two adjacent synchronous frames is within the range specified by the SENT protocol through the adjacent rate error comparison method. If it is within the range specified by the SENT protocol, the Tick time of the current synchronous frame is output.
[0009] Preferably, the S2: frame format verification stage further includes the following steps:
[0010] When the frame format is incorrect and the current frame is not a synchronization frame, S1 is executed again.
[0011] Preferably, the S2: frame format verification stage further includes the following steps:
[0012] When the frame format is incorrect and the current frame is a synchronization frame, the Tick time of the synchronization frame is updated and S2 is re-executed.
[0013] Preferably, the S3: synchronization frame verification phase further includes the following steps:
[0014] When the error between two adjacent synchronization frames is not within the range specified by the SENT protocol, S1 is executed again.
[0015] Preferably, the frame time length ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are: 56Ticks, 12-27Ticks, 12-27Ticks, 12-27Ticks, 12-768Ticks, respectively, and the low level holding time of the synchronization frame, status frame, data frame, CRC frame and stop frame are the same and between 5-10Ticks.
[0016] Preferably, the high-low level ratio ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are: 5.6-11.2, 1.2-5.4, 1.2-5.4, 1.2-5.4, 1.2-153.6 respectively; the synchronization frame detection method includes the following steps: when the high-low level time ratio is detected to be 5.6-11.2, it is judged that it may be a synchronization frame.
[0017] Preferably, the frame format verification method includes the following steps: verifying in sequence according to the Tick time whether the time length of the measured frame is within the corresponding frame time length range; if the time length of the measured frame is not within the corresponding frame time length range, the current Tick time is considered to be wrong.
[0018] Preferably, the SENT protocol specifies that the Tick error range between adjacent synchronization frames is less than 1 / 64.
[0019] The second aspect of the present invention provides: a system for automatically detecting transmission rate based on the SENT protocol, which is used to implement any of the above-mentioned methods for automatically detecting transmission rate based on the SENT protocol, comprising:
[0020] The synchronization frame detection module is used to detect the SENT signal according to the system clock signal, and use the synchronization frame detection method to detect whether each frame may be a synchronization frame in turn according to the high and low level ratio range of the synchronization frame in the SENT standard protocol. If it is detected that it may be a synchronization frame, its Tick time is calculated and output to the frame format verification module;
[0021] The frame format verification module is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn according to the Tick time of the synchronization frame using the frame format verification method, and at the same time confirm whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, the Tick time is output to the synchronization frame verification module;
[0022] The synchronization frame verification module is used to detect the synchronization frame at this time, calculate its Tick time, and determine whether the error between two adjacent synchronization frames is within the range specified by the SENT protocol through the adjacent rate error comparison method. If it is within the range specified by the SENT protocol, the Tick time of the current synchronization frame is output.
[0023] The third aspect of the present invention provides: a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, any of the above-mentioned methods for automatically detecting transmission rate based on the SENT protocol is implemented.
[0024] The beneficial effects of the present invention are:
[0025] 1) Automatically detect the transmission rate when receiving SENT protocol messages. There is no need to calculate the Tick time based on the sensor characteristics and working clock and configure it to the register, which saves the calculation and configuration steps and makes it easier and faster to use.
[0026] 2) Compared with the existing SENT controllers in the industry, the automatic detection of transmission rate function has been added, which improves the ease of use of the SENT controller and the efficiency of receiving data. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of the automatic detection transmission rate method based on the SENT protocol;
[0028] Figure 2 This is a timing diagram of the SENT protocol. DETAILED DESCRIPTION
[0029] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0030] See also Figure 1-Figure 2 The first aspect of the present invention provides: a method for automatically detecting a transmission rate based on a SENT protocol, comprising the following steps:
[0031] S1: Synchronous frame detection stage, the SENT signal is detected according to the system clock signal, and the synchronous frame detection method is used to detect whether each frame may be a synchronous frame in turn according to the high and low level ratio range of the synchronous frame in the SENT standard protocol. If it is detected that it may be a synchronous frame, its Tick time is calculated and S2 is executed;
[0032] S2: Frame format verification stage: according to the Tick time of the synchronization frame, the frame format verification method is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn. At the same time, it is confirmed whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, S3 is executed;
[0033] S3: Synchronous frame verification stage, detect the synchronous frame at this time, calculate its Tick time and determine whether the error between two adjacent synchronous frames is within the range specified by the SENT protocol through the adjacent rate error comparison method. If it is within the range specified by the SENT protocol, the Tick time of the current synchronous frame is output.
[0034] In this embodiment, S2: the frame format verification stage is to detect the synchronization frame more quickly and accurately to avoid discarding excessive data.
[0035] In some embodiments, the S2: frame format verification phase further includes the following steps:
[0036] When the frame format is incorrect and the current frame is not a synchronization frame, S1 is executed again.
[0037] In some embodiments, the S2: frame format verification phase further includes the following steps:
[0038] When the frame format is incorrect and the current frame is a synchronization frame, the Tick time of the synchronization frame is updated and S2 is re-executed.
[0039] In some embodiments, the S3: synchronization frame verification phase further includes the following steps:
[0040] When the error between two adjacent synchronization frames is not within the range specified by the SENT protocol, S1 is executed again.
[0041] In some embodiments, the frame time length ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are: 56Ticks, 12-27Ticks, 12-27Ticks, 12-27Ticks, 12-768Ticks, and the low level holding time of the synchronization frame, status frame, data frame, CRC frame and stop frame are the same and between 5-10Ticks.
[0042] In this embodiment, the frame time length ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are as follows: Figure 2shown.
[0043] In some embodiments, the high and low level ratio ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are: 5.6-11.2, 1.2-5.4, 1.2-5.4, 1.2-5.4, 1.2-153.6 respectively; the synchronization frame detection method includes the following steps: when the high and low level time ratio is detected to be 5.6-11.2, it is judged that it may be a synchronization frame.
[0044] In this embodiment, the synchronization frame detection method may misdetect a stop frame, so synchronization frame verification is required.
[0045] In some embodiments, the frame format verification method includes the following steps: verifying in sequence according to the Tick time whether the time length of the measured frame is within the corresponding frame time length range; if the time length of the measured frame is not within the corresponding frame time length range, the current Tick time is considered to be wrong.
[0046] In this embodiment, if the synchronization frame detected in S1 is correct, the subsequent ones should be the status frame, the data frame, the CRC frame and the stop frame in sequence, that is, when executing S2, the first verified tested frame should be the status frame, and it is determined whether the time length of the first verified tested frame is within the frame time length range (12-27 Ticks) of the status frame, and then it is determined whether the frame format of the first verified tested frame is correct, and the second tested frame is determined whether it is within the frame time length range (12-27 Ticks) of the data frame, the third tested frame is determined whether it is within the frame time length range (12-27 Ticks) of the CRC frame, and the fourth tested frame is determined whether it is within the frame time length range (12-768 Ticks) of the stop frame. Only when the frame formats of the four tested frames are correct and the four tested frames are not synchronization frames, S3 is executed.
[0047] In some embodiments, the SENT protocol specifies that the Tick error range between adjacent synchronization frames is less than 1 / 64.
[0048] The second aspect of the present invention provides: a system for automatically detecting transmission rate based on the SENT protocol, which is used to implement any of the above-mentioned methods for automatically detecting transmission rate based on the SENT protocol, comprising:
[0049] The synchronization frame detection module is used to detect the SENT signal according to the system clock signal, and use the synchronization frame detection method to detect whether each frame may be a synchronization frame in turn according to the high and low level ratio range of the synchronization frame in the SENT standard protocol. If it is detected that it may be a synchronization frame, its Tick time is calculated and output to the frame format verification module;
[0050] The frame format verification module is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn according to the Tick time of the synchronization frame using the frame format verification method, and at the same time confirm whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, the Tick time is output to the synchronization frame verification module;
[0051] The synchronization frame verification module is used to detect the synchronization frame at this time, calculate its Tick time, and determine whether the error between two adjacent synchronization frames is within the range specified by the SENT protocol through the adjacent rate error comparison method. If it is within the range specified by the SENT protocol, the Tick time of the previous synchronization frame is output.
[0052] The third aspect of the present invention provides: a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, any of the above-mentioned methods for automatically detecting transmission rate based on the SENT protocol is implemented.
[0053] The above is only a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the concept described herein through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not deviate from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A method for automatically detecting transmission rate based on the SENT protocol, characterized in that: The following steps are involved: S1: Synchronous frame detection stage, the SENT signal is detected according to the system clock signal, and the synchronous frame detection method is used to detect whether each frame may be a synchronous frame in turn according to the high and low level ratio range of the synchronous frame in the SENT standard protocol. If it is detected that it may be a synchronous frame, its Tick time is calculated and S2 is executed; S2: Frame format verification stage: according to the Tick time of the synchronization frame, the frame format verification method is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn. At the same time, it is confirmed whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, S3 is executed; S3: Synchronous frame verification stage, detect the synchronous frame at this time, calculate its Tick time and use the adjacent rate error comparison method to determine whether the error between two adjacent synchronous frames is within the range specified by the SENT protocol. If it is within the range specified by the SENT protocol, the Tick time of the current synchronous frame is output; The high and low level ratio ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are respectively: 5.6-11.2, 1.2-5.4, 1.2-5.4, 1.2-5.4, 1.2-153.6; the synchronization frame detection method comprises the following steps: when it is detected that the high and low level time ratio is 5.6-11.2, it is judged that it may be a synchronization frame.
2. The method for automatically detecting transmission rate based on the SENT protocol according to claim 1, characterized in that: The S2: frame format verification phase also includes the following steps: When the frame format is incorrect and the current frame is not a synchronization frame, S1 is executed again.
3. The method for automatically detecting transmission rate based on the SENT protocol according to claim 1, characterized in that: The S2: frame format verification phase also includes the following steps: When the frame format is incorrect and the current frame is a synchronization frame, the Tick time of the synchronization frame is updated and S2 is re-executed.
4. The method for automatically detecting transmission rate based on the SENT protocol according to claim 1, characterized in that: The S3: synchronization frame verification phase also includes the following steps: When the error between two adjacent synchronization frames is not within the range specified by the SENT protocol, S1 is executed again.
5. The method for automatically detecting transmission rate based on the SENT protocol according to claim 1, characterized in that: The frame time length ranges of the synchronization frame, status frame, data frame, CRC frame and stop frame are: 56Ticks, 12-27Ticks, 12-27Ticks, 12-27Ticks, 12-768Ticks respectively, and the low level holding time of the synchronization frame, status frame, data frame, CRC frame and stop frame is the same and between 5-10Ticks.
6. The method for automatically detecting transmission rate based on the SENT protocol according to claim 5, characterized in that: The frame format verification method comprises the following steps: verifying in sequence whether the time length of the measured frame is within the corresponding frame time length range according to the Tick time; if the time length of the measured frame is not within the corresponding frame time length range, it is considered that the current Tick time is wrong.
7. The method for automatically detecting transmission rate based on the SENT protocol according to claim 1, characterized in that: The SENT protocol specifies that the Tick error range between adjacent synchronization frames is less than 1 / 64.
8. An automatic transmission rate detection system based on the SENT protocol, characterized in that: The method for automatically detecting a transmission rate based on the SENT protocol according to any one of claims 1 to 7 comprises: The synchronization frame detection module is used to detect the SENT signal according to the system clock signal, and use the synchronization frame detection method to detect whether each frame may be a synchronization frame in turn according to the high and low level ratio range of the synchronization frame in the SENT standard protocol. If it is detected that it may be a synchronization frame, its Tick time is calculated and output to the frame format verification module; The frame format verification module is used to verify the correctness of the status frame, data frame, CRC frame and stop frame in turn according to the Tick time of the synchronization frame using the frame format verification method, and at the same time confirm whether the current frame is a synchronization frame. When the frame format is correct and the current frame is not a synchronization frame, the Tick time is output to the synchronization frame verification module; The synchronization frame verification module is used to detect the synchronization frame at this time, calculate its Tick time, and determine whether the error between two adjacent synchronization frames is within the range specified by the SENT protocol through the adjacent rate error comparison method. If it is within the range specified by the SENT protocol, the Tick time of the current synchronization frame is output.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the method for automatically detecting transmission rate based on the SENT protocol as described in any one of claims 1 to 7 is implemented.
