A vehicle speed calculation method, system, computing device, and medium

By collecting tire rotation pulses within a preset time stamp and calculating the average value, the problem of inaccurate vehicle speed calculation at low speeds is solved, and the accuracy of vehicle speed calculation under low-speed conditions is improved.

CN117491678BActive Publication Date: 2026-07-10辰致科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
辰致科技有限公司
Filing Date
2023-10-30
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies cannot accurately capture the pulses generated by tire rotation through periodic sampling at low speeds, resulting in inaccurate vehicle speed calculations.

Method used

Multiple pulses generated by tire rotation are collected at each preset timestamp to determine the start and end times. The average value of the pulses is calculated to determine the vehicle speed, and the time is updated when the average value is less than the preset value to ensure accuracy.

Benefits of technology

It improves the accuracy of vehicle speed calculation at low speeds, ensuring complete pulse acquisition under low-speed conditions and thus enhancing the precision of vehicle speed calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117491678B_ABST
    Figure CN117491678B_ABST
Patent Text Reader

Abstract

The application relates to a vehicle speed calculation method, system, calculation device and medium, the method comprising collecting a plurality of pulses generated by tire rotation once per preset timestamp, and determining the start time and end time of each preset timestamp; when no pulse generated by tire rotation is collected for a continuous preset duration, recording the current time; determining a target timestamp according to the current time; determining a statistical start time and a statistical end time according to the target timestamp; determining the first number of pulses between the start time and the end time in the target timestamp, and determining the second number of pulses between the statistical start time and the statistical end time; and calculating the vehicle speed according to the average of the first number and the second number. The application solves the problem that a complete tooth pulse cannot be collected through periodic sampling at low speed, so that the effective number of pulses collected by periodic sampling is not necessarily accurate, and the accuracy of the vehicle speed calculated according to the pulses in the period is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and in particular to a method, system, computing device and medium for calculating vehicle speed. Background Technology

[0002] With the development of vehicle electronics technology, people are paying increasing attention to road safety. Since different roads have different safety requirements for vehicle speed, people generally determine their vehicle speed by the speedometer displayed on the vehicle and control it within a safe range using the accelerator or brake. Currently, a common method is periodic sampling, using wheel speed sensors to detect pulses generated when the tires rotate and cut magnetic field lines. The wheel speed is calculated using the number of pulses collected and the corresponding sampling duration, thus obtaining the vehicle speed. However, because only complete pulses can be collected and identified, if the start time of a pulse is between the start and end time of the cycle, it is a "tooth-passing" pulse, which cannot be collected within the cycle. This makes the number of pulses used to calculate the vehicle speed inaccurate. Furthermore, at low speeds, the time interval between pulse generation is longer, meaning that a complete tooth-passing pulse may not be collected within a preset time stamp, leading to an inaccurate number of valid pulses. Therefore, at low speeds, periodic sampling may not be able to collect complete tooth-passing pulses, making the number of valid pulses collected by periodic sampling inaccurate, and consequently, the accuracy of the vehicle speed calculated based on the pulses within the cycle low. Summary of the Invention

[0003] To overcome the problem that at low speeds, periodic sampling may not be able to capture a complete over-tooth pulse, resulting in an inaccurate number of effective pulses and consequently, low accuracy in calculating vehicle speed based on pulses within a period, this invention provides a vehicle speed calculation method, system, computing device, and medium.

[0004] Firstly, in order to solve the above-mentioned technical problems, the present invention provides a method for calculating vehicle speed, comprising:

[0005] S1: Collect multiple pulses generated by tire rotation once at each preset timestamp, and each preset timestamp contains multiple consecutive moments;

[0006] S2: For each preset timestamp, the time that meets the first preset requirement is determined as the start time, and the time that meets the second preset requirement is determined as the end time.

[0007] S3: If no pulse generated by tire rotation is collected for a continuous preset time period, the last moment in the continuous preset time period will be taken as the current moment.

[0008] S4: Calculate the difference between the current time and the end time of each preset timestamp, determine the target end time from each end time based on each difference, and use the preset timestamp corresponding to the target end time as the target timestamp;

[0009] S5: Take the time before the start time in the target timestamp as the start time of the statistics, and take the time before the end time in the target timestamp as the end time of the statistics;

[0010] S6: Determine the first number of pulses between the start and end times in the target timestamp, and determine the second number of pulses between the start and end times of the statistics.

[0011] S7: If the average of the first and second numbers is greater than the preset value, calculate the vehicle speed using the average value. If the average value is less than or equal to the preset value, take the time before the start time of the statistics as the new start time of the statistics, and take the time before the start time as the new start time, and repeat steps S6 to S7.

[0012] Secondly, the present invention also provides a vehicle speed calculation system, comprising:

