Virtual vehicle speed calculation method, device, vehicle terminal, vehicle and storage medium
By acquiring data frames from the accelerator and brake pedals of physical vehicles and utilizing a self-learning computational model, the problem of poor virtual vehicle speed acquisition in in-vehicle games was solved, enabling real-time and accurate virtual vehicle speed calculation in driving simulation programs and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, the game parameters obtained from the game program by in-vehicle games result in a poor operating experience. Some games do not provide data interfaces, making it impossible to obtain the necessary parameters, which leads to high development costs and a lack of universality.
By acquiring data frames from the accelerator and brake pedals of a physical vehicle, and using a self-learning computational model, the virtual vehicle speed in the simulated driving program is calculated, thus constructing a virtual vehicle speed calculation model and achieving real-time and accurate calculation of the simulated vehicle speed.
It eliminates the need to extract real parameters from game programs, adapts to different driving simulators, and enhances the immersion and interactive experience for operators in driving simulators.
Smart Images

Figure CN116101301B_ABST
Abstract
Description
Technical Field
[0001] This application generally relates to the field of vehicle technology, and in particular to virtual vehicle speed calculation methods, devices, vehicle terminals, vehicles, and storage media. Background Technology
[0002] With the development of vehicle technology, vehicles are able to perform more and more functions, such as providing increasingly sophisticated entertainment facilities, including in-car games.
[0003] Currently, in-vehicle games need to obtain game parameters suitable for vehicle operation from the developed game program, such as virtual vehicle speed in racing games, for use in vehicle scenarios.
[0004] Retrieving game parameters directly from the game program can lead to a poor user experience. Additionally, some games do not provide data interfaces, making it impossible to obtain game parameters. Summary of the Invention
[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a virtual vehicle speed calculation method, device, vehicle terminal, vehicle and storage medium, which obtains real-time data frames of the accelerator pedal and brake pedal in the physical vehicle and uses self-learning to obtain a calculation model to realize the calculation of the virtual vehicle speed in the simulated driving program.
[0006] In a first aspect, embodiments of this application provide a method for calculating virtual vehicle speed, the method comprising:
[0007] Obtain the data frames of the accelerator pedal and brake pedal of the physical vehicle in which it is located;
[0008] Based on the data frame, the speed factor of the simulated vehicle in the currently running program is calculated and applied to the simulated driving program on the on-board terminal of the physical vehicle. The physical vehicle includes an accelerator pedal and a brake pedal, which are used to control the simulated vehicle in the simulated driving program. The method includes:
[0009] Obtain model data frames of the physical vehicle at multiple time points, where each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value.
[0010] The speed factor of the simulated vehicle in the driving simulation program is calculated based on multiple model data frames.
[0011] The system periodically acquires real-time data frames of the vehicle entity, where each real-time data frame includes a real-time value of the accelerator pedal depth and a real-time value of the brake pedal depth.
[0012] Based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous data frame, the first virtual vehicle speed of the simulated vehicle in the current frame is calculated, wherein the first virtual vehicle speed represents the moving speed of the simulated vehicle in the simulated driving program. Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the calculation of the speed factor of the simulated vehicle in the simulated driving program based on multiple model data frames includes:
[0013] Based on the model data frame, calculate the scene vehicle speed factor;
[0014] Based on the scene speed factor and the scene speed status table, the scene speed corresponding to the scene speed factor is determined. The scene speed status table includes the correspondence between the scene speed factor and the scene speed.
[0015] Calculate the speed factor based on the vehicle speed in the scenario and the model data frame.
[0016] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor;
[0017] Based on the vehicle speed in this scenario and the model data frame, calculate the speed factor, including:
[0018] When the number of determined vehicle speeds in the scene is less than three, the method returns the model data frames of the entity vehicle at multiple time points.
[0019] When the number of vehicle speeds in the scenario is three, the acceleration factor, deceleration factor, and drag factor are determined based on the three sets of vehicle speeds in the scenario and their corresponding model data frames.
[0020] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the acquisition of model data frames of the physical vehicle at multiple times includes: sequentially acquiring a preset number of model data frames of the physical vehicle within a preset time period;
[0021] Based on the model data frame, the scene vehicle speed factor is calculated, including:
[0022] The first maximum consecutive number of valid accelerator pedal depth model values is counted within multiple data frames of the model, and the sum of multiple accelerator pedal depth model values corresponding to the first maximum consecutive number is calculated as the valid cumulative value of accelerator pedal depth; wherein, when the accelerator pedal depth model value is greater than or equal to a first preset depth, the accelerator pedal depth model value is a valid value;
[0023] The second maximum consecutive number of valid values for the brake pedal depth model within multiple model data frames is counted, and the sum of multiple brake pedal depth model values corresponding to the second maximum consecutive number is calculated as the valid cumulative value of the brake pedal depth; wherein, when the brake pedal depth model value is greater than or equal to a second preset depth, the brake pedal depth model value is a valid value;
[0024] Count the third largest consecutive number of times within multiple data frames of the model where neither the accelerator pedal depth model value nor the brake pedal depth model value is a valid value.
[0025] The vehicle speed factor for this scenario is calculated based on the effective cumulative value of the accelerator pedal, the effective cumulative value of the brake pedal, and the third maximum consecutive number.
[0026] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the step of counting the first maximum consecutive number of valid values of the accelerator pedal depth model value within multiple model data frames, and calculating the sum of multiple accelerator pedal depth model values corresponding to the first maximum consecutive number as the valid accumulated value of the accelerator pedal depth, includes:
[0027] Count the first maximum consecutive number of valid values for the accelerator pedal depth model value within multiple data frames of this model;
[0028] If the first maximum consecutive number is greater than the first upper limit number, then select the number of accelerator pedal depth model values corresponding to the first upper limit number from the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number, and sum them to obtain the effective cumulative value of the accelerator pedal depth.
[0029] If the first maximum consecutive number is less than or equal to the first upper limit number, then the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number are summed to obtain the effective cumulative value of the accelerator pedal depth;
[0030] and / or
[0031] The system counts the second maximum consecutive number of valid brake pedal depth model values within multiple model data frames, and calculates the sum of the multiple brake pedal depth model values corresponding to this second maximum consecutive number as the valid cumulative value of brake pedal depth, including:
[0032] Count the second largest consecutive number of valid values for the brake pedal depth model within multiple data frames of this model;
[0033] If the second maximum consecutive number is greater than the second upper limit number, then select the number of brake pedal depth model values corresponding to the second upper limit number from the multiple brake pedal depth model values corresponding to the second maximum consecutive number, and sum them to obtain the effective cumulative value of the brake pedal depth;
[0034] If the second maximum consecutive number is less than or equal to the second upper limit number, then the multiple brake pedal depth model values corresponding to the second maximum consecutive number are summed to obtain the effective cumulative value of the brake pedal depth;
[0035] and / or
[0036] This statistic counts the third largest consecutive number of times within multiple data frames of the model where both the accelerator pedal depth model value and the brake pedal depth model value are not valid, including:
[0037] Count the third largest consecutive number of times within multiple data frames of the model where neither the accelerator pedal depth model value nor the brake pedal depth model value is a valid value.
[0038] If the third maximum consecutive count is greater than the third upper limit count, then the second maximum consecutive count is updated to the third upper limit count.
[0039] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the calculation of the scene vehicle speed factor based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number includes:
[0040] Substitute the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive count into Formula 1:
[0041] Scene speed factor = effective cumulative value of accelerator pedal / (effective cumulative value of brake pedal + third maximum consecutive number × n); where n is the idle speed factor.
[0042] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, after calculating the scene vehicle speed factor based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number, the method further includes:
[0043] When the vehicle speed factor of the scene is greater than the first preset threshold or less than the second preset threshold, it indicates that the vehicle speed factor of the scene is invalid. Then the method returns the execution of the model data frames of the entity vehicle obtained sequentially within a preset time.
[0044] Wherein, the first preset threshold is greater than the second preset threshold.
[0045] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor;
[0046] Based on the vehicle speed in this scenario and the model data frame, calculate the speed factor, including:
[0047] When the number of determined vehicle speeds in the scene is less than three, the method returns the model data frames of the entity vehicle obtained sequentially within a preset time.
[0048] When the number of determined vehicle speeds in the scenario is equal to three, substitute the three sets of vehicle speeds in the scenario and their corresponding effective cumulative values of the accelerator pedal and brake pedal into the following formula two:
[0049] Scene vehicle speed = A × effective cumulative value of accelerator pedal - B × effective cumulative value of brake pedal - C × third maximum consecutive number); where A is the acceleration factor, B is the deceleration factor, and C is the drag factor;
[0050] The acceleration factor, deceleration factor, and drag factor are determined based on three sets of formulas.
[0051] Optionally, in some embodiments of the virtual vehicle speed calculation method of this application, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor;
[0052] Based on the speed factor, the real-time data frame, and the first virtual vehicle speed calculated in the previous cycle, the first virtual vehicle speed of the simulated vehicle in the current cycle is calculated, including:
[0053] Substitute the first virtual vehicle speed from the previous frame, the real-time value of the accelerator pedal depth, and the real-time value of the brake pedal depth into the following formula three:
[0054] The first virtual vehicle speed of the current frame = the first virtual vehicle speed of the previous frame + i × (A × real-time value of accelerator pedal depth - B × real-time value of brake pedal depth - C); where A is the acceleration factor, B is the deceleration factor, C is the drag factor, and i is the preset frame rate constant.
[0055] Secondly, embodiments of this application provide a vehicle speed calculation device, which is applied to a simulated driving program on an in-vehicle terminal of a physical vehicle. The physical vehicle includes an accelerator pedal and a brake pedal, which are used to control the simulated vehicle in the simulated driving program. The device is characterized by comprising:
[0056] The first acquisition module is used to acquire model data frames of the physical vehicle at multiple time points; wherein each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value.
[0057] The first calculation module is used to calculate the speed factor of the simulated vehicle in the simulated driving program based on multiple data frames of the model.
[0058] The second acquisition module is used to periodically acquire real-time data frames of the physical vehicle; wherein each real-time data frame includes a real-time value of accelerator pedal depth and a real-time value of brake pedal depth.
[0059] The second calculation module is used to calculate the first virtual vehicle speed of the simulated vehicle in the current frame based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame; wherein the first virtual vehicle speed is used to represent the moving speed of the simulated vehicle in the simulated driving program.
[0060] Thirdly, embodiments of this application provide an in-vehicle terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the virtual vehicle speed calculation method as described in the first aspect above.
[0061] Fourthly, embodiments of this application provide a physical vehicle, which includes:
[0062] Vehicle-mounted terminal, accelerator pedal, and brake pedal;
[0063] The vehicle terminal stores a driving simulation program, and when the driving simulation program is run, the virtual vehicle speed calculation method described in the first aspect is executed.
[0064] The accelerator pedal and the brake pedal are used to control the simulated vehicle in the driving simulation program.
[0065] Fifthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon for implementing the virtual vehicle speed calculation method described in the first aspect above.
[0066] The virtual vehicle speed calculation method, device, vehicle terminal, vehicle, and storage medium provided in this application embodiment, after the vehicle terminal runs the simulated driving program, firstly acquires model data frames including accelerator pedal depth model values and brake pedal depth model values at multiple moments of the physical vehicle it is in. Then, through self-learning on the acquired model data frames, it calculates the speed factor of the simulated vehicle in the currently running simulated driving program to construct a virtual speed calculation model. Then, it acquires the real-time values of the accelerator pedal depth and brake pedal depth of the physical vehicle. Using the constructed virtual speed calculation model and the real-time data frames, it calculates the virtual vehicle speed of the simulated vehicle in the current frame of the running simulated driving program, realizing the real-time and accurate calculation of the virtual vehicle speed in the simulated driving program. This method, by establishing an algorithm model, can adapt to different types of simulated driving programs without extracting real parameters from the program or customizing the simulated driving program. It enables the user to control the components of the physical vehicle based on the virtual vehicle speed when running the simulated driving program, so as to interact realistically with the scene in the simulated driving program and enhance the operator's experience. Attached Figure Description
[0067] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0068] Figure 1 The diagram shown is a schematic representation of the vehicle speed calculation method according to an embodiment of this application.
[0069] Figure 2 This is a flowchart illustrating the vehicle speed calculation method according to an embodiment of this application;
[0070] Figure 3 This is a flowchart illustrating the vehicle speed calculation method of some embodiments of this application;
[0071] Figure 4 This is a flowchart illustrating the vehicle speed calculation method of some embodiments of this application;
[0072] Figure 5 This is a flowchart illustrating the vehicle speed calculation method of some embodiments of this application;
[0073] Figure 6 This is a flowchart illustrating the vehicle speed calculation method of some embodiments of this application;
[0074] Figure 7 This is a schematic diagram of the vehicle speed calculation device according to an embodiment of this application;
[0075] Figure 8 This is a schematic diagram of the structure of a computer used in the processing device according to an embodiment of this application. Detailed Implementation
[0076] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the relevant disclosure and not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the disclosure are shown in the accompanying drawings.
[0077] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0078] It's understandable that game programs can be installed on in-vehicle terminals to provide vehicle users with more comprehensive entertainment facilities. During the operation of these in-vehicle games, physical components such as the accelerator pedal, brake pedal, and steering wheel are separated from the vehicle's actual power system. These physical components are then used to interact with the game interface, thus enabling the in-vehicle game to run.
[0079] For example, in racing games that simulate driving, the simulated vehicle in the driving simulation program can be controlled using the accelerator pedal and brake pedal of a physical vehicle.
[0080] In practice, when a game program is installed on an in-vehicle terminal and the game content is operated using physical components on the vehicle, game parameters adapted to the vehicle components can be used to create realistic interactions with the scenes in the in-vehicle game program, enhancing the operator's experience.
[0081] For example, in driving simulation programs, such as racing games, the program typically involves the operating parameters of the simulated vehicle, such as the virtual speed. During the operation of the driving simulation program on the vehicle, the acquired parameters are used, combined with the actual characteristics of the steering wheel and pedals, to control the content of the driving simulation program using the physical components of the vehicle.
[0082] Furthermore, some developed driving simulators did not consider application to in-vehicle terminals, meaning they lacked data interfaces, making it impossible to obtain their driving simulator parameters. Therefore, when using such driving simulators on in-vehicle terminals, it is necessary to customize driving simulator parameters for each vehicle, resulting in high development costs and limited general applicability.
[0083] Given the aforementioned inconveniences, in this embodiment of the application, the virtual vehicle speed parameter of the simulated vehicle in the simulated driving program is estimated based on experience, considering that the vehicle speed generated during the operation of the brake pedal or accelerator pedal to control the movement of the simulated vehicle can usually be estimated based on experience.
[0084] Therefore, in this embodiment of the application, for the control of a simulated vehicle in a driving simulation program, the relationship between the simulated vehicle's speed and the brake and accelerator pedals can be combined. By pre-acquiring data on the braking and accelerator pedal operation of the physical vehicle, and then using a self-learning algorithm, the virtual vehicle speed caused by the simulated vehicle controlled by the physical components of the physical vehicle at the current moment can be calculated. This allows the construction of a model for calculating the virtual vehicle speed in the driving simulation program. Finally, by using the real-time depth values of the brake and accelerator pedals and the constructed calculation model, the real-time accurate calculation of the virtual vehicle speed in the driving simulation program can be achieved. This allows for the realistic operation of driving simulation programs, such as racing games, using the calculated virtual vehicle speed.
[0085] It is understood that the virtual vehicle speed calculated in this embodiment can be provided to other modules of the vehicle to respond to various operations during the operation of the simulated driving program, thereby enhancing the operator's immersion during the operation of the simulated driving program. Specifically, based on the calculated virtual vehicle speed, the steering torque of the physical vehicle or the air conditioning fan speed can be simulated, etc.
[0086] To better understand and explain the method in this application embodiment for constructing a calculation model of the virtual vehicle speed in a simulated driving program using a self-learning approach based on the acquired data frames of brake pedal and accelerator pedal depressing, and for calculating the virtual vehicle speed in real time, the following will illustrate this method. Figures 1 to 6 A detailed explanation is provided.
[0087] It is understood that this method is applied to a simulated driving program on an in-vehicle terminal of a physical vehicle, which is equipped with an accelerator pedal and a brake pedal, and the accelerator pedal and the brake pedal are used to control the simulated vehicle in the simulated driving program.
[0088] Figure 1 The diagram shown is a flowchart illustrating the virtual vehicle speed calculation method according to an embodiment of this application. In some embodiments, the method is executed by an in-vehicle terminal device. The virtual vehicle speed calculation method provided in this application includes:
[0089] S110: Obtain model data frames of the physical vehicle at multiple time points.
[0090] S120, calculates the speed factor of the simulated vehicle in the simulated driving program based on multiple model data frames.
[0091] S130 periodically acquires real-time data frames of the physical vehicle.
[0092] S140, based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame, calculate the first virtual vehicle speed of the simulated vehicle in the current frame.
[0093] Specifically, after launching a driving simulation program, such as a racing game, on the in-vehicle terminal of a physical vehicle, the player can use the accelerator and brake pedals to control the target content within the simulation program interface, i.e., the simulated vehicle. During this process, the in-vehicle terminal can acquire data frames from the accelerator and brake pedals, such as acquiring model data frames at multiple points in time. Each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value. After acquiring the model data frames at multiple points in time, the acquired model data frames can be processed and analyzed to calculate the speed factor of the simulated vehicle, thereby constructing a virtual speed calculation model for the simulated vehicle through a self-learning process. Furthermore, after calculating the speed factor of the simulated vehicle and completing the construction of the virtual speed calculation model, the constructed calculation model can be used to periodically acquire real-time data frames of the physical vehicle and the virtual speed of the previous frame to calculate the real-time virtual speed of the simulated vehicle during its operation.
[0094] like Figure 2 As shown, if an application running a driving simulation program is installed on the vehicle terminal, the sensors configured on the accelerator pedal and brake pedal will upload data indicating the pedal position to the controller (MCU) via the CAN bus for processing during the application's operation.
[0095] The acquired model data frame can be used to construct a calculation model of the virtual speed of a simulated vehicle in a racing game running on the vehicle terminal through self-learning; the acquired real-time data frame is processed and calculated in the MCU of the vehicle terminal, and the virtual speed is obtained using the constructed calculation model.
[0096] It is understood that the model data frame obtained in the embodiments of this application includes an accelerator pedal depth model value and a brake pedal depth model value. The obtained real-time data frame includes a real-time accelerator pedal depth value and a real-time brake pedal depth value.
[0097] The acquired depth model values or real-time depth values of the accelerator and brake pedals represent the percentage of the total distance traveled when the pedal is fully depressed. For example, if the acquired accelerator pedal data is 20, it means that the accelerator pedal was depressed to the extent of 20% of the total travel distance.
[0098] The virtual vehicle speed represents the speed at which the simulated vehicle moves within the driving simulation program. It can be used as a basis for controlling other components of the physical vehicle to enhance the operator's immersion in the process of controlling the simulated vehicle.
[0099] The vehicle terminal in this embodiment first acquires model data frames, including accelerator pedal depth model values and brake pedal depth model values, at multiple moments in the physical vehicle it is located in. Then, it performs self-learning on the acquired model data frames to calculate the speed factor of the simulated vehicle in the currently running driving simulation program, thereby constructing a virtual speed calculation model. Then, using the constructed virtual speed calculation model and real-time data frames, it calculates the virtual speed of the simulated vehicle in the current frame, realizing the real-time and accurate calculation of the virtual speed of the simulated vehicle in the driving simulation program. This method, by establishing an algorithm model, can adapt to different types of driving simulation programs without extracting real driving simulation program parameters from the driving simulation program or customizing the driving simulation program. This allows the user to control the components of the physical vehicle based on the virtual speed when running the driving simulation program, enhancing the operator's experience.
[0100] In the embodiments of this application, due to the phased nature of the movement process of the operated object (i.e., the simulated vehicle) in a driving simulation program (such as a racing game), the speed change within a certain time period has a certain continuity. Therefore, to facilitate data processing, the depth values of the accelerator pedal and brake pedal at multiple moments can be acquired at a certain frequency as accelerator pedal depth model values and brake pedal depth model values. For example, 60 model data frames can be collected within a certain time period, i.e., 60 accelerator pedal depth model values and 60 brake pedal depth model values.
[0101] Optionally, in some embodiments of this application, in S120, the acquired model data frame is analyzed and processed to calculate the speed factor of the simulated vehicle. Specifically, this can be achieved through... Figure 3 The steps shown are to be followed.
[0102] like Figure 3 The flowchart shown, S120 may specifically include the following steps:
[0103] S121, calculates the scene vehicle speed factor based on the model data frame.
[0104] S122, Based on the scene speed factor and the scene speed status table, determine the scene speed corresponding to the scene speed factor. The scene speed status table includes the correspondence between the scene speed factor and the scene speed.
[0105] S123, Calculate the speed factor based on the vehicle speed in the scene and the model data frame.
[0106] Specifically, the model data frames, including the depth model values of the accelerator and brake pedals, are analyzed to calculate the scene vehicle speed factor. Then, combined with the scene vehicle speed state table—that is, the scene vehicle speed corresponding to the scene vehicle speed factor determined based on mapping relationships obtained from experience or experimental data—the speed factor of the simulated vehicle is calculated based on the scene vehicle speed and the depth model values of the accelerator and brake pedals in the model data frames, thus constructing a calculation model for the virtual vehicle speed.
[0107] Optionally, in some embodiments, in S121, the acquired model data frame, including the depth model values of the accelerator pedal and brake pedal, is analyzed to calculate the scene vehicle speed factor, such as... Figure 4 As shown, S121 may specifically include:
[0108] S1211, count the first maximum consecutive number of valid values for the accelerator pedal depth model within multiple model data frames, and calculate the sum of multiple accelerator pedal depth model values corresponding to the first maximum consecutive number as the valid cumulative value of the accelerator pedal depth; wherein, when the accelerator pedal depth model value is greater than or equal to a first preset depth, the accelerator pedal depth model value is a valid value.
[0109] S1212, count the second maximum consecutive number of valid values for the brake pedal depth model within multiple model data frames, and calculate the sum of multiple brake pedal depth model values corresponding to the second maximum consecutive number as the valid cumulative value of the brake pedal depth; wherein, when the brake pedal depth model value is greater than or equal to the second preset depth, the brake pedal depth model value is a valid value.
[0110] S1213, count the third largest consecutive number of times that the accelerator pedal depth model value and the brake pedal depth model value are not valid within multiple data frames.
[0111] S1214, calculate the vehicle speed factor for the scenario based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number.
[0112] Specifically, a preset number of model data frames for physical vehicles are acquired sequentially within a preset time period. For example, if the preset time is 30 seconds, then within those 30 seconds, a model data frame is acquired every 500 milliseconds, thus acquiring model data frames for 60 physical vehicles within that time period.
[0113] For example, effective values for the accelerator pedal (i.e., a first preset depth value) and the brake pedal (i.e., a second preset depth value) can be preset. When the accelerator pedal depth model value is greater than or equal to the first preset depth, it is an effective value; otherwise, it is an invalid value. Similarly, when the brake pedal depth model value is greater than or equal to the second preset depth, it is an effective value; otherwise, it is an invalid value. In some embodiments, considering the data characteristics of the accelerator and brake pedals, the first preset depth value can be taken from 15% to 20%, and the second preset depth value can also be taken from 15% to 20%.
[0114] It is understood that the specific values of the first preset depth value and the second preset depth value can be determined according to the actual situation, and the embodiments of this application do not impose any restrictions on this.
[0115] In practice, the number of consecutive valid values within multiple model data frames can be counted. That is, we can first count the number of consecutive valid values of the accelerator pedal and brake pedal depth model values within multiple model data frames, and then select the value with the largest consecutive count as the corresponding maximum consecutive count. This yields the first maximum consecutive count of valid accelerator pedal depth model values, the second maximum consecutive count of valid brake pedal depth model values, and the third maximum consecutive count of both accelerator pedal and brake pedal depth model values not being valid, i.e., the number of pedals not pressed.
[0116] It can be understood that the first, second, and third maximum consecutive counts represent the maximum number of consecutive valid depth values. That is, in the actual statistical process, the statistical value is the number of consecutive valid depth values. If an invalid value appears in the middle of the data frame, the consecutive count of valid values needs to start from 0 again, and the maximum value is taken as the maximum consecutive count.
[0117] For example, if the accelerator pedal depth model values in multiple model data frames are a1, a2, a3, a4, b1, a5, a6, a7, b2, a8, a9, b3, a10, and b4 respectively, where a is a valid value and b is an invalid value, then the number of consecutive valid values in the accelerator pedal depth model values in this group of multiple model data frames is 4 (a1, a2, a3, a4), 3 (a5, a6, a7), 2 (a8, a9), and 1 (a10). The maximum number of consecutive values is 4, that is, the first maximum number of consecutive values is 4.
[0118] For example, the depth model values of the brake pedal in multiple model data frames are c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, and d1, where c is a valid value and d is an invalid value. Similarly, the second maximum consecutive number is 13.
[0119] Furthermore, in this embodiment, in addition to counting the consecutive valid values of the accelerator pedal and brake pedal, the number of pedals not pressed is also counted; that is, the third maximum consecutive count is calculated for the number of times within multiple model data frames where neither the accelerator pedal depth model value nor the brake pedal depth model value is a valid value. Similarly, if a valid value appears midway, the count is reset. For example, in the above example, the third maximum consecutive count is 1.
[0120] Furthermore, such as Figure 4 As shown, after counting the number of consecutive effective values of the accelerator pedal and brake pedal, the cumulative value of the accelerator pedal effect and the cumulative value of the brake pedal effect can be calculated in S1211, S1212 and S1213.
[0121] For example, the accelerator pedal data obtained in the above embodiment is: accelerator pedal effect cumulative value = (a1 + a2 + a3 + a4).
[0122] The brake pedal data obtained in the above embodiment is the brake pedal effect cumulative value = (c1+c2+c3+c4+c5+c6+c7+c8+c9+c10+c11+c12+c13).
[0123] It should be noted that the examples of accelerator pedal depth model values and brake pedal depth model values within multiple model data frames in this application are only for explaining the calculation principle of the scene vehicle speed factor in the method provided in the embodiments of this application. Their quantity, magnitude, and whether they conform to the vehicle's operating principles are not limited to the embodiments of this application. It can also be understood that in actual vehicle operation, when the accelerator pedal is continuously depressed, the vehicle will continuously accelerate, and after a period of time, the speed will reach its upper limit; when the brake pedal is continuously depressed, the vehicle will continuously decelerate, and after a period of time, the speed will decrease to zero; when neither the accelerator nor the brake pedal is continuously depressed, the vehicle will enter an idling state and decelerate, and after a period of time, the speed will decrease to a lower value and no longer change. In other words, whether it is continuous acceleration, continuous deceleration, or continuous idling, it will enter a state of constant speed after a period of time, and this duration may be less than the time period for acquiring the data mentioned above.
[0124] Therefore, under this premise, if 60 data points from multiple time points are obtained, and assuming all of them are valid data, some time points may have already entered a state of constant speed. In this case, for self-learning, some data in the data frame is sufficient, while the rest of the data is meaningless.
[0125] In some embodiments of this application, in Figure 4In S1211, S1212 and S1213 shown, in order to further improve the accuracy of calculation when collecting valid data, an appropriate amount of data can be selected based on predefined thresholds, such as the maximum number of valid data points for the accelerator pedal (i.e., the first upper limit), the maximum number of valid data points for the brake pedal (i.e., the second upper limit), and the maximum number of unpressed data points (i.e., the third upper limit).
[0126] Specifically, when counting the number of consecutive valid values, the first step is to count the first maximum consecutive number of valid accelerator pedal depth model values within multiple model data frames. If this first maximum consecutive number is greater than the first upper limit number, then a number of accelerator pedal depth model values corresponding to the first upper limit number are selected from the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number. The selected accelerator pedal depth model values are then summed to obtain the effective cumulative value of the accelerator pedal depth. At this point, the first maximum consecutive number can be updated to the first upper limit number. If the first maximum consecutive number is less than or equal to the first upper limit number, then the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number are summed to obtain the effective cumulative value of the accelerator pedal depth.
[0127] Similarly, to count the number of consecutive valid values of the brake pedal, we can first count the second maximum consecutive number of valid brake pedal depth model values within multiple data frames. If the second maximum consecutive number is greater than the second upper limit number, then select a number of brake pedal depth model values corresponding to the second upper limit number from the multiple brake pedal depth model values corresponding to the second maximum consecutive number, and sum them to obtain the effective cumulative value of the brake pedal depth. At this time, the second maximum consecutive number can be updated to the second upper limit number. If the second maximum consecutive number is less than or equal to the second upper limit number, then sum the multiple brake pedal depth model values corresponding to the second maximum consecutive number to obtain the effective cumulative value of the brake pedal depth.
[0128] In addition, for the third maximum consecutive count of the number of times the accelerator pedal depth model value and the brake pedal depth model value are both invalid within the data frame, i.e. the number of times the pedals are not pressed, we can first count the third maximum consecutive count of the number of times the accelerator pedal depth model value and the brake pedal depth model value are both invalid within multiple data frames. If the third maximum consecutive count is greater than the third upper limit count, then the second maximum consecutive count is updated to the third upper limit count.
[0129] For example, the first maximum consecutive number has a maximum value, which is the first upper limit number, denoted as X; the second maximum consecutive number has a maximum value, which is the second upper limit number, denoted as Y; and the third maximum consecutive number has a maximum value, which is the third upper limit number, denoted as Z.
[0130] It is understood that in the above statistical process of the embodiments of this application, when the number of consecutive valid values of the statistical object is greater than the upper limit, when selecting consecutive valid values in the statistical object that are equivalent to the number of the upper limit, they can be selected randomly, or selected from the beginning of the data, or selected from the end of the data. The embodiments of this application do not impose any restrictions on this.
[0131] For example, in the above embodiment, suppose the maximum value Y of the second maximum consecutive number is 8. When the brake pedal depth model value is c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, d1, where c is a valid value and d is an invalid value, that is, if there are more than 8 consecutive valid values, then when counting valid values, the last 8 values can be selected from the end of the data for calculation.
[0132] Correspondingly, after retaining the last 8 consecutive valid values, the cumulative value of the brake pedal effect is (c6+c7+c8+c9+c10+c11+c12+c13).
[0133] It's understandable that, in reality, the time required for a vehicle to accelerate from low speed to maximum speed under the action of the accelerator pedal is usually greater than the time required to decelerate from high speed to a stop. Therefore, the maximum value X of the first maximum consecutive number of occurrences is greater than the maximum value Y of the second maximum consecutive number of occurrences.
[0134] Optionally, in some embodiments, the maximum value X of the first maximum consecutive number can be obtained as follows: X = Y × constant m. This m value is a balancing value, taking a value greater than 1.
[0135] Similarly, the maximum value Z of the third largest consecutive number can be determined using the following method:
[0136] Z = Y × Idle speed factor n.
[0137] It is understandable that when neither the accelerator nor the brake pedal is pressed, the deceleration under the action of wind resistance and road resistance is usually smaller during the natural deceleration process than during the braking process. Therefore, the value of n is also a balance value that is greater than 1.
[0138] Furthermore, after obtaining the effective cumulative value of the accelerator pedal, the effective cumulative value of the brake pedal, and the number of pedals not pressed (i.e., the third maximum consecutive number) through the above method, the scene speed factor K can be calculated.
[0139] Specifically, the vehicle speed factor for the current scenario can be calculated using the calculated effective cumulative value of the accelerator pedal, the effective cumulative value of the brake pedal, and the third maximum consecutive number.
[0140] After calculating the effective cumulative value of the accelerator pedal, the effective cumulative value of the brake pedal, and the number of unpressed pedals through the above steps, in some embodiments, step S1214 can calculate the scene speed factor K using the following formula:
[0141] K = Accelerator pedal effective cumulative value / (Brake pedal effective cumulative value + third maximum consecutive number × n).
[0142] Where n is the idle speed factor.
[0143] For example, in the above examples, the accelerator pedal depth model values are: a1, a2, a3, a4, b1, a5, a6, a7, b2, a8, a9, b3, a10, b4, and the brake pedal depth model values are: c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, d1.
[0144] but
[0145] Furthermore, such as Figure 3 As shown, after calculating the scene speed factor, the scene speed corresponding to the calculated scene speed factor can be queried according to the scene speed status table, that is, S122 is executed.
[0146] As shown in Table 1, this scene speed status table represents the correspondence between scene speed factors, scene speeds, and vehicle scenes. This scene speed status table can be obtained empirically and pre-stored in the vehicle terminal.
[0147] Table 1: Vehicle Speed Status in Scenarios
[0148] Scene K value range Vehicle speed value Full acceleration Greater than 10 invalid Maintain near maximum speed (4-10] 127 The vehicle speed is near the appropriate speed. (2.3-4] 90 The vehicle speed was near moderate. (1.5-2.3] 60 vehicle idling status (0-1.5) invalid
[0149] As can be seen from the above scene vehicle speed status table, once the scene vehicle speed factor is calculated, a unique scene vehicle speed can be determined.
[0150] For example, in the example above, if K is calculated to be 6, it means that the vehicle speed in the scene is 127.
[0151] It is understood that, in some embodiments of this application, to avoid generating invalid virtual vehicle speeds, a valid value range for K can be defined, such as [1.5, 10]. Further, as... Figure 3 As stated above, after multiple calculations to obtain multiple scene vehicle speeds, the calculated scene vehicle speeds can be used to calculate the speed factor of the simulated vehicle, i.e., step S123 is executed.
[0152] In this embodiment of the application, the speed factor may include an acceleration factor of the simulated vehicle, a deceleration factor of the simulated vehicle, and a simulated drag factor.
[0153] It is understandable that in order to calculate the speed factors of the simulated vehicle—which can include acceleration, deceleration, and drag factors—using the scene vehicle speeds obtained through self-learning, this process involves determining the three unknown parameters of the virtual vehicle's speed factors: acceleration, deceleration, and drag. This requires analyzing and processing the acquired model data using the steps described above to obtain at least three scene speed factors K, and consequently, at least three scene vehicle speeds.
[0154] Therefore, the vehicle speeds in the three scenarios can be calculated to construct three equations, which can then be solved to determine the speed factor of the simulated vehicle.
[0155] For example, the relationship between the scene vehicle speed V and the speed factor of the simulated vehicle can be expressed as the following formula:
[0156] Scene vehicle speed = A × effective cumulative value of accelerator pedal - B × effective cumulative value of brake pedal - C × third maximum consecutive number); where A is the acceleration factor, B is the deceleration factor, and C is the drag factor.
[0157] Where A is the acceleration factor of the simulated vehicle, B is the deceleration factor of the simulated vehicle, and C is the drag factor of the simulated vehicle.
[0158] As can be understood from the above scene speed status table, the scene speed factor K typically has a certain range of values, that is, the effective range of the scene speed factor is: less than or equal to a first preset threshold and greater than or equal to a second preset threshold. In some embodiments, as shown in the scene speed status table above, the first preset threshold is 10 and the second preset threshold is 1.5.
[0159] Therefore, in some embodiments, if the calculated scene speed factor K is greater than a first preset threshold or less than a second preset threshold, it indicates that the scene speed factor K is an invalid value. The first preset threshold is greater than the second preset threshold.
[0160] Furthermore, when it is determined through comparison that the current scene speed factor K is invalid, it needs to be recalculated. That is, the method returns to S110 to reacquire the model data frame.
[0161] Furthermore, in some embodiments of this application, in order to improve the accuracy of the calculation, it is necessary to ensure that the scene speed factor K is valid three times during the process of obtaining the valid scene speed factor K. That is, when the number of valid scene speed factors or scene speeds is less than three, the method returns to the execution of obtaining a preset number of model data frames of physical vehicles sequentially within a preset time; when the number of valid scene speed factors or scene speeds is equal to three, the three sets of scene speeds and their corresponding valid cumulative values of the accelerator pedal and the brake pedal are substituted into the above formula two.
[0162] For example, if the scene speed factor K is valid for the first time but invalid for the second time, the process returns to S110 to obtain data frames for the accelerator pedal and brake pedal, and restarts the self-learning process so that when it is valid for the third time, the equation is solved to obtain the speed factor of the simulated vehicle.
[0163] It can also be understood that when solving the equations for the speed factor, if the solution is unique, it means that the speed factor is usable; otherwise, it is still necessary to return to the self-learning S110 and reacquire the model data frames of the accelerator pedal and brake pedal.
[0164] If the three equations have definite solutions, the self-learning process is completed. If the three equations have no solutions, it is necessary to return to the first step and obtain a new set of model data frames until three sets of scene vehicle speeds and their corresponding model data frames are obtained that can make the above formula 2 solvable.
[0165] Furthermore, the vehicle-mounted terminal can construct a calculation model of the virtual speed of the simulated vehicle based on the speed factor of the simulated vehicle.
[0166] Specifically, after solving the equations through the above calculations and obtaining the speed factor of the simulated vehicle, a calculation model of the virtual vehicle speed can be constructed using the calculated speed factor. This allows the virtual speed of the simulated vehicle in the current frame to be calculated using the constructed calculation model and real-time acquired data frames during the operation of the driving simulation program.
[0167] The calculation model for virtual vehicle speed can be represented by the following formula (Formula 3):
[0168] The first virtual vehicle speed V in the current frame = the first virtual vehicle speed in the previous frame + i × (A × real-time value of accelerator pedal depth - B × real-time value of brake pedal depth - C).
[0169] Here, A × real-time accelerator pedal depth - B × real-time brake pedal depth - C can be understood as a physical quantity related to acceleration. Therefore, i is the preset frame rate constant, which is a physical quantity related to time.
[0170] The specific calculation formula for i is: i = periodic time for acquiring real-time data frames / periodic time for acquiring model data frames.
[0171] It is understandable that by continuously acquiring model data frames of the physical vehicle—that is, acquiring the model values of the accelerator pedal depth and brake pedal depth—and then analyzing the model data frames to construct a calculation model for the virtual vehicle speed as shown in Formula 3 above, this model can be stored in memory. Then, during the operation of the driving simulation program, the virtual vehicle speed can be directly calculated in real time using Formula 3.
[0172] The virtual vehicle speed calculation method in this embodiment acquires model data frames of the accelerator and brake pedals of a physical vehicle at multiple moments. By processing the acquired data, a scene speed factor is calculated. Then, by combining the correspondence between the scene speed factor and scene speed in the scene speed state table, the scene speed corresponding to the scene speed factor is determined. Using the determined scene speed, the speed factor of the simulated vehicle is calculated. Finally, based on the calculated speed factor, a calculation model for the virtual vehicle speed is constructed. This allows for real-time calculation of the virtual vehicle speed during the subsequent operation of the driving simulation program, using the constructed calculation model and real-time depth values of the accelerator and brake pedals. This enables accurate calculation of the real-time virtual vehicle speed in driving simulation programs (such as racing games), allowing the corresponding components in the physical vehicle to operate according to the virtual speed, effectively enhancing the immersive experience during the driving simulation program's operation. This method, by establishing an algorithm model, can adapt to different types of driving simulation programs without extracting parameters from the actual driving simulation program and does not involve customizing the driving simulation program.
[0173] Furthermore, in this embodiment of the application, in order to improve the accuracy of the simulated driving program during operation, the virtual vehicle speed calculated through the above-mentioned self-learning method can also be corrected.
[0174] Optionally, in some embodiments, the virtual speed of the simulated vehicle in the driving simulation program, i.e., the second virtual speed, can be generated in real time by reverse engineering the sound recognition or image recognition of the driving simulation program. The virtual speed calculated by the computing model, i.e., the first virtual speed, is then corrected. That is, when an effective speed can be recognized by sound and / or image, a fusion algorithm can be used to fuse the first virtual speed generated by self-learning and the second virtual speed generated by sound or image recognition technology, such as a weighted algorithm, to obtain a more accurate target virtual speed for the current state of the simulated vehicle in the driving simulation program.
[0175] Alternatively, in some embodiments, when calculating the second virtual vehicle speed, the obtained virtual vehicle speed can be further judged. After judging the validity of the first virtual vehicle speed and the second virtual vehicle speed, the valid speed value can be directly used as the current virtual vehicle speed, i.e., a more accurate target virtual vehicle speed.
[0176] In practice, the process of generating virtual vehicle speed using audio signals can be specifically described as follows: Figure 5 As shown, during the operation of the simulated driving program after it is started, the vehicle terminal obtains the original audio signal of the simulated driving program through the DSP, and then uses the audio intermediate file in the multimedia to perform frequency division processing on the original audio signal to calculate the loudness value of each channel, and then determines that the periodic signal of the spectrum meets the engine simulation sound corresponding to the vehicle speed, so as to output the virtual vehicle speed signal, that is, generate the virtual vehicle speed value.
[0177] For example, the second virtual speed can be determined based on the volume of the sound signal during the operation of the driving simulator, or based on the color value changes of pixels in the image signal. Alternatively, in some racing driving simulators, the current speed is displayed on the simulator interface, and the speed value displayed on the image can be directly identified to determine the second virtual speed.
[0178] Alternatively, in scenarios with a driving simulator program that has an interface, the real-time virtual vehicle speed can be obtained from the driving simulator program interface. Then, the virtual vehicle speed generated through self-learning and the virtual vehicle speed extracted from the interface can be fused to obtain a more accurate virtual vehicle speed for the current state of the simulated vehicle in the driving simulator program.
[0179] It is understandable that when no valid vehicle speed is detected through sound / image, and the currently running driving simulation program does not have an interface set, the virtual vehicle speed of the simulated vehicle in the driving simulation program can be generated by analyzing the data of the pedals, as described above.
[0180] The virtual vehicle speed calculation method for simulated vehicles in this embodiment obtains the depth values of the accelerator and brake pedals of the physical vehicle, and then determines the speed factor of the simulated vehicle by combining the correspondence between the scene speed factor and the scene speed in the vehicle speed state table. Finally, based on the determined speed factor, a calculation model for calculating the virtual speed of the simulated vehicle can be constructed. This allows the virtual speed of the simulated vehicle to be calculated in real time during the operation of the simulated driving program. At the same time, the virtual speed of the current state can be obtained by image or audio data analysis methods, or by obtaining the virtual speed of the current state through a data interface. The virtual speeds obtained in different ways are then fused to correct the virtual speed obtained by the self-learning method, thereby achieving accurate calculation of the real-time virtual speed of the simulated vehicle in racing simulation driving programs.
[0181] To better understand the vehicle speed calculation method provided in the embodiments of this application, the following will be used as an example. Figure 6 The process will be explained in detail.
[0182] like Figure 6 As shown, when the operator starts a driving simulation program on the vehicle terminal, the vehicle terminal can determine whether the program is a driving simulation program (e.g., a racing game). If not, it means that no vehicle speed parameter is needed, and the method ends, that is, there is no need to calculate the virtual vehicle speed.
[0183] If the system determines that the currently running program is a driving simulator, it further checks whether the driving simulator has already performed self-learning, i.e., whether it has constructed a virtual vehicle speed calculation model. If it is determined that self-learning has been performed, the learned virtual vehicle speed calculation model can be directly used to calculate the virtual vehicle speed. Alternatively, the operator can choose to relearn, meaning the onboard terminal can receive a relearning command input by the operator.
[0184] It is understood that the driving simulation program running on the vehicle terminal in this embodiment can be configured with various types of simulated vehicles. Therefore, during actual experience, after initially selecting a simulated vehicle, the operator can learn and construct a virtual vehicle speed calculation model through the aforementioned self-learning method.
[0185] Alternatively, after multiple operations, you can manually choose to relearn in order to continuously update the data.
[0186] Furthermore, when it is determined that the in-vehicle driving simulation program has not undergone self-learning, or the operator chooses to relearn, it is then determined whether the current learning trigger conditions are met, i.e., whether the accelerator pedal or brake pedal is being pressed.
[0187] Once it is determined that the accelerator or brake pedal is depressed, a self-learning operation can be performed. Specifically, through the learning process provided in the above embodiment, multiple model data frames of the accelerator and brake pedals over a preset time period are first acquired. These model data frames are then analyzed to calculate the scene vehicle speed factor K, and the validity of the calculated scene vehicle speed factor K is then determined. Specifically, during the self-learning process, the depth values of the accelerator and brake pedals are acquired as model data frames at a frequency of once every 500ms within 30 seconds.
[0188] It's understandable that when K represents an invalid value, the self-learning process needs to be re-executed to recalculate the acceleration factor K. When K represents a valid value, it is further determined whether the number of valid K values is greater than or equal to 3.
[0189] That is, the empirical reference value provided in the above embodiments is used to determine whether K is effective.
[0190] If the number of valid representations of K is less than 3, the self-learning process is re-executed to recalculate the scene vehicle speed factor K. If the number of valid representations of K is greater than or equal to 3, an equation including the speed factor of the simulated vehicle can be constructed by using the scene vehicle speed determined by the scene vehicle speed state table.
[0191] Finally, the equations for the constructed speed factors are solved. When valid and unique acceleration factor A, deceleration factor B, and drag factor C are obtained, these factors can be substituted into the virtual speed calculation model of the simulated vehicle to obtain the virtual speed of the simulated vehicle in its current state during the operation of the onboard driving simulation program. In other words, the virtual speed calculation model of the simulated vehicle during the operation of the onboard driving simulation program can be constructed.
[0192] It is understandable that after the above process is completed, when the operator actually operates, that is, when the operator operates the content in the simulated driving program interface by operating the accelerator pedal and the brake pedal, the virtual speed of the simulated vehicle can be calculated using the above-constructed calculation model and the real-time data frames of the physical vehicle acquired periodically. Then, based on the calculated virtual speed, the corresponding components in the physical vehicle will move to satisfy the operator's simulated driving program experience.
[0193] On the other hand, embodiments of this application also provide a virtual vehicle speed calculation device, such as... Figure 7 As shown, the device is applied to a simulated driving program on an in-vehicle terminal of a physical vehicle. The physical vehicle includes an accelerator pedal and a brake pedal, which are used to control the simulated vehicle in the simulated driving program. The device includes:
[0194] The first acquisition module 710 is used to acquire model data frames of the physical vehicle at multiple time points; wherein each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value.
[0195] The first calculation module 720 is used to calculate the speed factor of the simulated vehicle in the simulated driving program based on multiple model data frames;
[0196] The second acquisition module 730 is used to periodically acquire real-time data frames of the physical vehicle; wherein each real-time data frame includes a real-time value of accelerator pedal depth and a real-time value of brake pedal depth.
[0197] The second calculation module 740 is used to calculate the first virtual vehicle speed of the simulated vehicle in the current frame based on the speed factor, the real-time data frame and the first virtual vehicle speed of the previous frame; wherein the first virtual vehicle speed is used to represent the moving speed of the simulated vehicle in the simulated driving program.
[0198] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the first calculation module 720 includes:
[0199] The first calculation unit 721 is used to calculate the scene vehicle speed factor based on the model data frame;
[0200] The determining unit 722 is used to determine the scene speed corresponding to the scene speed factor based on the scene speed factor and the scene speed state table. The scene speed state table includes the correspondence between the scene speed factor and the scene speed.
[0201] The second calculation unit 723 is used to calculate the speed factor based on the vehicle speed in the scene and the model data frame.
[0202] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor. The first calculation module is specifically used for:
[0203] When the number of determined vehicle speeds in the scene is less than three, the method returns the model data frames of the entity vehicle at multiple time points.
[0204] When the number of vehicle speeds in the scenario is three, the acceleration factor, deceleration factor, and drag factor are determined based on the three sets of vehicle speeds in the scenario and their corresponding model data frames.
[0205] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the first acquisition module 710 is specifically used to: sequentially acquire a preset number of model data frames of the physical vehicle within a preset time.
[0206] The first calculation unit 721 is used for:
[0207] The first maximum consecutive number of valid accelerator pedal depth model values is counted within multiple data frames of the model, and the sum of multiple accelerator pedal depth model values corresponding to the first maximum consecutive number is calculated as the valid cumulative value of accelerator pedal depth; wherein, when the accelerator pedal depth model value is greater than or equal to a first preset depth, the accelerator pedal depth model value is a valid value;
[0208] The second maximum consecutive number of valid values for the brake pedal depth model within multiple model data frames is counted, and the sum of multiple brake pedal depth values corresponding to the second maximum consecutive number is calculated as the valid cumulative value of the brake pedal depth; wherein, when the brake pedal depth model value is greater than or equal to the second preset depth, the brake pedal depth model value is a valid value;
[0209] Count the third largest consecutive number of times within multiple data frames where both the accelerator pedal depth model value and the brake pedal depth model value are not valid.
[0210] The vehicle speed factor for this scenario is calculated based on the effective cumulative value of the accelerator pedal, the effective cumulative value of the brake pedal, and the third maximum consecutive number.
[0211] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the first calculation unit 721 is specifically used for:
[0212] Count the first maximum consecutive number of valid values for the accelerator pedal depth model value within multiple data frames of this model;
[0213] If the first maximum consecutive number is greater than the first upper limit number, then select the number of accelerator pedal depth model values corresponding to the first upper limit number from the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number, and sum them to obtain the effective cumulative value of the accelerator pedal depth.
[0214] If the first maximum consecutive number is less than or equal to the first upper limit number, then the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number are summed to obtain the effective cumulative value of the accelerator pedal depth;
[0215] and / or
[0216] The system counts the second maximum consecutive number of valid brake pedal depth model values within multiple data frames, and calculates the sum of the multiple brake pedal depth model values corresponding to this second maximum consecutive number as the valid cumulative value of the brake pedal depth, including:
[0217] Count the second largest consecutive number of valid values for the brake pedal depth model within multiple data frames;
[0218] If the second maximum consecutive number is greater than the second upper limit number, then select a number of brake pedal depth model values corresponding to the second upper limit number from the multiple brake pedal depth model values corresponding to the second maximum consecutive number, and sum them to obtain the effective cumulative value of the brake pedal depth; if the second maximum consecutive number is less than or equal to the second upper limit number, then sum the multiple brake pedal depth model values corresponding to the second maximum consecutive number to obtain the effective cumulative value of the brake pedal depth.
[0219] and / or
[0220] This statistic counts the third largest consecutive number of times within multiple data frames where both the accelerator pedal depth model value and the brake pedal depth model value are not valid, including:
[0221] Count the third largest consecutive number of times within multiple data frames where both the accelerator pedal depth model value and the brake pedal depth model value are not valid.
[0222] If the third maximum consecutive count is greater than the third upper limit count, then the second maximum consecutive count is updated to the third upper limit count.
[0223] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the first calculation unit 721 is specifically used for:
[0224] Substitute the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive count into Formula 1:
[0225] Scene speed factor = effective cumulative value of accelerator pedal / (effective cumulative value of brake pedal + third maximum consecutive number × n); where n is the idle speed factor.
[0226] Optionally, the virtual vehicle speed calculation device in this application embodiment further includes:
[0227] When the vehicle speed factor of the scene is greater than the first preset threshold or less than the second preset threshold, it indicates that the vehicle speed factor of the scene is invalid. Then the method returns the execution of the model data frames of the entity vehicle obtained sequentially within a preset time.
[0228] Wherein, the first preset threshold is greater than the second preset threshold.
[0229] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor;
[0230] The second calculation unit 723 is specifically used for:
[0231] When the number of determined vehicle speeds in the scene is less than three, the method returns the model data frames of the entity vehicle obtained sequentially within a preset time.
[0232] When the number of determined vehicle speeds in the scenario is equal to three, substitute the three sets of vehicle speeds in the scenario and their corresponding effective cumulative values of the accelerator pedal and brake pedal into the following formula two:
[0233] Scene vehicle speed = A × effective cumulative value of accelerator pedal - B × effective cumulative value of brake pedal - C × third maximum consecutive number); where A is the acceleration factor, B is the deceleration factor, and C is the drag factor;
[0234] The acceleration factor, deceleration factor, and drag factor are determined based on three sets of formulas.
[0235] Optionally, in the virtual vehicle speed calculation device of this application embodiment, the speed factor includes an acceleration factor, a deceleration factor, and a drag factor;
[0236] The second calculation module 740 is used for:
[0237] Substitute the first virtual vehicle speed from the previous frame, the real-time value of the accelerator pedal depth, and the real-time value of the brake pedal depth into the following formula three:
[0238] The first virtual vehicle speed in the current frame = the first virtual vehicle speed in the previous frame + i × (A × real-time value of accelerator pedal depth - B × real-time value of brake pedal depth - C); where A is the acceleration factor, B is the deceleration factor, C is the drag factor, and i is a preset frame rate constant. On the other hand, embodiments of this application also provide a physical vehicle, which includes:
[0239] The vehicle-mounted terminal, accelerator pedal, and brake pedal are included. The vehicle-mounted terminal stores a driving simulation program, and when the driving simulation program is run, the virtual vehicle speed calculation method described in the above embodiments is executed. The accelerator pedal and the brake pedal are used to control the simulated vehicle in the driving simulation program.
[0240] On the other hand, this application also provides an in-vehicle terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is used to execute the program to implement the virtual vehicle speed calculation method described in the above embodiments.
[0241] The following is for reference. Figure 8 , Figure 8 This is a schematic diagram of the structure of the computer electronic device of the vehicle-mounted terminal equipment according to an embodiment of this application.
[0242] like Figure 8As shown, the computer electronic device includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from the storage section 502 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0243] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0244] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined in the electronic device of this application.
[0245] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electronic device, apparatus, or device that is electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an electronic device, apparatus, or device that executes instructions. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an electronic device, apparatus, or device whose instructions are executed. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0246] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of processing apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using dedicated hardware-based electronic devices that perform the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0247] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, it can be described as: a processor including: a first acquisition module, a first calculation module, a second acquisition module, and a second calculation module. The names of these units or modules do not necessarily limit the unit or module itself. For example, the determining module can also be described as "for calculating the first virtual vehicle speed of the simulated vehicle in the current frame based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame; wherein the first virtual vehicle speed represents the moving speed of the simulated vehicle in the simulated driving program."
[0248] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs, which, when used by one or more processors, execute the vehicle speed calculation method described in this application:
[0249] The model data frames of the physical vehicle at multiple time points are acquired; wherein each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value.
[0250] The speed factor of the simulated vehicle in the simulated driving program is calculated based on multiple model data frames.
[0251] The real-time data frames of the physical vehicle are acquired periodically; wherein each real-time data frame includes a real-time value of accelerator pedal depth and a real-time value of brake pedal depth.
[0252] Based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame, the first virtual vehicle speed of the simulated vehicle in the current frame is calculated; wherein, the first virtual vehicle speed is used to represent the moving speed of the simulated vehicle in the simulated driving program.
[0253] In summary, the virtual vehicle speed calculation method, apparatus, device, and storage medium provided in this application first acquire model data frames, including accelerator pedal depth model values and brake pedal depth model values, at multiple moments in the physical vehicle it is located in. Then, by self-learning the acquired model data frames, it calculates the speed factor of the simulated vehicle in the currently running driving simulation program to construct a virtual speed calculation model. Then, it acquires the real-time values of the accelerator pedal depth and brake pedal depth of the physical vehicle. Using the constructed virtual speed calculation model and the real-time data frames, it calculates the virtual vehicle speed of the simulated vehicle in the current frame, realizing the real-time and accurate calculation of the virtual vehicle speed in racing simulation programs. This method, by establishing an algorithm model, can adapt to different types of driving simulation programs without extracting real driving simulation program parameters from the driving simulation program. It is not limited to customized driving simulation programs, so that when running the driving simulation program, the components of the physical vehicle can be controlled according to the virtual vehicle speed, enhancing the operator experience.
[0254] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A virtual vehicle speed calculation method, applied to a simulated driving program on an in-vehicle terminal of a physical vehicle, wherein the physical vehicle includes an accelerator pedal and a brake pedal, the accelerator pedal and the brake pedal being used to control a simulated vehicle in the simulated driving program, characterized in that... The method includes: The model data frames of the physical vehicle at multiple time points are acquired; wherein each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value. The speed factor of the simulated vehicle in the simulated driving program is calculated based on multiple model data frames. The real-time data frames of the physical vehicle are acquired periodically; wherein each real-time data frame includes a real-time value of accelerator pedal depth and a real-time value of brake pedal depth. Based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame, the first virtual vehicle speed of the simulated vehicle in the current frame is calculated; wherein, the first virtual vehicle speed is used to represent the moving speed of the simulated vehicle in the simulated driving program.
2. The virtual vehicle speed calculation method according to claim 1, characterized in that, The calculation of the speed factor of the simulated vehicle in the simulated driving program based on multiple model data frames includes: Based on the model data frame, calculate the scene vehicle speed factor; Based on the scene speed factor and the scene speed status table, the scene speed corresponding to the scene speed factor is determined. The scene speed status table includes the correspondence between the scene speed factor and the scene speed. The speed factor is calculated based on the vehicle speed in the scene and the model data frame.
3. The virtual vehicle speed calculation method according to claim 2, characterized in that, The speed factor includes an acceleration factor, a deceleration factor, and a drag factor; The speed factor is calculated based on the scene vehicle speed and the model data frame, including: When the number of determined scene vehicle speeds is less than three, the method returns to the step of obtaining model data frames of the entity vehicle at multiple time points. When the number of determined scene vehicle speeds is equal to three, the acceleration factor, the deceleration factor, and the drag factor are determined based on the three sets of scene vehicle speeds and their corresponding model data frames.
4. The virtual vehicle speed calculation method according to claim 2, characterized in that, The step of acquiring model data frames of the physical vehicle at multiple time points includes: sequentially acquiring a preset number of model data frames of the physical vehicle within a preset time period; The calculation of the scene vehicle speed factor based on the model data frame includes: The first maximum consecutive number of valid accelerator pedal depth model values within multiple model data frames is counted, and the sum of multiple accelerator pedal depth model values corresponding to the first maximum consecutive number is calculated as the valid cumulative value of accelerator pedal depth; wherein, when the accelerator pedal depth model value is greater than or equal to a first preset depth, the accelerator pedal depth model value is a valid value; The second maximum consecutive number of valid brake pedal depth model values within multiple model data frames is counted, and the sum of multiple brake pedal depth model values corresponding to the second maximum consecutive number is calculated as the valid cumulative value of brake pedal depth; wherein, when the brake pedal depth model value is greater than or equal to a second preset depth, the brake pedal depth model value is a valid value; The third largest consecutive number of times that neither the accelerator pedal depth model value nor the brake pedal depth model value is valid is counted within multiple model data frames; The scene speed factor is calculated based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number.
5. The virtual vehicle speed calculation method according to claim 4, characterized in that, The step of counting the first maximum consecutive number of valid accelerator pedal depth model values within multiple model data frames, and calculating the sum of the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number as the valid cumulative value of accelerator pedal depth, includes: Count the first maximum consecutive number of valid values for the accelerator pedal depth model value within multiple model data frames; If the first maximum consecutive number is greater than the first upper limit number, then select a number of accelerator pedal depth model values corresponding to the first upper limit number from the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number, and sum them to obtain the effective cumulative value of the accelerator pedal depth. If the first maximum consecutive number is less than or equal to the first upper limit number, then the summation of the multiple accelerator pedal depth model values corresponding to the first maximum consecutive number is used to obtain the effective cumulative value of the accelerator pedal depth. and / or The step of counting the second maximum consecutive number of valid brake pedal depth model values within multiple model data frames, and calculating the sum of multiple brake pedal depth model values corresponding to the second maximum consecutive number as the valid cumulative value of brake pedal depth, includes: The second largest consecutive number of valid values for the brake pedal depth model value is counted within multiple model data frames. If the second maximum consecutive number is greater than the second upper limit number, then select a number of brake pedal depth model values corresponding to the second upper limit number from the multiple brake pedal depth model values corresponding to the second maximum consecutive number, and sum them to obtain the effective cumulative value of the brake pedal depth; If the second maximum consecutive number is less than or equal to the second upper limit number, then the multiple brake pedal depth model values corresponding to the second maximum consecutive number are summed to obtain the effective cumulative value of the brake pedal depth; and / or The third maximum consecutive number of times that neither the accelerator pedal depth model value nor the brake pedal depth model value is valid within multiple model data frames includes: The third largest consecutive number of times that neither the accelerator pedal depth model value nor the brake pedal depth model value is valid is counted within multiple model data frames; If the third maximum consecutive number is greater than the third upper limit number, then the second maximum consecutive number is updated to the third upper limit number.
6. The virtual vehicle speed calculation method according to claim 4, characterized in that, The calculation of the scene speed factor based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number includes: Substitute the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number into Formula 1: Scene speed factor = effective cumulative value of accelerator pedal / (effective cumulative value of brake pedal + third maximum consecutive number × n); where n is the idle speed factor.
7. The virtual vehicle speed calculation method according to claim 4, characterized in that, After calculating the scene speed factor based on the effective accumulated value of the accelerator pedal, the effective accumulated value of the brake pedal, and the third maximum consecutive number, the method further includes: When the scene speed factor is greater than the first preset threshold or less than the second preset threshold, it indicates that the scene speed factor is invalid, and the method returns to the execution of obtaining a preset number of model data frames of the entity vehicles in sequence within a preset time. Wherein, the first preset threshold is greater than the second preset threshold.
8. The virtual vehicle speed calculation method according to claim 4, characterized in that, The speed factor includes an acceleration factor, a deceleration factor, and a drag factor; The speed factor is calculated based on the scene vehicle speed and the model data frame, including: When the number of determined scene vehicle speeds is less than three, the method returns to the step of sequentially acquiring a preset number of model data frames of the physical vehicles within a preset time. When the number of determined scene vehicle speeds is equal to three, substitute the three sets of scene vehicle speeds and their corresponding effective cumulative values of the accelerator pedal and brake pedal into the following formula two: Scene vehicle speed = A × effective cumulative value of accelerator pedal - B × effective cumulative value of brake pedal - C × third maximum consecutive number; where A is the acceleration factor, B is the deceleration factor, and C is the drag factor; The acceleration factor, the deceleration factor, and the drag factor are determined based on three sets of formulas.
9. The virtual vehicle speed calculation method according to any one of claims 2-8, characterized in that, The speed factor includes an acceleration factor, a deceleration factor, and a drag factor; The calculation of the first virtual vehicle speed of the simulated vehicle in the current cycle based on the speed factor, the real-time data frame, and the first virtual vehicle speed calculated in the previous cycle includes: Substitute the first virtual vehicle speed of the previous frame, the real-time value of the accelerator pedal depth, and the real-time value of the brake pedal depth into the following formula three: The first virtual vehicle speed in the current frame = the first virtual vehicle speed in the previous frame + i × (A × real-time accelerator pedal depth - B × real-time brake pedal depth - C); where A is the acceleration factor, B is the deceleration factor, and C is the drag factor. i This is the preset frame rate constant.
10. A virtual vehicle speed calculation device, applied to a simulated driving program on an in-vehicle terminal of a physical vehicle, the physical vehicle including an accelerator pedal and a brake pedal, the accelerator pedal and the brake pedal being used to control a simulated vehicle in the simulated driving program, characterized in that, The virtual vehicle speed calculation device includes: The first acquisition module is used to acquire model data frames of the physical vehicle at multiple time points; wherein each model data frame includes an accelerator pedal depth model value and a brake pedal depth model value. The first calculation module is used to calculate the speed factor of the simulated vehicle in the simulated driving program based on multiple model data frames; The second acquisition module is used to periodically acquire real-time data frames of the physical vehicle; wherein each real-time data frame includes a real-time value of accelerator pedal depth and a real-time value of brake pedal depth. The second calculation module is used to calculate the first virtual vehicle speed of the simulated vehicle in the current frame based on the speed factor, the real-time data frame, and the first virtual vehicle speed of the previous frame; wherein the first virtual vehicle speed is used to represent the moving speed of the simulated vehicle in the simulated driving program.
11. A vehicle-mounted terminal, characterized in that, The vehicle-mounted terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor is used to execute the program to implement the virtual vehicle speed calculation method as described in any one of claims 1-9.
12. A physical vehicle, characterized in that, The physical vehicles include: Vehicle-mounted terminal, accelerator pedal, and brake pedal; The vehicle terminal stores a driving simulation program, and when the driving simulation program is run, the virtual vehicle speed calculation method as described in any one of claims 1-9 is executed. The accelerator pedal and the brake pedal are used to control the simulated vehicle in the driving simulation program.
13. A computer-readable storage medium having a computer program stored thereon, the computer program being used to implement the virtual vehicle speed calculation method as described in any one of claims 1-9.
Citation Information
Patent Citations
Vehicle-mounted game method and device, vehicle and machine readable medium
CN110368679A
Vehicle and game control method and device thereof
CN112569609A