An integral simulation method and device, electronic equipment and storage medium

CN121348707BActive Publication Date: 2026-08-07BEIJING GLOBAL CROWN JINYANG TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING GLOBAL CROWN JINYANG TECH DEV CO LTD
Filing Date
2025-11-05
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

但在实际应用中,常用的二进制定点数误差较大,难以满足模型的仿真精度要求,因此,积分运算精度较低,导致影响整个PID算法的精度和车速的仿真控制精度

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121348707B_ABST
    Figure CN121348707B_ABST
Patent Text Reader

Abstract

The application discloses an integral simulation method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining an integral input value of this simulation, wherein the integral input value of this simulation is the difference between the current speed and the target speed of a vehicle; determining the integral increment of this simulation based on the integral input value of this simulation and a preset simulation step, wherein the preset simulation step is expressed by a decimal fixed point number; and determining the integral output value of this simulation based on the integral increment of this simulation and the integral output value of the previous simulation. In this way, the simulation accuracy requirement of the model can be met, the integral operation accuracy is improved, and thus the accuracy of the entire PID algorithm and the simulation control accuracy of the vehicle speed are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an integral simulation method, apparatus, electronic device, and storage medium. Background Technology

[0002] In vehicle modeling and simulation systems, Proportional Integral Derivative (PID) control is one of the core technologies for achieving precise vehicle speed simulation control. Integral operations play a crucial role, effectively eliminating static errors and ensuring the speed stabilizes at the set value, thus guaranteeing smoothness and accuracy during driving.

[0003] Furthermore, due to the hardware limitations of vehicle microcontrollers, fixed-point processing is often chosen for integral operations. This involves converting floating-point numbers to fixed-bit integer formats (such as 16-bit or 32-bit fixed-point numbers) and pre-defining the decimal point position (i.e., scaling), transforming complex floating-point operations into simple integer addition, subtraction, and shift operations. However, in practical applications, commonly used binary fixed-point numbers have relatively large errors, making it difficult to meet the simulation accuracy requirements of the model. Therefore, the accuracy of integral operations is low, affecting the overall accuracy of the PID algorithm and the simulation control accuracy of vehicle speed. Summary of the Invention

[0004] This application provides an integral simulation method, apparatus, electronic device, and storage medium to meet the simulation accuracy requirements of the model, improve the accuracy of integral calculation, and thereby improve the accuracy of the entire PID algorithm and the simulation control accuracy of vehicle speed.

[0005] In a first aspect, embodiments of this application provide an integral simulation method, including:

[0006] Obtain the integral input value for this simulation, which is the difference between the vehicle's current speed and the target speed;

[0007] Based on the integral input value of this simulation and the preset simulation step size, the integral increment of this simulation is determined. The preset simulation step size is represented by a decimal fixed-point number.

[0008] The integral output value for this simulation is determined based on the integral increment of this simulation and the integral output value of the previous simulation.

[0009] Optionally, the preset simulation step size is represented by the following steps:

[0010] Determine the physical value and decimal calibration corresponding to the preset simulation step size;

[0011] Calculate the first product of the physical value corresponding to the preset simulation step size and the decimal calibration, and use it as the integer value corresponding to the preset simulation step size.

[0012] Optionally, determining the integral increment for the current simulation based on the integral input value and the preset simulation step size includes:

[0013] Determine the integer value corresponding to the integral input value in this simulation;

[0014] Determine the quotient of the integer value corresponding to the preset simulation step size and the decimal target;

[0015] The second product of the integer value corresponding to the integral input value of this simulation and the quotient value is calculated as the integral increment of this simulation.

[0016] Optionally, the method further includes:

[0017] Obtain the proportional and derivative output values ​​of this simulation;

[0018] Based on the sum of the integral output value, proportional output value, and derivative output value of this simulation, the proportional-integral-derivative (PID) output value of this simulation is determined. The PID output value of this simulation is the torque of the vehicle, and the torque is used to adjust the current speed.

[0019] Optionally, the method further includes:

[0020] During the initialization simulation, the initial integral output value is obtained and output.

[0021] Secondly, embodiments of this application provide an integral simulation apparatus, comprising:

[0022] The first data acquisition module is used to acquire the integral input value of this simulation, wherein the integral input value of this simulation is the difference between the current speed and the target speed of the vehicle;

[0023] The first data determination module is used to determine the integral increment of the current simulation based on the integral input value of the current simulation and the preset simulation step size, wherein the preset simulation step size is represented by a decimal fixed point number.