[0013] The acquisition module is used to acquire multiple pulses generated by the tire rotation once at a preset timestamp, and each preset timestamp contains multiple consecutive moments;

[0014] The first determining module is used to determine, for each preset timestamp, the time that meets the first preset requirement as the start time and the time that meets the second preset requirement as the end time.

[0015] The recording module is used to take the last moment of the consecutive preset time period as the current moment when no pulse generated by tire rotation is collected for a consecutive preset time period.

[0016] The second determining module is used to calculate the difference between the current time and the end time of each preset timestamp, and determine the target end time from each end time based on each difference, and use the preset timestamp corresponding to the target end time as the target timestamp.

[0017] The third determination module is used to take the time before the start time in the target timestamp as the start time of the statistics and the time before the end time in the target timestamp as the end time of the statistics.

[0018] The fourth determining module is used to determine the first number of pulses between the start and end times in the target timestamp, and to determine the second number of pulses between the start and end times of the statistics.

[0019] The calculation module is used to calculate the vehicle speed using the average value if the average value of the first and second numbers is greater than a preset value. If the average value is less than or equal to the preset value, the time before the start time of the statistics is taken as the new start time of the statistics, and the time before the start time is taken as the new start time. The steps corresponding to the fourth determination module to the calculation module are repeated.

[0020] Thirdly, the present invention also provides a computing device, including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the vehicle speed calculation method described above.

[0021] Fourthly, the present invention also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the steps of a vehicle speed calculation method.

[0022] The beneficial effects of this invention are as follows: By determining the start and end times of a preset timestamp, multiple pulses generated by tire rotation can be collected and identified. The invention calculates the first number of pulses between the start and end times of the target timestamp, and the second number of pulses between the time preceding the start time of the target timestamp and the end time of the target timestamp. When the average of the first and second numbers is greater than a preset value, the vehicle speed is calculated. Conversely, when the average of the first and second numbers is less than or equal to the preset value, the start times of the statistics and the start times of the target timestamp are updated, and the first and second numbers are recalculated, ensuring that their average is greater than the preset value. Thus, even at low vehicle speeds, complete over-tooth pulses can be collected, resulting in a more accurate average number of effective pulses for calculating the vehicle speed, thereby improving the accuracy of the speed calculated based on this average. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a vehicle speed calculation method according to the present invention;

[0024] Figure 2 Pulse waveforms acquired using a preset timestamp;

[0025] Figure 3 A schematic diagram of the process for storing edge signals of pulses;

[0026] Figure 4 This is a flowchart illustrating the process of calculating the number of pulses used to determine vehicle speed.

[0027] Figure 5 This is a schematic diagram of the vehicle speed calculation system of the present invention. Detailed Implementation

[0028] The following embodiments are further explanations and supplements to the present invention and do not constitute any limitation on the present invention.

[0029] The following describes a vehicle speed calculation method, system, calculation device, and medium according to an embodiment of the present invention, with reference to the accompanying drawings.

[0030] This invention discloses a vehicle speed calculation method, which is applied to a terminal device. In this application, the terminal device is the executing entity, and the terminal device is used to execute the steps of a vehicle speed calculation method.

[0031] like Figure 1 As shown, the present invention provides a method for calculating vehicle speed, including:

[0032] S1: Collect multiple pulses generated by tire rotation once at each preset timestamp, and each preset timestamp contains multiple consecutive moments.

[0033] The preset timestamp refers to the time period corresponding to the period during periodic sampling.

[0034] S2: For each preset timestamp, the time that meets the first preset requirement is determined as the start time, and the time that meets the second preset requirement is determined as the end time.

[0035] S3: If no pulse generated by tire rotation is collected for a continuous preset time period, the last moment in the continuous preset time period will be taken as the current moment.

[0036] S4: Calculate the difference between the current time and the end time of each preset timestamp, determine the target end time from each end time based on each difference, and use the preset timestamp corresponding to the target end time as the target timestamp;

[0037] S5: Take the time before the start time in the target timestamp as the start time of the statistics, and take the time before the end time in the target timestamp as the end time of the statistics;

[0038] S6: Determine the first number of pulses between the start and end times in the target timestamp, and determine the second number of pulses between the start and end times of the statistics.

[0039] S7: If the average of the first and second numbers is greater than the preset value, calculate the vehicle speed using the average value. If the average value is less than or equal to the preset value, take the time before the start time of the statistics as the new start time of the statistics, and take the time before the start time as the new start time, and repeat steps S6 to S7.

