Data transmission method, electronic control unit, computer program product and vehicle
By cycling counting and error compensation of synchronous pulses under the SENT protocol, the problem of pulse signal cycle timing error in sensor data transmission is solved, and the accuracy of the electronic control unit to obtain sensor data is realized.
Patent Information
- Application Number
- CN202411396869.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-08
AI Technical Summary
Under the SENT protocol, during the transmission of sensor data, the sensor data obtained by the electronic control unit is inaccurate due to the pulse signal cycle timing error.
By acquiring the synchronization pulses in the data frame sent by the sensor, cycling counting is performed using the first cycle length, the clock time information of the synchronization pulse is determined, and the error compensation parameters are determined based on the signal margin, which is used to compensate the target pulse for errors, so as to accurately Determines the clock time information and sensor data of the target pulse.
It effectively reduces errors in pulse signal transmission, ensures that the electronic control unit can accurately obtain the data content in the data frame sent by the sensor, with extremely small errors.
Smart Images

Figure CN118900168B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission, and in particular to a data transmission method, an electronic control unit, a computer program product and a vehicle. Background Art
[0002] The smart sensor bus SENT (Single Edge Nibble Transmission, SENT) is a serial bus mainly used for communication between vehicle-mounted smart sensors and vehicle-mounted electronic control units (Electronic Control Unit: ECU). Data transmission based on the SENT protocol (such as Short PWM Code, SPC, short pulse encoding) is mainly used for communication between high-precision sensors such as angle sensors, three-axis position sensors, linear Hall sensors, etc. and electronic control units, thereby replacing the application of CAN / LIN bus in these scenarios. However, in the process of transmitting sensor data to the electronic control unit, when processing the pulse signal in the sensor data, due to the error in the pulse signal cycle timing, the transmission value corresponding to the pulse signal will have an error, resulting in inaccurate sensor data obtained by the electronic control unit. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a data transmission method, an electronic control unit, a computer program product and a vehicle. The method enables the electronic control unit to accurately obtain the data content contained in the data frame sent by the sensor with minimal error.
[0004] In order to solve the above problems, an embodiment of the present application provides a data transmission method, which is applied to an electronic control unit, comprising:
[0005] Acquire a synchronization pulse in a data frame sent by a sensor, and perform cycle counting on the synchronization pulse using a first cycle length to determine first clock time information of the synchronization pulse, wherein the first clock time information includes a first cycle time and a first signal margin;
[0006] determining a preset number of error compensation parameters based on the first signal margin, wherein the error compensation parameters are used to perform error compensation on a cycle count of a target pulse in the data frame;
[0007] Determining a target cycle time based on the first cycle time and / or the error compensation parameter;
[0008] Based on the target cycle time, cycle counting is performed on the target pulse in the data frame to determine second clock time information of the target pulse;
[0009] Based on the second clock time information, target sensing data sent by the sensor is determined.
[0010] Optionally, the first cycle length is a preset clock length, and the using the first cycle length to perform cycle counting on the synchronization pulse to determine the first clock time information of the synchronization pulse includes:
[0011] Based on the preset clock length, counting the sync pulse in cycles to determine a first number of cycles of the sync pulse and the first signal margin;
[0012] Based on the first cycle number, the corresponding first cycle time is determined.
[0013] Optionally, determining a preset number of error compensation parameters based on the first signal margin includes:
[0014] Based on the preset number, performing a first shift operation on the binary value of the first signal margin to obtain corresponding intermediate data;
[0015] In a case where the clock counting time during the cycle counting of the target pulse is the same as the first signal margin, a plurality of error compensation parameters are determined based on sequentially arranged bit values in the intermediate data.
[0016] Optionally, determining the target cycle time based on the first cycle time and / or the error compensation parameter includes:
[0017] The error compensation parameter is summed with the corresponding first cycle times to obtain a plurality of target cycle times.
[0018] Optionally, the step of performing cycle counting on the target pulse in the data frame based on the target cycle time to determine the second clock time information of the target pulse includes:
[0019] Based on the multiple target cycle times, counting the target pulse in cycles, determining a second cycle number of the target pulse and a second signal margin of the target pulse;
[0020] The second clock time information is determined based on a second cycle number of the target pulse and the second signal margin.
[0021] Optionally, determining the second clock time information based on the second cycle number of the target pulse and the second signal margin includes:
[0022] Based on the value of the second signal margin, the second signal margin is discarded, and the second cycle number is determined as the second clock time information, or,
[0023] The second cycle number is incremented by 1 to form the second clock time information.
[0024] Optionally, determining the target sensing data sent by the sensor based on the second clock time information includes:
[0025] Based on the pulse width range information of the data frame, the clock difference in the second clock time information is removed to obtain the target sensing data.
[0026] An embodiment of the present application further provides an electronic control unit, including a processor and a memory, wherein the memory stores an executable program, and the memory executes the executable program to perform the steps of the method described above.
[0027] An embodiment of the present application also provides a computer program product, including a computer program / instruction, characterized in that the steps of the above method are implemented when the computer program / instruction is executed by a processor.
[0028] An embodiment of the present application also provides a vehicle, comprising the electronic control unit as described above, and also comprising a sensor connected to the electronic control unit.
[0029] The data transmission method of the embodiment of the present application determines the error compensation parameter based on the signal margin obtained by the cycle counting of the synchronization pulse signal during the processing of the pulse signal of the sensor data. Therefore, in the process of cycle counting of the target pulse in the pulse signal, the SENT clock width of the target pulse can be accurately determined based on the error compensation parameter, so that the electronic control unit can accurately obtain the data content contained in the data frame sent by the sensor with extremely small error. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A flowchart of a data transmission method according to an embodiment of the present application;
[0031] Figure 2 For the embodiments of this application Figure 1 A flowchart of an embodiment of step S100;
[0032] Figure 3 For the embodiments of this application Figure 1 A flowchart of an embodiment of step S200;
[0033] Figure 4 For the embodiments of this application Figure 1A flowchart of an embodiment of step S400;
[0034] Figure 5 A waveform diagram of a data frame according to an embodiment of the present application;
[0035] Figure 6 This is a structural block diagram of an electronic control unit according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] Various aspects and features of the present application are described herein with reference to the accompanying drawings.
[0037] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.
[0038] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0039] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.
[0040] It should also be understood that although the present application has been described with reference to some specific examples, those skilled in the art will be able to readily implement many other equivalent forms of the present application.
[0041] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
[0042] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.
[0043] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.
[0044] A data transmission method in an embodiment of the present application is applied to an electronic control unit (Electronic Control Unit: ECU), such as an on-board ECU, and the electronic control unit can receive data from a sensor and determine the data content. SENT (Single Edge Nibble Transmission) / SPC (Short PWM Code) are both serial bus communication protocols mainly used for communication between on-board smart sensors and on-board electronic control units.
[0045] The SENT protocol is a unidirectional transmission from the sensor to the ECU. The sensor based on the SENT protocol transmits a data frame, which includes a series of pulse signals, and the transmission data is encoded in the cycle time between the falling edge and the falling edge of the pulse signal. In this embodiment, the data frame includes a synchronization pulse and at least one target pulse. The synchronization pulse is the header signal (frame header) of the data frame, and the subsequent signal is one or more target pulses. The target pulse contains the specific information sensed by the sensor.
[0046] like Figure 5 As shown, the sensor based on the SENT protocol has a synchronization pulse (sync pulse) at the head of each data frame, such as a synchronization pulse with a length of 56 SENT clocks (tick). The receiving ECU will analyze the synchronization pulse and count the synchronization pulse with a cycle length (which can be calculated in SENT clocks) to obtain the corresponding number of cycles and signal margins, and then determine the cycle time (or SENT clock period, measured in SENT clocks) that characterizes the width of the synchronization pulse based on the number of cycles and signal margins. Based on the different contents of the cycle time of the synchronization pulse, the width (number of ticks) of each cycle time of at least one target pulse in the subsequent received data frame is calculated, thereby decoding the received target sensor data, such as the value of the Nibble pulse (4-bit data).
[0047] Based on the above content, the data transmission method of the embodiment of the present application is described in detail. Figure 1 is a flow chart of a data transmission method according to an embodiment of the present application, such as Figure 1 As shown, combined with Figure 5 , the method comprises the following steps:
[0048] S100, acquiring a synchronization pulse in a data frame sent by a sensor, and performing cycle counting on the synchronization pulse using a first cycle length to determine first clock time information of the synchronization pulse, wherein the first clock time information includes a first cycle time and a first signal margin.
[0049] Exemplarily, the sensor can be installed on the equipment and send the sensed data to the electronic control unit (ECU) in the form of a data frame. The electronic control unit obtains the data frame sent by the sensor. The data frame includes a synchronization pulse and at least one target pulse, wherein the synchronization pulse (sync pulse) can represent multiple parameter information of the data frame, and the target pulse contains the specific information sensed by the sensor.
[0050] After acquiring the synchronization pulse, the synchronization pulse can be cycle counted (cycle sampled) using the first cycle length, that is, the first cycle length is used as a cycle unit. The first cycle length is a preset length and can be counted with a SENT clock (tick), such as the first cycle length can be a preset 56 SENT clocks. Cycle counting of the synchronization pulse can determine the first cycle number of the synchronization pulse and the first signal margin after the cycle counting, wherein the first signal margin can be 0 or a value less than the first cycle length. Based on the first cycle number and the first signal margin, the first clock time information characterizing the clock period of the synchronization pulse can be determined. The first clock time information is the relevant parameter information in the cycle counting process of the synchronization pulse, including the first cycle time and the first signal margin, wherein the first signal margin can be a finite value or 0.
[0051] The first cycle time represents the current SENT clock cycle of the sensor and can represent the width of the synchronization pulse.
[0052] S200, determining a preset number of error compensation parameters based on the first signal margin, wherein the error compensation parameters are used to perform error compensation on a cycle count of a target pulse in the data frame.
[0053] Exemplarily, the synchronization pulse is the header signal (frame header) of the data frame, and the subsequent signal is one or more target pulses of the data frame, and the target pulse contains specific information sensed by the sensor. In one embodiment, the width of the synchronization pulse may not be an integer multiple of the first cycle length. In this case, after the synchronization pulse is cycle counted, it is determined that it has a first signal margin and the first signal margin is not 0. The embodiment of the present application needs to eliminate the error generated in the cycle counting process of the target pulse based on the first signal margin.
[0054] A preset number of error compensation parameters can be determined based on a preset mathematical model and taking the first signal margin as input, for example, by determining the error compensation parameters corresponding to the first signal margin based on a comparison result between the cycle time of the target pulse and the first signal margin during cycle counting of the target pulse.
[0055] In the process of counting multiple target pulses, a preset number of error compensation parameters are used to compensate the pulse widths of the corresponding target pulses determined in the cycle counting process. For example, if the target pulse is a Nibble pulse, the SENT clock width of the Nibble pulse is compensated.
[0056] In another embodiment, the width of the synchronization pulse may also be an integer multiple of the first cycle length. In this case, after the synchronization pulse is cycle counted, the first signal margin is determined to be 0. In this case, based on the preset mathematical model, the first signal margin with a value of 0 can be used as input, and the output result obtained is that there is no need to perform error compensation on the cycle count of the target pulse in the data frame, or the determined error compensation parameter is 0, which also indicates that no substantial error compensation is performed on the cycle count of the target pulse.
[0057] S300: Determine a plurality of target cycle times based on the first cycle time and / or the error compensation parameter.
[0058] Exemplarily, on the one hand, the width of the synchronization pulse is an integer multiple of the first cycle length. In this case, after the synchronization pulse is cycle counted, the value of the first signal margin is 0, and the first cycle number can be determined as the first cycle time. When the value of the first signal margin is 0, the error compensation parameter can no longer be used to perform error compensation on the cycle count of the target pulse.
[0059] On the other hand, the first cycle time can be determined based on the first cycle number of the synchronization pulse after the synchronization pulse is cycle counted and the first signal margin is not 0. The first cycle time represents the current SENT clock period of the sensor and can represent the width of the synchronization pulse.
[0060] In one embodiment, the error compensation parameter may be summed with the corresponding first cycle time to obtain the corresponding target cycle time; or the error compensation parameter may be corrected and then summed with the second cycle time to obtain the corresponding target cycle time. The target cycle time is used to cycle count subsequent target pulses in the data frame.
[0061] S400, based on the multiple target cycle times, cycle counting the target pulse in the data frame to determine the second clock time information of the target pulse.
[0062] Exemplarily, the second clock time information is relevant parameter information in the cycle counting process of the target pulse. The target sensing data contained in the target pulse can be determined based on the second clock time information.
[0063] Since the target cycle time may be a SENT clock that can represent a signal width, the second clock time information determined by counting the target pulse based on the target cycle time may be a SENT clock width of the target pulse. The SENT clock includes the target sensing data to be transmitted by the target pulse.
[0064] Exemplarily, the target cycle time may be used as a cycle unit to perform cycle counting on the target pulse to determine a second cycle number of the target pulse, and then the second clock time information of the target pulse may be determined based on the second cycle number and the second margin.
[0065] For example, since the target cycle time may be a SENT clock that can represent a signal width, the second clock time information determined by counting the target pulses based on multiple target cycle times may be a SENT clock width of the target pulse. The SENT clock width includes the target sensor data to be transmitted by the target pulse. Further, the target sensor data included in the target pulse may be determined based on the second clock time information.
[0066] In addition, since each cycle count of the target pulse has been compensated by the error compensation parameter, the accuracy of the determined second clock time information of the target pulse is greatly increased.
[0067] S500: Determine target sensing data sent by the sensor based on the second clock time information.
[0068] Exemplarily, the SENT protocol specifies that the width of a nibble pulse (data frame) ranges from 12 to 27 SENT clocks, and the range of target sensor data is a 4-bit decimal number from 0 to 15.
[0069] According to the SENT protocol, the minimum value of the width range in the second clock time information can be removed to obtain the actual data. For example, the value obtained by subtracting 12 SENT clocks from the second clock time information is the target sensing data. Figure 5 As shown, for example, the second clock time information 12 ticks, minus 12, gets 0 data, then the 0 data is a target sensor data; for another example, the second clock time information 27 ticks, minus 12, gets 15 data, then the 15 data is another target sensor data; for another example, the second clock time information 17 ticks, minus 12, gets 5 data, then the 5 data is also another target sensor data. Based on all the target sensor data, the data content contained in the data frame sent by the sensor to the ECU can be represented.
[0070] The data transmission method of the embodiment of the present application determines the error compensation parameter based on the signal margin obtained by the cycle counting of the synchronization pulse signal during the processing of the pulse signal of the sensor data. Therefore, in the process of cycle counting of the target pulse in the pulse signal, the SENT clock width of the target pulse can be accurately determined based on the error compensation parameter, so that the electronic control unit can accurately obtain the data content contained in the data frame sent by the sensor with extremely small error.
[0071] In one embodiment of the present application, the first cycle length is a preset clock length, and the first cycle length is used to count the sync pulses in a cycle to determine the first clock time information of the sync pulses, such as Figure 2 As shown, the following steps are included:
[0072] S110, based on the preset clock length, counting the cycles of the synchronization pulse to determine a first cycle number of the synchronization pulse and the first signal margin.
[0073] S120: Determine the corresponding first cycle time based on the first cycle number.
[0074] Exemplarily, the first cycle length is a preset clock length, and the preset clock length may be predetermined based on a data frame transmission protocol. For example, when the data frame is based on a SENT protocol for data transmission, the preset clock length may be determined as 56 SENT ticks.
[0075] Based on the preset clock length, the synchronization pulse is cycle counted. For example:
[0076] The electronic control unit (ECU) counts the SENT synchronization pulses with 56 sampling clock cycles. When the counting is finished, if the first cycle of the 56 sampling clock counts is Rtick, and the first signal margin of the current synchronization pulse is Rrem, then it can be considered that the current SENT clock cycle of the sensor, measured by the sampling clock, has a width of:
[0077] Ttick = Rtick +Round(Rrem);
[0078] Among them, the specific function of the Round() function is that for any integer Rrem from 0 to 55, if Rrem is greater than or equal to 28, it returns 1, otherwise it returns 0.
[0079] Among them, Ttick is the first cycle time.
[0080] In one embodiment of the present application, when the first clock time information indicates that the synchronization pulse has been cycle counted and has a first signal margin, a preset number of error compensation parameters are determined based on the first signal margin, such as Figure 3 As shown, including:
[0081] S210, based on the preset number, performing a first shift operation on the binary value of the first signal residue to obtain corresponding intermediate data;
[0082] S220, when the clock counting time in the process of cyclic counting of the target pulse is the same as the first signal margin, determine the plurality of error compensation parameters based on the sequentially arranged bit values in the intermediate data.
[0083] In one embodiment of the present application, determining the target cycle time based on the first cycle time and / or the error compensation parameter includes:
[0084] The error compensation parameter is summed with the corresponding first cycle times to obtain a plurality of target cycle times.
[0085] For example, after the cycle counting of the synchronization pulse is completed, the first signal margin is loop56_cnt, the value is 33, and the first cycle number of the cycle counting is pulse56_cnt (first cycle time), which is 10.
[0086] Specifically, the 6-bit binary value of the first signal margin loop56_cnt is 6'b100001, and the first shift operation is performed on it, that is, it is shifted right by 3 bits to obtain 3'b100. When the preset number is 7, for 3'b100, the corresponding value of 7 bits (called delta_sel) obtained based on the query of the preset table is 7'b0001111. This 7'b0001111 is the intermediate data.
[0087] Then, when the first cycle number pulse56_cnt is used to count the input target pulse, the counter tick_run_cnt is used to count the clock sample_clock of the target pulse, and tick_cnt is increased by 1 each time a cycle count is completed. Among them, the counter tick_run_cnt is the clock counting time of the target pulse in the cycle counting process, which is dynamically changing data. If tick_run_cnt=loop56_cnt during the counting process, firstly, according to the current tick_cnt value, the corresponding bit data of delta_sel is searched, for example, the current tick_cnt=0, and the bit 0 of delta_sel is 1 (that is, the word value of the first bit counted from right to left in 7'b0001111 is 1), and the word value is determined as the error compensation parameter, that is, the error compensation parameter is 1. Then, it is necessary to count one more sample_clock when counting the target pulse to reset the counter tick_run_cnt to 1 to count the target pulse again. At the same time, the first cycle number pulse56_cnt is increased by 1, and a new target cycle time is determined, which is used as a new cycle count length of the counter tick_run_cnt. At the same time, tick_cnt is accumulated by 1.
[0088] When tick_cnt has accumulated to 4, and the clock sample clock has counted to loop56_cnt (value is 33), that is, tick_run_cnt=loop56_cnt, then the bit data corresponding to delta_sel in the preset table is searched, and the value of bit4 is 0 (that is, the word value of the fifth bit counted from right to left in 7'b0001111 is 0), and the word value is determined as the error compensation parameter, that is, the error compensation parameter is 0. At this time, there is no need to count 1 more sampleclock when counting the target pulse. The counter tick_run_cnt can be directly reset and tick_cnt is accumulated by 1. If tick_cnt has accumulated to the preset number 7, the bit data of the corresponding delta_sel is looped back to bit0, and the counting is cyclic until the counting of the input target pulse is completed. Based on the counting result of the counter tick_run_cnt, the final tick_cnt is the second cycle number of the target pulse.
[0089] In one embodiment of the present application, based on the multiple target cycle times, the target pulses in the data frame are cycle counted to determine the second clock time information of the target pulses, such as Figure 4 As shown, including:
[0090] S410, based on the plurality of target cycle times, counting the cycles of the target pulse to determine a second cycle number of the target pulse and a second signal margin of the target pulse;
[0091] S420: Determine the second clock time information based on the second cycle number of the target pulse and the second signal margin.
[0092] Exemplarily, further description is given in combination with the above embodiment. After determining the target cycle time, the target pulse is cycle counted based on the target cycle time to determine the corresponding second cycle number, as described in the above embodiment, and the final tick_cnt is the second cycle number of the target pulse. Further description is given in combination with the above embodiment.
[0093] The data frame may include multiple target pulses. For each target pulse, the target pulse may be cycle counted based on the determined multiple identical or different target cycle times to determine a second cycle number of the target pulse and a second signal margin of the target pulse.
[0094] The value of the second signal margin may be 0, or may be a value less than the target cycle time. Based on the specific value of the second signal margin, the second cycle number may be incremented by 1 or 0 to determine the second clock time information.
[0095] In one embodiment of the present application, determining the second clock time information based on the second cycle number of the target pulse and the second signal margin includes:
[0096] Based on the value of the second signal margin, the second signal margin is discarded, and the second cycle number is determined as the second clock time information, or,
[0097] The second cycle number is incremented by 1 to form the second clock time information.
[0098] Exemplarily, the target pulse in the data frame includes the data content sent by the sensor to the electronic control unit (ECU). The target cycle time represents the current SENT clock period of the sensor and can represent the width of the synchronization pulse. Based on the target cycle time, the target pulse in the data frame is cycle counted to determine the corresponding second cycle count and the second signal margin.
[0099] In combination with the above embodiment, when the first cycle time is the same as the corresponding target cycle time, the Nibble pulses (target pulses) subsequently received by the ECU are counted in Ttick sampling clock cycles based on the target cycle time. When the Nibble pulse counting ends, if the signal margin count does not reach Ttick, it is determined that the second signal margin of the target pulse is not 0, and the above Round() function is used for the second signal margin. When calculating the second clock time information, if the second signal margin is greater than or equal to half of the second cycle time, 1 is returned, otherwise 0 is returned. When 0 is returned, it indicates that the second signal margin is discarded when determining the second clock time information. When 1 is returned, the value of 1 is added to the second cycle number obtained by counting the target pulse in a cycle, and the value of the cycle count is Vnibble, which is the second clock time information.
[0100] In one embodiment of the present application, determining the target sensing data sent by the sensor based on the second clock time information includes:
[0101] Based on the pulse width range information of the data frame, the clock difference in the second clock time information is removed to obtain the target sensing data.
[0102] Exemplarily, the SENT protocol specifies that the width of a nibble pulse (data frame) ranges from 12 to 27 SENT clocks, and the range of target sensor data is a 4-bit decimal number from 0 to 15.
[0103] In this embodiment, the pulse width range information of the data frame can be determined based on the SENT protocol, such as 12 to 27 SENT clocks. Therefore, the corresponding clock difference is 12. In addition, the data frame may also include a CRT correction signal for correcting the pulse signal and a stop signal indicating signal termination.
[0104] When determining the target sensing data transmitted by the sensor, after performing ring counting on each target pulse, a plurality of second clock time information are determined, and the specific value of each determined second clock time information can be subtracted by 12 to obtain the target sensing data.
[0105] like Figure 5As shown, for example, when the second clock time information is 12 ticks, minus 12, 0 data is obtained, and the 0 data is the first target sensor data. When the second clock time information is 27 ticks, minus 12, 15 data is obtained, and the 15 data is the second target sensor data. When the second clock time information is 17 ticks, minus 12, 5 data is obtained, and the 5 data is also the third target sensor data. When the second clock time information is 22 ticks, minus 12, 10 data is obtained, and the 10 data is the fourth target sensor data. When the second clock time information is 14 ticks, minus 12, 2 data is obtained, and the 2 data is the fifth target sensor data. When the second clock time information is 20 ticks, minus 12, 8 data is obtained, and the 8 data is the sixth target sensor data. When the second clock time information is 12 ticks, minus 12, 0 data is obtained, and the 0 data is the seventh target sensor data. Finally, all the target sensor data is determined to be "0, 15, 5, 10, 2, 8, 0", which is the data content sent by the sensor to the ECU.
[0106] The present application also provides an electronic control unit, such as Figure 6 As shown, it includes a processor and a memory, wherein an executable program is stored in the memory, and the memory executes the executable program to perform the steps of the method as described above.
[0107] An embodiment of the present application also provides a computer program product, including a computer program / instruction, characterized in that the steps of the above method are implemented when the computer program / instruction is executed by a processor.
[0108] The embodiment of the present application also provides a vehicle, comprising the electronic control unit as described above, and also comprising a sensor connected to the electronic control unit. The electronic control unit receives a data frame sent by the sensor, and determines target sensor data contained in the data frame.
[0109] An embodiment of the present application further provides a storage medium, wherein the storage medium carries one or more computer programs, and when the one or more computer programs are executed by a processor, the steps of the method described above are implemented.
[0110] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0111] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0112] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) is integrated in the processor.
[0113] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0114] It should also be understood that the first, second, third, fourth and various numerical numbers involved in this document are only distinctions made for the convenience of description and are not intended to limit the scope of the present application.
[0115] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0116] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0117] In various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0118] Those skilled in the art will appreciate that the various illustrative logical blocks (ILBs) and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed methods, electronic control units, and computer program products can be implemented in other ways. For example, the embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data transmission method, It is characterized in that Applications in electronic control units, including: Acquire a synchronization pulse in a data frame sent by a sensor, and perform cycle counting on the synchronization pulse using a first cycle length to determine first clock time information of the synchronization pulse, wherein the first clock time information includes a first cycle time and a first signal margin; determining a preset number of error compensation parameters based on the first signal margin, wherein the error compensation parameters are used to perform error compensation on a cycle count of a target pulse in the data frame; determining a target cycle time based on the first cycle time and the error compensation parameter; Based on the target cycle time, cycle counting is performed on the target pulse in the data frame to determine second clock time information of the target pulse; Based on the second clock time information, the target sensing data sent by the sensor is determined; wherein, The determining a preset number of error compensation parameters based on the first signal margin comprises: Based on the preset number, performing a first shift operation on the binary value of the first signal margin to obtain corresponding intermediate data; When the clock counting time during the cycle counting of the target pulse is the same as the first signal margin, a plurality of error compensation parameters are determined based on the sequentially arranged word bit values in the intermediate data; The determining a target cycle time based on the first cycle time and the error compensation parameter comprises: The error compensation parameter is summed with the corresponding first cycle times to obtain a plurality of target cycle times.
2. The data transmission method according to claim 1, It is characterized in that The first cycle length is a preset clock length, and the step of using the first cycle length to cycle count the synchronization pulse to determine the first clock time information of the synchronization pulse includes: Based on the preset clock length, counting the sync pulse in cycles to determine a first number of cycles of the sync pulse and the first signal margin; Based on the first cycle number, the corresponding first cycle time is determined.
3. The data transmission method according to claim 1, It is characterized in that The step of performing cycle counting on the target pulse in the data frame based on the target cycle time to determine second clock time information of the target pulse includes: Based on the multiple target cycle times, counting the target pulse in cycles, determining a second cycle number of the target pulse and a second signal margin of the target pulse; The second clock time information is determined based on a second cycle number of the target pulse and the second signal margin.
4. The data transmission method according to claim 3, It is characterized in that The determining the second clock time information based on the second cycle number of the target pulse and the second signal margin includes: Based on the value of the second signal margin, the second signal margin is discarded, and the second cycle number is determined as the second clock time information, or, The second cycle number is incremented by 1 to form the second clock time information.
5. The data transmission method according to claim 3, It is characterized in that The determining, based on the second clock time information, the target sensing data sent by the sensor includes: Based on the pulse width range information of the data frame, the clock difference in the second clock time information is removed to obtain the target sensing data.
6. An electronic control unit, It is characterized in that The invention comprises a processor and a memory, wherein an executable program is stored in the memory, and the memory executes the executable program to perform the steps of the method according to claim 1.
7. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method as claimed in claim 1 are implemented.
8. A vehicle, It is characterized in that The electronic control unit according to claim 6 further comprises a sensor connected to the electronic control unit.
Citation Information
Patent Citations
High-speed high-precision mass storage and rapid transmission method for sampling data
CN111949577A
Multifunctional serial interface communication device and serial data transmission control method
CN115017084A
Short pulse width modulation (PWM) code (SPC) / single edge nibble transmission (SENT) sensors with increased data rates and automatic protocol detection
US20190199451A1
Method and control system for the synchronized transmission of digital data
US5969631A