[0024] The integral simulation module is used to determine the integral output value of the current simulation based on the integral increment of the current simulation and the integral output value of the previous simulation.

[0025] Optionally, the preset simulation step size is represented by the following module:

[0026] The second data determination module is used to determine the physical value and decimal calibration corresponding to the preset simulation step size;

[0027] The data calculation module is used to calculate the first product of the physical value corresponding to the preset simulation step size and the decimal calibration, which is used as the integer value corresponding to the preset simulation step size.

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

[0029] Determine the integer value corresponding to the integral input value in this simulation;

[0030] Determine the quotient of the integer value corresponding to the preset simulation step size and the decimal target;

[0031] The second product of the integer value corresponding to the integral input value of this simulation and the quotient value is calculated as the integral increment of this simulation.

[0032] Thirdly, embodiments of this application provide an electronic device, the device including: a processor, a memory, and a system bus;

[0033] The processor and the memory are connected via the system bus;

[0034] The memory is used to store a program, which includes instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the above-described integral simulation method.

[0035] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the implementation steps of the above-described integral simulation method.

[0036] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0037] In this embodiment, firstly, the integral input value for the current simulation is obtained, which is the difference between the vehicle's current speed and the target speed. Next, based on the integral input value and the preset simulation step size, the integral increment for the current simulation is determined. Then, based on the integral increment and the integral output value from the previous simulation, the integral output value for the current simulation is determined. Since the preset simulation step size uses decimal fixed-point representation, the number of decimal places can be flexibly set according to the actual simulation accuracy requirements. Compared to the precision limitation of binary fixed-point numbers, decimal fixed-point numbers can more intuitively and accurately match the precision requirements of the preset simulation step size, making the calculated integral increment closer to the actual integral value. This reduces the error in integral calculation and improves the overall accuracy of the PID algorithm and the control accuracy of the vehicle speed. Attached Figure Description

[0038] Figure 1A flowchart of an integral simulation method provided in this application embodiment;

[0039] Figure 2a A schematic diagram of a simulation model of a PID control algorithm provided in an embodiment of this application;

[0040] Figure 2b A schematic diagram of a vehicle speed simulation control algorithm provided in an embodiment of this application;

[0041] Figure 3 This is a schematic diagram of the structure of an integral simulation device provided in an embodiment of this application. Detailed Implementation

[0042] As mentioned earlier, in practical applications, the commonly used binary fixed-point numbers have large errors, making it difficult to meet the simulation accuracy requirements of the model. Therefore, the accuracy of integral operations is low, which affects the accuracy of the entire PID algorithm and the simulation control accuracy of vehicle speed.

[0043] Specifically, for the preset simulation step size, a common value is 0.001, or 1 millisecond. This cannot be precisely represented using binary. When the calibration is set to 16, its integer value is 65, and the physical value is 65 / 2. 16 =0.00099182..., with an error of approximately 1%, therefore, it cannot meet the simulation accuracy requirements of the model. To achieve 1e-6 (i.e., 1*10) -6 If the relative error is greater than 30, then the calibration needs to be increased to 30, at which point the integer value is 1073741, or 1073741 / 2. 30 ≈0.001, but at this point the scaling is too large, and the integer value is also too large, which poses a risk of overflow in subsequent calculations.

[0044] In order to solve the above problems, this application provides an integral simulation method. First, the integral input value of the current simulation is obtained, which is the difference between the current speed and the target speed of the vehicle. Then, the integral increment of the current simulation is determined based on the integral input value of the current simulation and the preset simulation step size. Then, the integral output value of the current simulation is determined based on the integral increment of the current simulation and the integral output value of the previous simulation.

[0045] Because the preset simulation step size uses decimal fixed-point representation, the number of decimal places can be flexibly set according to the actual simulation accuracy requirements. Compared to the precision limitation of binary fixed-point numbers, decimal fixed-point numbers can more intuitively and accurately match the accuracy requirements of the preset simulation step size, making the calculated result of the integral increment closer to the actual integral value. This reduces the error in integral calculation and improves the accuracy of the entire PID algorithm and the control accuracy of vehicle speed. For example, when using decimal fixed-point representation of the preset simulation step size, if the preset simulation step size is still 0.001 and the calibration is 3, then the integer value is 1, and the physical value is 1 / 10. 3 =0.001, meaning the error is 0.