[0040] This embodiment provides a vehicle speed calculation method. By determining the start and end times of a preset timestamp, multiple pulses generated by tire rotation can be collected and identified. The method calculates the first number of pulses between the start and end times of a target timestamp, and the second number of pulses between the time preceding the start time of the target timestamp and the end time of the target timestamp. The vehicle speed is calculated when the average of the first and second numbers is greater than a preset value. Conversely, when the average of the first and second numbers is less than or equal to the preset value, the start times of the statistics and the start times of the target timestamp are updated, and the first and second numbers are recalculated, ensuring that their average is greater than the preset value. This method ensures that even at low vehicle speeds, complete over-tooth pulses can be collected, resulting in a more accurate average number of effective pulses for speed calculation, thus improving the accuracy of the speed calculated based on this average.

[0041] In some embodiments, wheel speed sensors are used to collect pulses generated by tire rotation. Multiple pulses generated by tire rotation are collected at preset timestamps, each preset timestamp containing multiple consecutive moments. The start and end times corresponding to each preset timestamp are determined, ensuring that all pulses generated by tire rotation are included within the start and end times of each preset timestamp, allowing all multiple pulses generated by tire rotation to be collected and identified. If no pulses generated by tire rotation are collected for a consecutive preset duration, the current vehicle speed cannot be calculated. Therefore, the current time needs to be recorded, and the target end time corresponding to the target timestamp used for calculating the vehicle speed is determined based on the difference between the current time and the end time of each preset timestamp. The preset timestamp corresponding to the target end time is used as the target timestamp, minimizing the time difference between the target timestamp and the current time. The moment preceding the start time of the target timestamp is used as the statistical start time, and the moment preceding the end time of the target timestamp is used as the statistical end time. The first number of pulses between the start and end times of the target timestamp is determined, and the second number of pulses between the statistical start and end times is determined. The average of the first and second numbers is calculated. By calculating the average value, compensation can be achieved between adjacent pulse segments, allowing for a more accurate calculation of the pulse count even if critical pulse jitter occurs within the preset timestamp. This improves the accuracy of the vehicle speed calculated using the average value corresponding to the target timestamp. Furthermore, if the average value is less than or equal to the preset value, it indicates that the vehicle speed is too slow. Because the time interval between pulses is longer when the vehicle is traveling at low speed, a complete over-tooth pulse may not be collected within the preset timestamp, resulting in an inaccurate number of valid pulses. When the average value is less than the preset value, the start time of the statistics and the start time of the target timestamp are updated. The updated start time of the statistics and the updated start time of the target timestamp are both earlier than the original timestamp. This ensures that the second number of pulses between the updated start time and the updated end time of the statistics is greater than or equal to the second number of pulses between the original start time and the updated end time of the statistics. Similarly, the first number of pulses between the updated start time and the updated end time of the target timestamp is greater than or equal to the first number of pulses between the original start time and the updated end time of the target timestamp. This results in the average value of the first and second numbers being greater than the preset value, enabling the collection of complete over-tooth pulses even when the tire is traveling at low speed. This allows the target timestamp and the number of valid pulses corresponding to that target timestamp to be determined, thereby improving the accuracy of the calculated vehicle speed.

[0042] When the tire rotates, the pulses collected by the wheel speed sensor have three states: Normal, No_Sensor, and ErrorFault. No_Sensor indicates no wheel speed sensor signal input; if no wheel speed over-tooth signal is collected for a preset duration, the pulse is in the No_Sensor state. ErrorFault indicates a fault state, with faults listed in Table 1. The system immediately enters the Normal state after the fault disappears. Normal indicates a normal state, meaning the pulse can be collected. In the normal state, the hardware channel for wheel speed pulse input is fault-free, or the pulse wavelength is within a preset range. In some embodiments, the preset duration is 250ms, and the set duration is 25ms.

[0043] Table 1

[0044] Fault bit Fault type 0 Overvoltage fault 1 Undervoltage fault 2 Over-temperature fault 3 Hardware circuit module short-circuited to GND 4 Sensor short-circuited to GND 5 Hardware circuit module short circuit to BAT 6 Sensor short-circuited to BAT 7 Overcurrent fault 8 Open circuit fault 9 Sensor type fault

[0045] Optionally, such as Figure 2 As shown, one pulse corresponds to one rising edge and one falling edge of the signal, and each moment corresponds to either a rising edge or a falling edge of the signal. Therefore, for each preset timestamp, the moment within the preset timestamps that meets the first preset requirement is determined as the start time, including:

[0046] If the first moment within the preset timestamp is a rising edge of the signal, then the first moment is taken as the start time of the preset timestamp. If the first moment within the preset timestamp is a falling edge of the signal, then the moment preceding the first moment is taken as the start time of the preset timestamp.

[0047] In this embodiment, even if the first moment within a preset timestamp is a falling edge of the signal, the pulse can be captured within the beginning of the preset timestamp by determining the start time of the preset timestamp as the last moment of the preceding preset timestamp. This ensures that if the first moment within each preset timestamp is a falling edge, the pulse corresponding to that moment can be captured, thereby improving the accuracy of the first number of pulses within subsequent target timestamps, and consequently improving the accuracy of the vehicle speed calculated using the average value corresponding to the target timestamp.

