Realization method and system for automatically and synchronously receiving transmission data based on SENT protocol
By using algorithms and digital logic in the SENT protocol, configuring fixed ticks and automatically calculating tick values, the problem of complex calculations and inability to track tick values in real time in the prior art is solved, and the effect of simplifying the circuit structure and improving the convenience of use is achieved.
Patent Information
- Application Number
- CN202510153495.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art requires additional clock division design when calculating tick values in the SENT protocol, resulting in complex calculations and inability to track tick values in real time.
Through the algorithm combined with digital logic, fixed ticks are configured, and synchronous segment judgments are performed based on sampled data segments, and the tick values are automatically calculated and tracked without additional clock divisions.
The circuit structure is simplified, the automatic calculation and configuration tick is realized, and the convenience of the SENT protocol is improved, and the synchronization segment decoding is possible without waiting for automatic tracking sensors.
Smart Images

Figure CN119966596A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data transmission, and in particular relates to a method and system for realizing automatic synchronous reception of transmission data based on a SENT protocol. Background Art
[0002] Today, intelligence, interconnection, and electrification are gradually becoming new trends in automobile development. More intelligence relies on more sensors from a technical perspective. The data generated by the sensors is interconnected to the ECU (electronic control unit, ECU). The ECU completes the underlying logic of intelligent driving through data analysis and processing. With the continuous development of new technologies, the degree of electronic control is also getting higher and higher.
[0003] However, the rapid development of electronic control has led to an increasing number of electrical wiring harness connections for electronic devices due to increasing functions and demands. Excessive wiring harness connections not only cause energy waste, but also increase the cost of automotive system design.
[0004] The SENT protocol is formulated by the SAE J2716 standard and is used to transmit high-resolution sensor data from sensors to ECUs. As a low-cost alternative to CAN (Controller Area Network) or LIN (Local Interconnect Network), the SENT protocol is gradually being used in more and more sensors due to its simple wiring harness (only three wiring harnesses are required: data line + positive and negative power supply). For more information about the SENT protocol, please refer to the SAE J2716 standard.
[0005] The SENT protocol has a special definition for the data sampling period, requiring the synchronization segment to be fixed at 56 ticks, which has led to a variety of different technical directions for obtaining the sampling period tick. For example, the Chinese patent with publication number CN118433077 A disclosed on August 2, 2024 a method for automatically detecting the transmission rate based on the SENT protocol. This method is based on determining the ratio range of the low level and the high level in the synchronization segment to obtain the correct synchronization sampling frame. For example, Renesas (Renesas Electronics Corporation) uses different clock division coefficients in its product RH850 User manual (27.4.2) to implement data sampling based on the calculated clock. However, the sampling of the synchronization segment by both requires additional clock division design to calculate the tick value. Summary of the invention
[0006] In order to solve the problem that the current calculation of the actual tick value requires an additional clock for frequency division to assist in calculating the tick value and the tick value cannot be tracked in real time, the present invention provides a method and system for realizing automatic synchronous reception of transmission data based on the SENT protocol, which realizes automatic calculation and configuration of ticks through an algorithm combined with digital logic without the need for additional clock division.
[0007] According to one aspect of the present invention, a method for implementing automatic synchronous reception of transmission data based on a SENT protocol is provided, comprising: Configure fixed tick; Data sampling is performed according to the configured fixed tick; The synchronization segment is judged segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; The tick automatic tracking value of the current data segment is used as the synchronization segment check value to calculate the tick value of the next data segment. If the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a true synchronization segment. The tick automatic tracking value of the current synchronization segment is used as the real-time updated tick signal, and the transmitted data is automatically decoded.
[0008] As a further technical solution, the method further includes: if the tick value of the next data segment is not within the status segment range specified by the SENT protocol, the next data segment is a real synchronization segment, and the tick value of the next data segment is used as a tick signal for real-time update.
[0009] As a further technical solution, a fixed tick is configured to be clock×(1-90us) / 2, where clock is the working clock.
[0010] As a further technical solution, data sampling is performed according to the configured fixed tick, including: The sampled data is counted based on the configured fixed tick. Whenever the count value is equal to the fixed tick value, the counted data is increased by one.
[0011] As a further technical solution, the method further includes: whenever a falling edge of a received SENT signal is sampled, caching the count value.
[0012] Furthermore, the method further includes: determining whether the count value is within a synchronization segment range specified by the SENT protocol.
[0013] As a further technical solution, if the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, it also includes: The sampling data length of the data segment is calculated by a counter in units of 56 clocks, and the calculated data length of the current data segment is used as the tick automatic tracking value.
[0014] As a further technical solution, the method further includes: At the position where the statistics of the value of the current data segment end, it is determined whether the value of the current data segment obtained by statistics is within the data segment range. If so, the previous data segment is a synchronization segment.
[0015] According to one aspect of the present invention, a system for realizing automatic synchronous reception of transmission data based on the SENT protocol is provided, which is implemented by the method described, and the system comprises: Configuration module, used to configure fixed ticks; The sampling module is used to sample data according to the configured fixed tick; The synchronization segment judgment module is used to judge the synchronization segment segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; The synchronization segment determination module is used to use the tick automatic tracking value of the current data segment as the synchronization segment verification value to calculate the tick value of the next data segment. If the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a true synchronization segment. The data demodulation module is used to use the tick automatic tracking value of the current synchronization segment as the real-time updated tick signal to automatically decode the transmitted data.
[0016] According to one aspect of the present invention specification, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the method for realizing the automatic synchronous reception and transmission data based on the SENT protocol is implemented.
[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention simplifies the circuit structure, and there is no need to design clock frequency division (dividing by 56 frequency division calculation) for tick calculation. The algorithm is combined with digital logic to realize automatic calculation and configuration of ticks. 2. The present invention realizes automatic tracking sensor synchronization segment decoding without waiting through special design, thereby improving the convenience of using SENT. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief introduction is given below to the drawings used in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A flowchart of a method for implementing automatic synchronous reception of transmitted data based on the SENT protocol provided in an embodiment of the present invention.
[0020] Figure 2 A schematic diagram of a tick generation and automatic synchronization architecture provided in an embodiment of the present invention.
[0021] Figure 3 A schematic diagram of the SENT protocol frame structure provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The present invention generates a fixed tick through a fixed configuration of the tick configuration, uses the fixed tick sampling data, determines whether the currently collected data is within the synchronization segment range (including two cases: 1. normal synchronization segment; 2. pulse segment, the tick ranges of the two are repeated and need to be distinguished again), and then calculates how many 56 clocks there are in the current data segment, and uses the statistical count value as the automatically updated tick.
[0023] Since the SENT protocol stipulates that sync is fixed at 56 ticks, based on this feature, we can calculate how many 56s there are in a data segment. Assuming it is n, we use clock to accumulate the count. Every time we count to n, it is a tick. Therefore, as long as we find the data segment that meets the requirements, we have found the synchronization segment, and the data of the other data segments can be parsed sequentially.
[0024] Based on the above analysis, the synchronization segment range is found through fixed configuration, and then the real-time data segment value is obtained through automatic tracking. Based on the SENT protocol, the synchronization segment must be followed by a status segment. As long as the value range calculated by real-time tracking is within the status segment length range specified by the SENT protocol, the previous data segment can be considered to be the correct synchronization segment.
[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In addition, the technical features in the various embodiments or single embodiments provided by the present invention are arbitrarily combined with each other to form a new technical solution. This combination is not restricted by the sequence of steps and / or the structural composition mode, but must be based on the ability of ordinary technicians in this field to achieve. When the combination of technical solutions is contradictory or cannot be achieved, it should be considered that this combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0026] The embodiment of the present invention provides a method for realizing automatic synchronous reception of transmission data based on the SENT protocol, such as Figure 1 As shown in the figure, first, a fixed tick is configured; then, data sampling is performed according to the configured fixed tick; then, synchronization segment judgment is performed segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; then, the tick automatic tracking value of the current data segment is used as the synchronization segment check value, and the tick value of the next data segment is calculated. If the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a real synchronization segment; finally, the tick automatic tracking value of the current synchronization segment is used as the real-time updated tick signal to automatically decode the transmitted data.
[0027] Figure 2 The main process of SENT data processing is given, including falling edge sampling, fixed synchronization segment generation, automatic tracking tick generation, locking the correct automatic tracking to generate tick based on the SENT protocol characteristics, and then demodulating the data after the synchronization segment to obtain the data.
[0028] Figure 3 The SENT protocol frame structure diagram is given, and the data calculation given by the SENT protocol is as follows: tick = sync / 56 data ticks = tick_num × n -12 (12~27 ticks, mapped to 0~15) The range of each tick is 1-90us, with a minimum accuracy of 0.1us.
[0029] Assuming that a standard tick is 12us, first, the theoretical period of the check / synchronization pulse in the SENT signal is 56 standard ticks. In actual processing, the period length (672us) is allowed to have an error of ±20% (537.6us~806.4us).
[0030] During analysis, the actual period of the synchronization pulse (672.30) is divided by the theoretical period (672us) to obtain a correction factor K.
[0031] That is: The theoretical time of the synchronization segment is: 12us×56=672us.
[0032] Clock ratio K = 672.30 / 672 = 1.000446428571429 Data Value N: Data Value N = Round[(measurement time of data N / K / 12us - 12].
[0033] Based on the above analysis, the configuration of fixed tick value can be determined.
[0034] Figure 1 The implementation method of automatic synchronous reception of transmission data based on the SENT protocol is given, which specifically includes the following steps: Step 1: The configured fixed tick is generated. The fixed tick value is configured based on clock×(1-90us) / 2, and the configuration value is tick_config.
[0035] Step 2: Use the configured fixed tick to sample data, and use the counter to count tick_half_cnt for tick_config (whenever the count value is equal to tick_config, the data is incremented by one).
[0036] Step 3: Whenever the falling edge of the received SENT signal is sampled, the tick_half_cnt obtained in step 2 is cached into the register.
[0037] Step 4: Determine whether the obtained tick_half_cnt value is within the synchronization segment range (20% margin) specified by the SENT protocol. If the condition is met, it is considered to enter the synchronization resolution phase.
[0038] Step 5. At the same time, the length of each sampled data segment is calculated by a counter in units of 56 clocks (the counter is incremented by one every 56 clocks) tick56_cnt; the tick56_cnt calculation value of the current segment is used as the tick value for real-time following. The tick value for real-time following can be used as the synchronization segment verification value of the current data segment to determine whether the current data segment is a real synchronization segment. The data currently obtained in the synchronization segment data range is the current data segment. If the next segment is a status segment, the current data segment is a real synchronization segment. If it is a synchronization segment range, the current data segment is the pulse segment of the SENT protocol, and the next data segment is a real synchronization segment.
[0039] Step 6, calculate the value of the current data segment through the tick automatic tracking value obtained in step 5. Specifically, calculate how many tick56_cnt there are between two falling edges, and count how many new ticks there are in the current data segment, that is, how many tick56_cnt there are.
[0040] Step 7, at the position where the statistics of the current data segment value end, determine whether the value calculated in step 6 is within the status segment range. If it is within the range, it can be determined that the previous segment of data is the synchronization segment. Therefore, the calculation threshold of the synchronization tick can be locked at the end of the data segment in step 6, which is the tick calculation threshold of the current SENT frame; thereby obtaining a real-time updated tick signal.
[0041] The embodiment of the present invention uses a special configuration so that SENT does not need to provide an additional frequency division circuit design; and the synchronization segment range is determined through a fixed configuration, and then a specific synchronization segment tick is determined through automatic tracking.
[0042] Based on the same inventive concept as the above-mentioned embodiment, the embodiment of the present invention further provides a system for realizing automatic synchronous reception of transmission data based on the SENT protocol, which is used to realize an implementation method for automatic synchronous reception of transmission data based on the SENT protocol. The system includes: a configuration module, which is used to configure a fixed tick; a sampling module, which is used to perform data sampling according to the configured fixed tick; a synchronization segment judgment module, which is used to perform synchronization segment judgment segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; a synchronization segment determination module, which is used to use the tick automatic tracking value of the current data segment as the synchronization segment check value, calculate the tick value of the next data segment, if the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a real synchronization segment; a data demodulation module, which is used to use the tick automatic tracking value of the current synchronization segment as a real-time updated tick signal to automatically decode and obtain the transmitted data.
[0043] The implementation system described in the embodiment of the present invention determines whether the currently collected data are all within the synchronization segment range through the configuration and sampling of the fixed tick. If so, the current data segment is counted with a period of 56 clocks, and the counted value is used as the tick updated in real time; then according to the SENT protocol characteristics sync segment 56 ticks, data / status / crc segment 12-27 ticks, pulse 12-768 ticks, it is determined whether the value of the current data segment corresponding to the tick is within the correct range. If so, the correct synchronization segment can be determined to obtain the automatically tracked tick; based on the tick value obtained by the automatic tracking, automatic demodulation is performed to obtain the correct data.
[0044] Based on the same inventive concept as the above-mentioned embodiment, an embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the method for realizing automatic synchronous reception and transmission of data based on the SENT protocol is implemented.
[0045] In summary, the present invention adopts the counter threshold with good filling calculation according to the requirement of the SENT protocol on tick accuracy (minimum 0.1us), and realizes the generation of tick sampling at the original rate of tick without the need for additional 56tick division and calculation through special clock frequency design (integer multiple of 10 MHz).
[0046] The present invention applies the characteristics of a digital clock, calculates the number of Clknum of each data segment (based on a SENT protocol, between two falling edges of data) (the counter is incremented by 1 every 56 clocks), obtains a decoded assumed value, and then judges whether the decoded assumed value is in a correct range according to the characteristics of the SENT protocol, namely, 56 ticks of the sync segment, 12-27 ticks of the data / status / crc segment, and 12-768 ticks of the pulse, thereby finding the correct synchronization segment and generating an automatically tracked tick; based on the automatically tracked tick value, the correct data is automatically decoded.
[0047] The terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions, for example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to the steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0048] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. A method for realizing automatic synchronous reception of transmission data based on the SENT protocol, characterized in that: include: Configure fixed tick; Data sampling is performed according to the configured fixed tick; The synchronization segment is judged segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; The tick automatic tracking value of the current data segment is used as the synchronization segment check value to calculate the tick value of the next data segment. If the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a true synchronization segment. The tick automatic tracking value of the current synchronization segment is used as the real-time updated tick signal, and the transmitted data is automatically decoded.
2. According to claim 1, a method for realizing automatic synchronous reception of transmission data based on the SENT protocol, characterized in that: The method further includes: if the tick value of the next data segment is not within the state segment range specified by the SENT protocol, the next data segment is a real synchronization segment, and the tick value of the next data segment is used as a tick signal for real-time update.
3. The method for realizing automatic synchronous reception of transmission data based on the SENT protocol according to claim 1, characterized in that: Configure the fixed tick to be clock×(1-90us) / 2, where clock is the working clock.
4. The method for realizing automatic synchronous reception of transmission data based on the SENT protocol according to claim 1, characterized in that: Data sampling is performed according to the configured fixed tick, including: The sampled data is counted based on the configured fixed tick. Whenever the count value is equal to the fixed tick value, the counted data is increased by one.
5. The method for realizing automatic synchronous reception of transmission data based on the SENT protocol according to claim 4, characterized in that: The method further includes: buffering the count value whenever a falling edge of a received SENT signal is sampled.
6. The method for realizing automatic synchronous reception of transmission data based on the SENT protocol according to claim 1, characterized in that: If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, it also includes: The sampling data length of the data segment is calculated by a counter in units of 56 clocks, and the calculated data length of the current data segment is used as the tick automatic tracking value.
7. The method for realizing automatic synchronous reception of transmission data based on the SENT protocol according to claim 1, characterized in that: The method further comprises: At the position where the statistics of the value of the current data segment end, it is determined whether the value of the current data segment obtained by statistics is within the data segment range. If so, the previous data segment is a synchronization segment.
8. A system for realizing automatic synchronous reception of transmission data based on the SENT protocol, characterized in that: The method according to any one of claims 1 to 7 is implemented, wherein the system comprises: Configuration module, used to configure fixed ticks; The sampling module is used to sample data according to the configured fixed tick; The synchronization segment judgment module is used to judge the synchronization segment segment by segment based on the sampled data. If the sampling count value of the current data segment is within the synchronization segment range specified by the SENT protocol, the current data segment is considered to be a synchronization segment, and the tick value of the current data segment is calculated as the tick automatic tracking value; The synchronization segment determination module is used to use the tick automatic tracking value of the current data segment as the synchronization segment verification value to calculate the tick value of the next data segment. If the tick value of the next data segment is within the state segment range specified by the SENT protocol, the current synchronization segment is a true synchronization segment. The data demodulation module is used to use the tick automatic tracking value of the current synchronization segment as the real-time updated tick signal to automatically decode the transmitted data.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are loaded and executed by the processor, the method for automatically and synchronously receiving and transmitting data based on the SENT protocol as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and system for automatically detecting transmission rate based on SENT protocol, and medium
CN118433077A