[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0047] Figure 1 This is a flowchart illustrating an integral simulation method provided in an embodiment of this application. (In conjunction with...) Figure 1 As shown, the integral simulation method provided in this application embodiment may include the following steps S101-S103.

[0048] S101: Obtain the integral input value for this simulation. The integral input value for this simulation is the difference between the vehicle's current speed and the target speed.

[0049] In the embodiments of this application, combined with Figure 2a As shown, the value input to the integration module in this simulation is the integration input value for this simulation.

[0050] During vehicle speed simulation control, since the engine throttle is controlled by the position signal of the vehicle speed operating mechanism, and the vehicle speed is changed by altering the engine speed, after the sensor detects the vehicle's current speed, the difference between the current speed and the target speed can be calculated to obtain the integral input value for this simulation. Then, based on this difference, the current speed is changed by altering the traction force until the current speed is maintained at the target speed.

[0051] Furthermore, combined Figure 2b As shown, a dynamic model of the vehicle speed control system can be pre-established. Here, the vehicle mass is set to m, the vehicle speed to v, the traction force to F(t), and the vehicle's damping system to b (assuming linear damping). The corresponding dynamic equation is shown in formula (1):

[0052] (1)

[0053] Furthermore, in practical applications, if it is the first simulation, the initial integral output value can be obtained and output during the simulation initialization process. This initial integral output value is the value set internally by the aforementioned integral module.

[0054] S102: Based on the integral input value of this simulation and the preset simulation step size, determine the integral increment of this simulation. The preset simulation step size is expressed in decimal fixed point number.

[0055] The preset simulation step size refers to the time interval for each calculation and update of the simulation state. In practical applications, the preset simulation step size is, for example, 0.001.

[0056] As mentioned earlier, to accurately calculate the integral increment, the preset simulation step size is represented using a decimal fixed-point representation. Based on this, for ease of understanding, a possible implementation method will be described below.

[0057] As one possible implementation, the preset simulation step size can be represented by the following steps: First, determine the physical value and decimal scale corresponding to the preset simulation step size. Then, calculate the first product of the physical value and the decimal scale corresponding to the preset simulation step size, which is taken as the integer value corresponding to the preset simulation step size.

[0058] Among them, the physical value corresponding to the preset simulation step size refers to a numerical value with practical significance; the integer value corresponding to the preset simulation step size refers to the value actually calculated by the computer. Since decimal representation is used, the relationship between the physical value and the integer value can be shown in the following formula (2):

[0059] (2)

[0060] Where N represents the decimal standard.

[0061] For example, if the preset simulation step size is 0.001, then the corresponding physical value is 0.001, the integer value is 1, and the decimal scale is 3, that is... As can be seen, this can accurately represent the preset simulation step size of 0.001, and the computer only needs to store the integer 1.

[0062] Thus, in this embodiment of the application, the process of determining the integral increment of the current simulation may include: first, determining the integer value corresponding to the integral input value of the current simulation; then, determining the quotient of the integer value corresponding to the preset simulation step size and the decimal target; and then, calculating the second product of the integer value corresponding to the integral input value of the current simulation and the quotient as the integral increment of the current simulation.

[0063] In practical applications, the integral increment of this simulation can be expressed as: Integral increment of this simulation = integer value corresponding to the integral input value of this simulation × preset simulation step size.

[0064] Therefore, combining formula (2) and the above formula, the integral increment of this simulation can also be expressed by the following formula (3):

[0065] (3)

[0066] Taking 1 as an example for integer values, when N is 3, the integral increment of this simulation = the integer value corresponding to the integral input value of this simulation / 1000.

[0067] To facilitate understanding, the following section will use existing binary positioning numbers to illustrate the effect of using decimal fixed-point numbers to represent preset simulation step sizes.

[0068] Assuming the physical value corresponding to the integral input value in this simulation is 123, then its integer value is Therefore, in the binary fixed-point representation scheme, the integer value corresponding to the integral increment in this simulation is = Since the integral input value is still represented by a binary fixed-point number, the physical value corresponding to the integral increment in this simulation is... .

[0069] In the decimal fixed-point representation scheme, the integer value corresponding to the integral increment in this simulation is 125952 / 1000 = 125. Correspondingly, the physical value corresponding to the integral increment in this simulation is... .

[0070] Since the precise integral increment in this simulation is 123 * 0.001 = 0.123, the integral increment obtained by the decimal fixed-point representation scheme is closer to the precise value, resulting in higher calculation accuracy.

[0071] S103: Determine the integral output value for this simulation based on the integral increment of this simulation and the integral output value of the previous simulation.