[0048] Optionally, such as Figure 2 As shown, for each preset timestamp, the time that meets the second preset requirement among the preset timestamps is determined as the end time, including:

[0049] The time corresponding to the last falling edge of the signal within the preset timestamp is taken as the end time of the preset timestamp.

[0050] In this embodiment, regardless of whether the last moment within a preset timestamp is a rising edge or a falling edge, the moment corresponding to the last falling edge of the preset timestamp is taken as the end moment of the preset timestamp. Thus, if the first moment of a subsequent preset timestamp is a falling edge, the start moment of that subsequent preset timestamp is determined as the last moment within that preset timestamp. Furthermore, since the last moment is a rising edge, the pulses collected by the wheel speed sensor are all contained within the start and end moments of each preset timestamp, ensuring that each pulse is completely collected and identified. This improves the accuracy of the first pulse count within subsequent target timestamps, thereby improving the accuracy of the vehicle speed calculated using the average value corresponding to the target timestamp.

[0051] Figure 2 The first line shows the acquired pulse waveform and the current time. The second line shows the target timestamp and the duration corresponding to the previous preset timestamp, along with their correspondence with the pulse waveform. The target timestamp includes the corresponding start and end times. The third line shows the statistical start and end times corresponding to the target timestamp, and the correspondence between the statistical start and end times and the preset timestamps and pulse waveforms.

[0052] Optionally, the target end time is determined from each time point based on the differences, including:

[0053] The time corresponding to the minimum value among all differences is determined as the target end time.

[0054] In this embodiment, since the vehicle speed calculated using the number of pulses in the preset timestamp corresponding to the moment closest to the current moment is closest to the current vehicle speed, using this calculated speed as the current vehicle speed is more accurate. Therefore, using the moment corresponding to the minimum value among all differences as the target end time allows for accurate determination of the preset timestamp corresponding to the moment closest to the current moment, and using the vehicle speed calculated using the number of pulses in this preset timestamp as the current vehicle speed has high accuracy.

[0055] In some embodiments, the default value is 2.

[0056] Alternatively, the vehicle speed can be calculated using an average value, as shown in the following formula:

[0057] spd=Rp*L=(0.5*3.14*f*d*DeltaCout) / (p*DeltaTime);

[0058] Where spd is vehicle speed, Rp is tire rotation speed, L is tire circumference, f is tire rotation speed acquisition frequency, d is tire diameter, DeltaCout is average value, p is number of magnetic pole pairs, and DeltaTime is the average duration corresponding to the target timestamp. This average duration is the average of the first total duration between the start and end times of the target timestamp and the second total duration between the start and end times of the statistics.

[0059] In this embodiment, the tire rotation speed is collected at a frequency f = 100MHz, the preset timestamp t = 1 / f = 0.00000001 seconds, the tire diameter d = 0.508 meters, and the number of magnetic pole pairs p = 48. The number of tire rotation cycles within the preset timestamp is TimeS = DeltaTime * 1 / f (seconds), and the number of pulses is PulseNum = DeltaCout * 0.5 (pulses). The number of pulses generated per second is PPS = DeltaPulseNum / DeltaTimeS. The tire circumference is l = d * 3.14 = 0.508 * 3.14 = 1.59512 (meters). The number of tire rotation cycles per unit time is Rad = PulseNum / p = DeltaCout * 0.5 / p. Tire rotational speed Rp = Rad / TimeS = (DeltaCout*0.5 / p) / (DeltaTime*1 / f) = (0.5*f*DeltaCout) / (p*DeltaTime). Therefore, the vehicle speed spd is calculated as: spd = Rp*L = (0.5*3.14*f*d*DeltaCout) / (p*DeltaTime). The average value is calculated by averaging adjacent pulse segments within a single preset timestamp. This average value reduces the fluctuation of wheel speed data calculated from nearby points in the wheel speed signal, thereby improving the accuracy of the vehicle speed calculated using this average value.

[0060] Optionally, a vehicle speed calculation method further includes:

[0061] When a time point is collected, stop collecting data for the next time point after that time point, and store the collected time point. After storage, start collecting data for the next time point after that time point.

[0062] In this embodiment, the wheel speed sensor generates corresponding edge signals when a pulse is generated or disappears, and the time within the preset timestamp is the time when the edge signal is acquired. Since determining the number of pulses requires considering the start and end times corresponding to the preset timestamps, the timing of edge signal acquisition needs to be stored when the microcontroller control program acquires the edge signals. For example... Figure 3As shown, a wheel speed sensor continuously detects whether an edge signal is generated. When an edge signal is generated, the current time is recorded and stored in the system register. The acquisition of the next time moment is stopped before storing the current time moment, and then the next time moment is acquired only after storage is complete. This reduces interference in the acquisition path during time moment storage, thereby reducing the failure rate of the microcontroller acquiring edge signals of the pulse and storing the times of edge signal acquisition.

[0063] Optionally, a vehicle speed calculation method further includes:

[0064] The transmission channel for detecting pulse transmission;

[0065] If the transmission channel is a preset channel, the pulse is transmitted through the transmission channel; if the transmission channel is not a preset channel, a reminder message is sent. The reminder message indicates that the pulse cannot be collected.

[0066] In this embodiment, the microcontroller processes the transmitted data for each transmission channel. However, too many transmission channels increase the processing burden on the microcontroller, thereby reducing the efficiency of pulse acquisition. By detecting whether the transmission channel when the pulse is transmitted is a preset channel, the pulse is only acquired when the transmission channel is a preset channel. This allows the microcontroller to process only the pulse data within the preset channel and not the pulse data transmitted from other channels, thus improving the pulse acquisition efficiency.

[0067] Currently, the calculated vehicle speed error for similar products using brake-by-wire on the market is 0.01 m / s. However, by using a 100MHz counting clock, the measured vehicle speeds in medium, high, and low speed modes showed errors of 0.0005 m / s for medium speed, 0.002 m / s for high speed, and 0.0000005 m / s for low speed. Table 2 shows the theoretical calculated vehicle speed in low speed mode and the measured values ​​calculated using the speed calculation method of this invention.

[0068] Table 2

[0069]

[0070] As shown in Table 2, the actual measured value in low-speed mode is 6.71328143 m / s, which is less than 0.01 m / s compared to the theoretically calculated value of 6.712796667 m / s. Therefore, the error of the actual measured value in low-speed mode calculated by the speed calculation method of this invention is smaller than the error of speed calculation by similar products of online brake control on the market, indicating that the speed calculation method of this invention can improve the accuracy of the speed calculated in low-speed mode.

[0071] Table 3 shows the theoretical calculated values ​​of vehicle speed in medium speed mode and the measured values ​​calculated using the vehicle speed calculation method of this invention.

[0072] Table 3

[0073]

[0074] As shown in Table 3, the actual measured value in medium speed mode is 33.23332833 m / s, which is less than 0.01 m / s compared to the theoretically calculated value of 33.2316666 m / s (0.00166173 m / s). Therefore, the error of the actual measured value in medium speed mode calculated by the speed calculation method of this invention is smaller than the error of speed calculation by similar products of online brake control on the market, indicating that the speed calculation method of this invention can improve the accuracy of the speed calculated in medium speed mode.

[0075] Table 4 shows the theoretical calculated values ​​of vehicle speed in high-speed mode and the measured values ​​calculated using the vehicle speed calculation method of this invention.

[0076] Table 4

[0077]

[0078] As shown in Table 4, the actual measured value in high-speed mode is 0.1343926062 m / s, which has an error of 0.0000004232 m / s compared to the theoretical calculated value of 0.134392183 m / s, less than 0.01 m / s. Therefore, the error of the actual measured value in high-speed mode calculated by the speed calculation method of this invention is smaller than the error of speed calculation by similar products of online brake control on the market, indicating that the speed calculation method of this invention can improve the accuracy of the speed calculated in high-speed mode.

[0079] Figure 4 This is a flowchart illustrating the process of calculating the number of pulses used to determine vehicle speed, as shown below. Figure 4As shown, the system detects whether the wheel speed signal channel ID is valid, i.e., whether the wheel speed signal transmission channel is a preset channel. If so, the wheel speed signal channel ID is confirmed to be valid, and the wheel speed signal generated by tire rotation is acquired through this channel. The system also checks whether the pulse state of the wheel speed signal is No_Sensor. If not, it outputs the number of pulses used to calculate the vehicle speed (DetalCout = 0) and the duration of the timestamp used to calculate the vehicle speed (detalTine = 0). When a pulse of the wheel speed signal is detected within a consecutive preset duration, the pulse state of the wheel speed signal is Normal, and the number of pulses used to calculate the vehicle speed (DetalCout = 0) and the duration of the timestamp used to calculate the vehicle speed (detalTine = 0) are output. When no pulse of the wheel speed signal is detected within a consecutive preset duration, the pulse state of the wheel speed signal is No_Sensor, interrupts are disabled, i.e., acquisition of the wheel speed signal pulse is stopped, and the current time is recorded. Then, the previous preset timestamp Endlndex is used as the target timestamp Starlndex corresponding to the current time, i.e., Starlndex = Endlndex. Afterwards, interrupts are enabled, and the interrupt routine is entered. This interrupt routine is used to determine the number of pulses needed to calculate the vehicle speed. The execution steps in the interrupt routine are as follows: determine the start and end times of the target timestamp Starlndex, and obtain the compensation timestamp Starlndex-1 corresponding to the target timestamp Starlndex. The start time of this compensation timestamp Starlndex-1 is the time preceding the start time of the target timestamp Starlndex, and the end time of this compensation timestamp Starlndex-1 is the time preceding the end time of the target timestamp Starlndex. Calculate the first pulse count (Detalcout1) and the first total duration (detalTine1) between the start and end times in the target timestamp Starlndex. Calculate the second pulse count (Detalcout2) and the second total duration (detalTine2) between the start and end times in the compensation timestamp Starlndex-1. Calculate the average count of the first pulse count (Detalcout1) and the second pulse count (Detalcout2). Calculate the average duration of the first total duration (detalTine1) and the second total duration (detalTine2). If this average count is greater than 2, then this average count is used as the pulse count (Detalcout) for calculating the vehicle speed, and this average duration is used as the duration (detalTine) of the timestamp used for calculating the vehicle speed.When the average number is less than or equal to 2, update the target timestamp Starlndex and the compensation timestamp Starlndex-1, and determine the time before the start time of the target timestamp Starlndex as the start time of the new target timestamp Starlndex, and determine the time before the start time of the compensation timestamp Starlndex-1 as the start time of the new compensation timestamp Starlndex-1, until the average number is greater than 2.