[0072] In the embodiments of this application, the integral output value of this simulation can be expressed as the sum of the integral increment of this simulation and the integral output value of the previous simulation.

[0073] In this way, each subsequent step of the simulation repeats steps S102 and S103 until the simulation ends, and the final integral output value of the simulation process can be obtained.

[0074] Steps S101-S103 above are used to implement the integral processing of the PID control algorithm, thereby improving the accuracy of the integral part of the PID control algorithm, and thus improving the accuracy of the entire PID algorithm and the final vehicle speed control accuracy.

[0075] Furthermore, in practical applications, the PID control algorithm includes three processing steps: proportional processing, integral processing, and derivative processing corresponding to the difference between the vehicle's current speed and the target speed. The final output of the PID control algorithm is the sum of these three steps.

[0076] Based on this, in the embodiments of this application, the proportional output value and derivative output value of this simulation can be further obtained, and the proportional-integral-derivative PID output value of this simulation can be determined based on the sum of the integral output value, proportional output value and derivative output value of this simulation. The PID output value of this simulation is the torque of the vehicle, and the torque is used to adjust the current speed.

[0077] Still combined with Figure 2a As shown, the input of the PID algorithm is the difference between the vehicle's current speed and the target speed, denoted as ΔV, and the output is torque. This torque is proportional to the vehicle's acceleration, and therefore can affect the subsequent vehicle speed.

[0078] Furthermore, in the decimal fixed-point representation scheme, for addition algorithms, assuming there are three fixed-point numbers a, b, and c, with decimal indices of 2, 3, and 4 respectively (meaning a has 2 decimal places, b has 3, and c has 4), when calculating a + b and assigning it to c, the decimal point positions can be standardized (i.e., the significant digits are aligned). Specifically, the indices of a are 2, which is equivalent to the actual value of a = Aligned to scale 4 of c, needs to be enlarged. Times (i.e., ×100); the scaling of b is 3, which is equivalent to the actual value of b = Aligning to a scaling factor of 4 for c requires multiplying by a factor of 10 (i.e., ×10). The scaling factor of the result after addition is naturally 4, i.e., c = (a × 100) + (b × 10). At this point, the actual value of c = The result is consistent with the sum of the actual values ​​of a and b.

[0079] Based on the relevant content of steps S101-S103 above, it can be seen that in this embodiment, firstly, the integral input value of the current simulation is obtained, which is the difference between the current speed and the target speed of the vehicle; then, based on the integral input value of the current simulation and the preset simulation step size, the integral increment of the current simulation is determined; then, based on the integral increment of the current simulation and the integral output value of the previous simulation, the integral output value of the current simulation is determined. Since the preset simulation step size is represented by a decimal fixed-point number, the number of decimal places can be flexibly set according to the actual simulation accuracy requirements. Compared with the accuracy of binary fixed-point numbers which are limited by a fixed number of places, decimal fixed-point numbers can more intuitively and accurately match the accuracy requirements of the preset simulation step size, making the calculation result of the integral increment closer to the actual integral value, thereby reducing the error of integral calculation and improving the accuracy of the entire PID algorithm and the control accuracy of vehicle speed.

[0080] Based on the integral simulation method provided in the above embodiments, this application can also provide an integral simulation device. The integral simulation device will now be described in conjunction with the embodiments and accompanying drawings.

[0081] Figure 3 This is a schematic diagram of an integral simulation device provided in an embodiment of this application. (Combined with...) Figure 3 As shown, the integral simulation device 300 provided in this application embodiment includes:

[0082] The first data acquisition module 301 is used to acquire the integral input value of this simulation, wherein the integral input value of this simulation is the difference between the current speed and the target speed of the vehicle.

[0083] The first data determination module 302 is used to determine the integral increment of the current simulation based on the integral input value of the current simulation and the preset simulation step size, wherein the preset simulation step size is represented by a decimal fixed point number.

[0084] The integral simulation module 303 is used to determine the integral output value of the current simulation based on the integral increment of the current simulation and the integral output value of the previous simulation.

[0085] Optionally, the preset simulation step size is represented by the following module:

[0086] The second data determination module is used to determine the physical value and decimal calibration corresponding to the preset simulation step size;

[0087] The data calculation module is used to calculate the first product of the physical value corresponding to the preset simulation step size and the decimal calibration, which is used as the integer value corresponding to the preset simulation step size.

[0088] Optionally, the first data determining module 302 is specifically used for:

[0089] Determine the integer value corresponding to the integral input value in this simulation;

[0090] Determine the quotient of the integer value corresponding to the preset simulation step size and the decimal target;

[0091] The second product of the integer value corresponding to the integral input value of this simulation and the quotient value is calculated as the integral increment of this simulation.

[0092] Optionally, the integral simulation device 300 further includes:

[0093] The second data acquisition module is used to acquire the proportional output value and the derivative output value of the current simulation.

[0094] The third data determination module is used to determine the proportional-integral-derivative (PID) output value of the current simulation based on the sum of the integral output value, proportional output value, and derivative output value of the current simulation. The PID output value of the current simulation is the torque of the vehicle, and the torque is used to adjust the current speed.

[0095] Optionally, the integral simulation device 300 further includes:

[0096] The third data acquisition module is used to acquire and output the initial integral output value during the initialization of the simulation.

[0097] Furthermore, embodiments of this application also provide an electronic device, including: a processor, a memory, and a system bus;

[0098] The processor and the memory are connected via the system bus;

[0099] The memory is used to store one or more programs, the one or more programs including instructions that, when executed by the processor, cause the processor to perform any of the implementation steps of the above-described integral simulation method.

[0100] Furthermore, embodiments of this application also provide a computer-readable storage medium storing instructions that, when executed on an electronic device, enable any of the implementation steps of the above-described integral simulation method.

[0101] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on describing the differences from other embodiments. The same or similar parts between the various embodiments can be referred to mutually.

[0102] The system disclosed in the embodiments is described in a relatively simple manner because it corresponds to the method disclosed in the embodiments. For relevant details, please refer to the method section.

[0103] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0104] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An integral simulation method, characterized in that, include: Obtain the integral input value for this simulation, which is the difference between the vehicle's current speed and the target speed; Based on the integral input value of this simulation and the preset simulation step size, the integral increment of this simulation is determined. The preset simulation step size is represented by a decimal fixed-point number. Based on the integral increment of this simulation and the integral output value of the previous simulation, the integral output value of this simulation is determined. The preset simulation step size is represented by the following steps: Determine the physical value and decimal calibration corresponding to the preset simulation step size; Calculate the first product of the physical value corresponding to the preset simulation step size and the decimal calibration, and use it as the integer value corresponding to the preset simulation step size; The determination of the integral increment for this simulation based on the integral input value and the preset simulation step size includes: Determine the integer value corresponding to the integral input value in this simulation; Determine the quotient of the integer value corresponding to the preset simulation step size and the decimal target; The second product of the integer value corresponding to the integral input value of this simulation and the quotient value is calculated as the integral increment of this simulation.

2. The integral simulation method according to claim 1, characterized in that, The method further includes: Obtain the proportional and derivative output values ​​of this simulation; Based on the sum of the integral output value, proportional output value, and derivative output value of this simulation, the proportional-integral-derivative (PID) output value of this simulation is determined. The PID output value of this simulation is the torque of the vehicle, and the torque is used to adjust the current speed.

3. The integral simulation method according to claim 1, characterized in that, The method further includes: During the initialization simulation, the initial integral output value is obtained and output.

4. An integral simulation device, characterized in that, include: The first data acquisition module is used to acquire the integral input value of this simulation, wherein the integral input value of this simulation is the difference between the current speed and the target speed of the vehicle; The first data determination module is used to determine the integral increment of the current simulation based on the integral input value of the current simulation and the preset simulation step size, wherein the preset simulation step size is represented by a decimal fixed point number. The integral simulation module is used to determine the integral output value of the current simulation based on the integral increment of the current simulation and the integral output value of the previous simulation. The preset simulation step size is represented by the following module: The second data determination module is used to determine the physical value and decimal calibration corresponding to the preset simulation step size; The data calculation module is used to calculate the first product of the physical value corresponding to the preset simulation step size and the decimal calibration, which is used as the integer value corresponding to the preset simulation step size. The first data determination module is specifically used for: Determine the integer value corresponding to the integral input value in this simulation; Determine the quotient of the integer value corresponding to the preset simulation step size and the decimal target; The second product of the integer value corresponding to the integral input value of this simulation and the quotient value is calculated as the integral increment of this simulation.

5. An electronic device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, the program including instructions that, when executed by the processor, cause the processor to perform the steps of the integral simulation method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the integral simulation method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Adaptive PI adjustment method

    CN108282077A

  • Elastic combination fixed step size simulation method and system

    CN119004874A