[0080] Disabling interrupts means turning off interrupts, so that the TC377 microcontroller will not enter an interrupt queue when it receives a rising or falling edge signal on pin P21_3 (controlled by the TIM5_IN5 register). Enabling interrupts means that when an interrupt signal is generated, the TC377 microcontroller will enter an interrupt routine. If there is a rising or falling edge signal on pin P21_3 (controlled by the TIM5_IN5 register), the microcontroller will temporarily suspend its current work and execute the program in the interrupt routine. After the work in the interrupt routine is completed, it will return to the main program to continue executing the steps in the main program.

[0081] Existing technologies acquire wheel speed signal pulse counts using periodic sampling. Because the generation time and magnitude of the wheel speed signal are not simultaneous with the periodic sampling time, the time generated per unit time is inaccurate. Furthermore, the periodic sampling time occurs at the critical point of wheel speed pulse generation, causing the loss of critical pulse signals. This also leads to inaccurate pulse counts per unit time, resulting in inaccurate wheel speed values ​​per unit time. This invention performs double-edge sampling on the original wheel speed signal, taking the average of the time taken by the most recently generated pulse and the sampling time of adjacent pulses within the sampling period, thus solving the problem of lost critical pulse signals. The sampling period is a preset timestamp. Currently, the time used for wheel speed pulse signal processing is the periodic sampling time, which is inconsistent with the actual time taken by adjacent wheel speed pulses. Moreover, the OS's periodic task scheduling is affected by interrupts, resulting in errors in the actual periodic call time. This inaccurate measurement of the time taken to generate wheel speed pulses leads to inaccurate calculated wheel speed values. This invention uses the MCU's system clock as the measurement time for wheel speed pulses, introducing the concept of a natural timestamp for the MCU. Each wheel speed signal independently corresponds to a timestamp. When a wheel speed pulse signal triggers a hardware interrupt, the current system clock register's bit value and the pulse signal sequence number in the current circular queue are recorded. When the raw wheel speed value is acquired externally, the difference in the number of pulses generated between the previous and current raw wheel speed values, along with the bit value of the system clock register, representing the time taken to generate the corresponding difference pulse, are provided to the calculation module. This solves the problem of inaccurate wheel speed signals caused by large wheel speed sampling time errors, which in turn leads to inaccurate vehicle speed calculations.

[0082] The principle of dual-edge sampling is as follows: Dual-edge sampling is a technique that samples the clock signal both before and after its edge. For general timing designs, we typically sample only at the rising or falling edge of the clock signal. However, when the timing is complex or higher precision is required, single-edge sampling may not be sufficient. This is where dual-edge sampling comes in. Dual-edge sampling primarily uses two sampling flip-flops to sample at the rising and falling edges of the clock signal, respectively. The signal is recorded twice within each clock cycle, thus improving sampling accuracy. Dual-edge sampling is suitable for scenarios where judgment or processing needs to be performed between the rising and falling edges of the clock signal. For example, at low speeds, a wheel speed pulse may be generated only after a long interval, resulting in the wheel speed signal being 0 or higher than its actual value at low speeds.

[0083] This invention, based on determining the timestamp corresponding to the sampling period using a double-edge sampling method, automatically and continuously expands the sampling period of the wheel speed signal when the number of pulses acquired in two consecutive acquisitions is less than 2, until the number of pulses acquired within the sampling period is greater than or equal to 2, thus ensuring that a complete wheel speed signal is acquired within the acquisition period. The sampling period is a preset timestamp. This solves the problem that a complete wheel speed signal pulse cannot be acquired within the timed acquisition period at low speeds.

[0084] This invention employs a dual-edge sampling triggering method, introducing the concept of a microcontroller's natural timestamp to timestamp the generated wheel speed signal. This ensures that the time of generation of wheel speed signal pulses is timestamped, guaranteeing a one-to-one correspondence between the number of generated pulses and the system clock cycles consumed. This ensures that the measured time error remains consistent with the system clock, guaranteeing the accuracy of the statistically analyzed number of wheel speed pulses and their corresponding generation times. Within a single sampling period, adjacent pulse segments are compensated for and averaged to address fluctuations in wheel speed value calculations based on proximity to the generated signal. At low speeds, historical wheel speed signals are compensated for and averaged to address the issue of no pulse signal within a single sampling period at low speeds.

[0085] like Figure 5 As shown, the present invention provides a vehicle speed calculation system, comprising:

[0086] The acquisition module is used to acquire multiple pulses generated by the tire rotation once at a preset timestamp, and each preset timestamp contains multiple consecutive moments;

[0087] The first determining module is used to determine, for each preset timestamp, the time that meets the first preset requirement as the start time and the time that meets the second preset requirement as the end time.

[0088] The recording module is used to take the last moment of the consecutive preset time period as the current moment when no pulse generated by tire rotation is collected for a consecutive preset time period.

[0089] The second determining module is used to calculate the difference between the current time and the end time of each preset timestamp, and determine the target end time from each end time based on each difference, and use the preset timestamp corresponding to the target end time as the target timestamp.

[0090] The third determination module is used to take the time before the start time in the target timestamp as the start time of the statistics and the time before the end time in the target timestamp as the end time of the statistics.

[0091] The fourth determining module is used to determine the first number of pulses between the start and end times in the target timestamp, and to determine the second number of pulses between the start and end times of the statistics.

[0092] The calculation module is used to calculate the vehicle speed using the average value if the average value of the first and second numbers is greater than a preset value. If the average value is less than or equal to the preset value, the time before the start time of the statistics is taken as the new start time of the statistics, and the time before the start time is taken as the new start time. The steps corresponding to the fourth determination module to the calculation module are repeated.

[0093] Optionally, the first determining module is specifically used for:

[0094] If the first moment within the preset timestamp is a rising edge of the signal, then the first moment is taken as the start time of the preset timestamp. If the first moment within the preset timestamp is a falling edge of the signal, then the moment preceding the first moment is taken as the start time of the preset timestamp.

[0095] Optionally, the first determining module is specifically used for:

[0096] The time corresponding to the last falling edge of the signal within the preset timestamp is taken as the end time of the preset timestamp.

[0097] Optionally, the calculation module is specifically used for:

[0098] The vehicle speed is calculated using the average value, and the formula is as follows:

[0099] spd=Rp*L=(0.5*3.14*f*d*DeltaCout) / (p*DeltaTime);

[0100] Where spd is vehicle speed, Rp is tire rotation speed, L is tire circumference, f is tire rotation speed acquisition frequency, d is tire diameter, DeltaCout is average value, p is number of magnetic pole pairs, and DeltaTime is the average duration corresponding to the target timestamp. This average duration is the average of the first total duration between the start and end times of the target timestamp and the second total duration between the start and end times of the statistics.

[0101] Optionally, a vehicle speed calculation system further includes a storage module, which is specifically used for:

[0102] When a time point is collected, the collection of the next time point after that time point is stopped, and the collected time point is stored. After storage is completed, the collection of the next time point after that time point begins.

[0103] Optionally, a vehicle speed calculation system further includes a transmission module, which is specifically used for:

[0104] The transmission channel for detecting pulse transmission;

[0105] If the transmission channel is a preset channel, the pulse is transmitted through the transmission channel; if the transmission channel is not a preset channel, a reminder message is sent. The reminder message indicates that the pulse cannot be collected.

[0106] A computing device according to an embodiment of the present invention includes a memory, a processor, and a program stored in the memory and running on the processor. When the processor executes the program, it implements some or all of the steps of the above-described vehicle speed calculation method.

[0107] The computing device can be a computer, and the corresponding program is computer software. The parameters and steps in the computing device of the present invention can be referred to the parameters and steps in the embodiment of the vehicle speed calculation method above, and will not be repeated here.

[0108] This invention provides a computer-readable storage medium storing instructions that, when executed, perform the steps of the aforementioned vehicle speed calculation method.

[0109] The computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0110] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of this disclosure. The aforementioned computer-readable storage medium can be a non-transitory computer-readable storage medium, including various media capable of storing program code such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or it can be a transient computer-readable storage medium.

[0111] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this disclosure can be embodied in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the invention can also be implemented as a computer program product contained in one or more computer-readable media, which contains computer-readable program code. Computer-readable storage media can be, for example, but not limited to—electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof.

[0112] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0113] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for calculating vehicle speed, characterized in that, include: S1: Multiple pulses generated by tire rotation are collected once at each preset timestamp, and each preset timestamp contains multiple consecutive moments; S2: For each of the preset timestamps, the time that meets the first preset requirement is determined as the start time, and the time that meets the second preset requirement is determined as the end time. S3: If no pulse generated by tire rotation is collected for a continuous preset time period, the last moment in the continuous preset time period will be taken as the current moment. S4: Calculate the difference between the current time and the end time of each preset timestamp, determine the target end time from each end time based on each difference, and take the preset timestamp corresponding to the target end time as the target timestamp; S5: Take the time before the start time in the target timestamp as the start time of the statistics, and take the time before the end time in the target timestamp as the end time of the statistics; S6: Determine the first number of pulses between the start and end times in the target timestamp, and determine the second number of pulses between the start and end times of the statistics. S7: If the average of the first number and the second number is greater than a preset value, calculate the vehicle speed using the average value. If the average value is less than or equal to the preset value, take the time before the start time of the statistics as the new start time of the statistics, and take the time before the start time as the new start time, and repeat steps S6 to S7.

2. The method according to claim 1, characterized in that, One pulse corresponds to one rising edge and one falling edge of a signal, and each moment corresponds to either a rising edge or a falling edge of a signal. Therefore, for each preset timestamp, the moment within the preset timestamps that meets the first preset requirement is determined as the start time, including: If the first moment within the preset timestamp is a rising edge of the signal, then the first moment is taken as the start time of the preset timestamp; if the first moment within the preset timestamp is a falling edge of the signal, then the moment preceding the first moment is taken as the start time of the preset timestamp.

3. The method according to claim 2, characterized in that, For each of the preset timestamps, the time that meets the second preset requirement is determined as the end time, including: The time corresponding to the last falling edge of the signal within the preset timestamp is taken as the end time of the preset timestamp.

4. The method according to claim 1, characterized in that, The vehicle speed is calculated using the average value, and the calculation formula is as follows: spd=Rp*L=(0.5*3.14*f*d*DeltaCout) / (p*DeltaTime); Where spd is the vehicle speed, Rp is the tire rotation speed, L is the tire circumference, f is the tire rotation speed acquisition frequency, d is the tire diameter, DeltaCout is the average value, p is the number of magnetic pole pairs, and DeltaTime is the average duration corresponding to the target timestamp.

5. The method according to any one of claims 1 to 4, characterized in that, Also includes: When a time point is collected, the collection of the next time point after that time point is stopped, and the collected time point is stored. After storage is completed, the collection of the next time point after that time point begins.

6. The method according to any one of claims 1 to 4, characterized in that, Also includes: Detect the transmission channel when the pulse is transmitted; If the transmission channel is a preset channel, the pulse is transmitted through the transmission channel; if the transmission channel is not a preset channel, a reminder message is sent; wherein the reminder message is information indicating that the pulse cannot be collected.

7. A vehicle speed calculation system, characterized in that, include: The acquisition module is used to acquire multiple pulses generated by tire rotation once at a preset time stamp, and each preset time stamp contains multiple consecutive moments; The first determining module is used to determine, for each of the preset timestamps, the time that meets the first preset requirement as the start time and the time that meets the second preset requirement as the end time. The recording module is used to take the last moment of the consecutive preset time period as the current moment when no pulse generated by tire rotation is collected for a consecutive preset time period. The second determining module is used to calculate the difference between the current time and the end time of each preset timestamp, determine the target end time from each end time according to each difference, and take the preset timestamp corresponding to the target end time as the target timestamp. The third determination module is used to take the time before the start time in the target timestamp as the start time of the statistics and the time before the end time in the target timestamp as the end time of the statistics. The fourth determining module is used to determine the first number of pulses between the start and end times in the target timestamp, and to determine the second number of pulses between the start and end times of the statistics. The calculation module is used to calculate the vehicle speed using the average value if the average value of the first number and the second number is greater than a preset value, and to take the time before the start time of the statistics as the new start time of the statistics and the time before the start time as the new start time, and to repeat the steps corresponding to the fourth determination module to the calculation module.

8. The system according to claim 7, characterized in that, The first determining module is specifically used for: If the first moment within the preset timestamp is a rising edge of the signal, then the first moment is taken as the start time of the preset timestamp; if the first moment within the preset timestamp is a falling edge of the signal, then the moment preceding the first moment is taken as the start time of the preset timestamp.

9. A computing device, comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the steps of a vehicle speed calculation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the steps of a vehicle speed calculation method as described in any one of claims 1 to 7.