Trajectory prediction method and device, computer readable storage medium, and electronic device
By using a method that combines the calculation of the positions of the first and second vehicles, the problem of inaccurate prediction of vehicle trajectories in existing technologies is solved, the accuracy of vehicle position prediction is improved, game lag is reduced, and the gaming experience is enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-03-27
- Publication Date
- 2026-07-10
AI Technical Summary
In the existing technology, the trajectory prediction methods for game vehicles cannot guarantee accuracy, resulting in game lag.
By receiving vehicle movement data sent by the server, the positions of the first and second vehicles are calculated, and a hybrid calculation method is used to predict the position of game vehicles, thereby increasing accuracy.
It improves the accuracy of vehicle location prediction, reduces game lag, and enhances the gaming experience.
Smart Images

Figure CN116212387B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of physical vehicle synchronization technology, and in particular to a trajectory prediction method and device, a computer-readable storage medium, and an electronic device. Background Technology
[0002] In games that utilize physics-based vehicle synchronization technology, the physical effects of vehicles are affected by network quality. When the network fluctuates, if the speed and position of game vehicles cannot be accurately predicted, stuttering or lag will occur.
[0003] In existing technologies, three methods are commonly used to predict the speed and position of game vehicles: ordinary linear prediction, linear prediction with acceleration, and projection velocity hybrid. However, none of these prediction methods can guarantee the accuracy of the prediction, which leads to a deviation between the trajectory of the game vehicle and the actual trajectory, thus reducing the accuracy of the predicted speed and position of the game vehicle.
[0004] Therefore, there is an urgent need in this field to develop a new trajectory prediction method and device.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this disclosure is to provide a trajectory prediction method, trajectory prediction device, computer-readable storage medium, and electronic device, thereby overcoming, at least to some extent, the problem of low prediction accuracy caused by related technologies.
[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0008] According to a first aspect of the present invention, a trajectory prediction method is provided, the method comprising: receiving first vehicle movement data corresponding to a game vehicle sent by a server; determining second vehicle movement data of the game vehicle at a current time; the first vehicle movement data including a data transmission time; if the current time is greater than the data transmission time, calculating the first vehicle movement data and the second vehicle movement data respectively to obtain a first vehicle position corresponding to a first target time and a second vehicle position corresponding to the current time; the first target time and the current time differ by a time interval; and performing a mixed calculation on the first vehicle position and the second vehicle position to predict the vehicle position of the game vehicle at the first target time.
[0009] According to a second aspect of the present invention, a trajectory prediction apparatus is provided, the apparatus comprising: a determining module configured to receive first vehicle movement data corresponding to a game vehicle sent by a server, and determine second vehicle movement data of the game vehicle at a current time; the first vehicle movement data includes a data transmission time; a calculating module configured to, if the current time is greater than the data transmission time, calculate the first vehicle movement data and the second vehicle movement data respectively to obtain a first vehicle position corresponding to a first target time and a second vehicle position corresponding to the current time; the first target time and the current time differ by a time interval; and a prediction module configured to perform a mixed calculation on the first vehicle position and the second vehicle position to predict the vehicle position of the game vehicle at the first target time.
[0010] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the trajectory prediction method of any of the above exemplary embodiments.
[0011] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the trajectory prediction method in any of the above exemplary embodiments.
[0012] As can be seen from the above technical solutions, the trajectory prediction method, trajectory prediction device, computer storage medium, and electronic device in the exemplary embodiments of the present invention have at least the following advantages and positive effects:
[0013] In the methods and apparatus provided in the exemplary embodiments of this disclosure, the predicted vehicle position is obtained by mixing a first vehicle position and a second vehicle position. The first vehicle position and the second vehicle position are calculated by processing first vehicle movement data and second vehicle movement data. By mixing the first vehicle position and the second vehicle position, the accuracy of the predicted vehicle position is increased.
[0014] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0016] Figure 1 The schematic diagram illustrates a flow chart of the trajectory prediction method in an embodiment of this disclosure;
[0017] Figure 2 This diagram illustrates the data interaction process between the server and the terminal in the trajectory prediction method of this embodiment.
[0018] Figure 3 The schematic diagram illustrates the process of obtaining the positions of the first and second vehicles in the trajectory prediction method of this disclosure embodiment;
[0019] Figure 4 This schematic diagram illustrates the process of calculating the acceleration of the first target in the trajectory prediction method of this embodiment.
[0020] Figure 5 This schematic diagram illustrates the process of predicting the trajectory of a game vehicle in an embodiment of the present disclosure when the vehicle is decelerating.
[0021] Figure 6 This illustration shows a flowchart of the trajectory prediction method in an embodiment of the present disclosure, illustrating the process of recovering from the prediction stage to the normal stage.
[0022] Figure 7 This diagram illustrates the interaction between the terminal and the server during the transition phase in the trajectory prediction method of this embodiment.
[0023] Figure 8 This schematic diagram illustrates the process of obtaining the position of the fourth vehicle corresponding to the current moment in the trajectory prediction method of this embodiment;
[0024] Figure 9 The schematic diagram illustrates the process of obtaining the second mixing factor in the trajectory prediction method of this disclosure embodiment;
[0025] Figure 10 The illustration schematically depicts an apparatus for a trajectory prediction method according to an embodiment of the present disclosure;
[0026] Figure 11 An electronic device for a trajectory prediction method is schematically illustrated in an embodiment of this disclosure;
[0027] Figure 12The illustration schematically shows a computer-readable storage medium for a trajectory prediction method according to an embodiment of the present disclosure. Detailed Implementation
[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0029] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0030] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.
[0031] In view of the problems existing in related technologies, this disclosure proposes a trajectory prediction method. Figure 1 A flowchart illustrating the trajectory prediction method is shown, as follows: Figure 1 As shown, the trajectory prediction method includes at least the following steps:
[0032] Step S110. Receive the first vehicle movement data corresponding to the game vehicle sent by the server, and determine the second vehicle movement data that the game vehicle has at the current moment; the first vehicle movement data includes the data transmission time.
[0033] Step S120. If the current time is greater than the data transmission time, calculate the first vehicle movement data and the second vehicle movement data respectively to obtain the first vehicle position corresponding to the first target time and the second vehicle position corresponding to the current time; the first target time and the current time differ by a time interval.
[0034] Step S130. Perform a combined calculation on the positions of the first vehicle and the second vehicle to predict the vehicle position of the game vehicle at the first target time.
[0035] In the methods and apparatus provided in the exemplary embodiments of this disclosure, the predicted vehicle position is obtained by mixing a first vehicle position and a second vehicle position. The first vehicle position and the second vehicle position are calculated by processing first vehicle movement data and second vehicle movement data. By mixing the first vehicle position and the second vehicle position, the accuracy of the predicted vehicle position is increased.
[0036] The following section provides a detailed explanation of each step in the trajectory prediction method.
[0037] In step S110, the server receives the first vehicle movement data corresponding to the game vehicle, and determines the second vehicle movement data that the game vehicle has at the current moment; the first vehicle movement data includes the data transmission time.
[0038] In the exemplary embodiments of this disclosure, for game vehicles, the entire trajectory process is generally divided into three stages. The first stage is the normal stage (at which time the network does not fluctuate, and the terminal directly determines the vehicle speed and position of the game vehicle based on the first vehicle movement data sent by the server). The second stage is the prediction stage. In the prediction stage, the network usually fluctuates, causing the data transmission time corresponding to the first vehicle movement data received by the terminal to be greater than the terminal's current time. At this time, it is necessary to predict the vehicle speed and position of the game vehicle. The third stage is the transition stage, which is the transition from the prediction stage to the normal stage. When the transition stage ends, the vehicle position and speed of the game vehicle will be determined in the same way as in the normal stage. It is worth noting that in the transition stage, it is still necessary to predict the vehicle position and speed of the game vehicle.
[0039] Typically, the server sends the first vehicle movement data to the terminal evenly every second. Based on this, the terminal receives the first vehicle movement data sent by the server evenly every second. It's worth noting that the first vehicle movement data includes the data transmission time (i.e., the time the server sends the first vehicle movement data). The first vehicle movement data describes the actual trajectory of the game vehicle at a given moment.
[0040] The current time refers to the current time on the terminal side. Based on this, the second vehicle movement speed refers to the movement data of the game vehicle at the current time determined from the terminal side.
[0041] In this exemplary embodiment, receiving the first vehicle movement data corresponding to the game vehicle sent by the server and determining the second vehicle movement data that the game vehicle has at the current moment helps to subsequently calculate the first vehicle position and the second vehicle position, so as to predict the vehicle position of the game vehicle based on the first vehicle position and the second vehicle position.
[0042] In step S120, if the current time is greater than the data transmission time, the first vehicle movement data and the second vehicle movement data are calculated respectively to obtain the first vehicle position corresponding to the first target time and the second vehicle position corresponding to the current time; the first target time and the current time differ by a time interval.
[0043] In an exemplary embodiment of this disclosure, the data transmission time refers to the time when the first vehicle movement data is sent from the server. When the current time is greater than the data transmission time, it proves that the prediction stage is in progress. If the first vehicle movement data sent from the server to the terminal is still used as the vehicle speed and vehicle position of the game vehicle, it will cause the game vehicle to have an incorrect vehicle speed and incorrect vehicle position.
[0044] Therefore, when the current time is greater than the data transmission time, it is necessary to predict the vehicle speed and position of the game vehicle. This prediction involves calculating the first vehicle position P1 and the second vehicle position P2 based on the first and second vehicle movement data. The first vehicle position is the position of the game vehicle corresponding to the first target time, calculated using the first and second vehicle movement data. The second vehicle position is the position of the game vehicle at the current time, calculated using the first and second vehicle movement data. It is worth noting that the first target time differs from the current time by a time interval T. Δ The time interval refers to the time interval for predicting the location of a vehicle in the game.
[0045] For example, Figure 2 This illustration schematically depicts the data interaction process between the server and the terminal in an embodiment of this disclosure, such as... Figure 2 As shown, the server sends the first vehicle movement data D to the terminal at the data transmission time. The terminal receives the first vehicle movement data at the current time T and determines the second vehicle movement data on the terminal side at the current time T.
[0046] Then, based on the movement data of the first and second vehicles, the time (T+T) relative to the first target is obtained. Δ The first vehicle position P1 corresponding to the current time T and the second vehicle position P2 corresponding to the current time T.
[0047] In an optional embodiment, Figure 3 The diagram illustrates the process of obtaining the positions of the first and second vehicles in the trajectory prediction method. The first vehicle movement data includes multiple movement data points; adjacent movement data points differ by a transmission time interval; each movement data point includes movement speed, movement position, and movement time. The second vehicle movement data includes the current movement position corresponding to the current time, such as... Figure 3 As shown, the method includes at least the following steps: In step S310, a first target movement data is determined from multiple trajectory data, and a first movement speed, a first movement position, and a first movement time corresponding to the first target movement data are determined.
[0048] The first vehicle movement data may include multiple movement data points. For example, the first vehicle movement data may specifically include 10 movement data points, namely D1, D2, D3, D4, ..., D... 10 Each movement data point includes the movement speed, movement position, and movement time; that is, D1 includes the movement speed V1 and movement position P1, D2 includes the movement speed V2 and movement position P2, and so on. 10 This includes movement speed V 10 and move position P 10 The second vehicle movement data includes a current movement position P corresponding to the current time T.
[0049] The first target movement data refers to one of multiple movement data sets, and the transmission time of the first target movement data is closest to the current time. The movement speed included in the first target movement data is the first movement speed, the movement position included in the first target movement data is the first movement position, and the movement time included in the first target movement data is the first movement time. For example, a first target movement data set D is determined from multiple movement data sets. 10 , with the first target movement data D 10 The corresponding first moving speed is V 10 , with the first target movement data D 10 The corresponding first moving position is P 10 , with the first target movement data D 10 The corresponding first movement time is T 10 .
[0050] In step S320, a first calculation formula is determined between the first mixed speed, time interval, first target acceleration, current moving position and first vehicle position. Based on the first calculation formula, the first mixed speed, time interval, first target acceleration and current moving position are calculated to obtain the first vehicle position corresponding to the first target time. The first mixed speed is obtained based on the first moving speed and the second vehicle movement data, and the first target acceleration is obtained based on the second vehicle movement data.
[0051] The first calculation formula is used to calculate the position of the first vehicle. For example, the first calculation formula is shown in formula (1).
[0052]
[0053] Among them, V f For the first mixing speed, T Δ For the time interval, A n Let P be the first target acceleration, P be the current moving position, and P1 be the first vehicle position. It's worth noting that the first combined velocity is derived from the first moving velocity and the second vehicle movement data, while the first target acceleration is derived from the second vehicle movement data.
[0054] After determining the first calculation formula, it can be used to calculate the time T+T relative to the first target time. Δ The corresponding location of the first vehicle.
[0055] In step S330, a second calculation formula is determined between the first moving position, the first moving time, the first moving speed, the current time, the first target acceleration, and the second vehicle position. Based on the second calculation formula, the first moving position, the first moving time, the first moving speed, the current time, and the first target acceleration are calculated to obtain the second vehicle position corresponding to the current time.
[0056] The second calculation formula is used to calculate the position of the second vehicle. For example, the second calculation formula is shown in formula (2).
[0057]
[0058] Where P2 is the location of the second vehicle, P n For the first moving position, T n For the first movement moment, V n Let A be the first moving speed, T be the current time, and A be the first moving speed. n Acceleration for the primary objective.
[0059] After determining the second calculation formula, the position P2 of the second vehicle corresponding to the current time T can be calculated using the second calculation formula.
[0060] In this exemplary embodiment, the positions of the first vehicle and the second vehicle are calculated based on the first vehicle movement data and the second vehicle movement data, respectively. This helps to perform a combined calculation on the first vehicle position and the second vehicle position in the subsequent calculation, thereby improving the accuracy of the predicted vehicle position of the game vehicle.
[0061] In an optional embodiment, Figure 4 The flowchart illustrating the calculation of the first target acceleration in the trajectory prediction method is shown below. Figure 4 As shown, the method includes at least the following steps: in step S410, a second target movement data is determined from multiple movement speeds, and a second movement speed and a second movement time corresponding to the second target movement speed are determined; the second target movement data differs from the first target movement data by a transmission time interval.
[0062] The second target mobile data refers to one of multiple mobile data sets, and the second target mobile data differs from the first target mobile data by a transmission time interval, which refers to the transmission interval when the server sends mobile data.
[0063] The second movement speed is the movement speed corresponding to the second target movement data, and the second movement time is the movement time corresponding to the second target movement data. For example, the second target movement data is D. n-1 The second moving speed is V n-1 The second movement time is T. n-1 .
[0064] In step S420, a first acceleration calculation formula is determined among the first moving speed, the second moving speed, the first moving time, the second moving time, and the first target acceleration. Based on the first acceleration calculation formula, the first moving speed, the second moving speed, the first moving time, and the second moving time are calculated to obtain the first target acceleration.
[0065] The formula for calculating the first acceleration is used to calculate the acceleration of the first target. For example, the acceleration calculation formula is shown in formula (3).
[0066] A n =(V n -V n-1 ) / (T n -T n-1 (3)
[0067] Among them, V n V is the first moving speed. n-1 For the second moving speed, T n For the first movement moment, T n-1 For the second movement moment, An Acceleration for the primary objective.
[0068] After determining the formula for calculating the first acceleration, the first movement time T is... 10 Substituting T into formula (3) n Substitute the second moving time T9 into the T in formula (3) n-1 The first moving speed V 10 Substituting V into formula (3) n Substitute the second moving speed V9 into the V in formula (3) n-1 In order to obtain the first target acceleration.
[0069] In this exemplary embodiment, a first target acceleration is calculated using a first acceleration calculation formula, and the positions of the first and second vehicles are calculated based on the first target acceleration. This avoids the fact that the method of determining the vehicle position in the prior art is only applicable to uniform linear motion, thus expanding the application scenarios and improving the accuracy of the predicted vehicle position of the game vehicle.
[0070] In an optional embodiment, the second vehicle movement data also includes the current movement speed corresponding to the current moment, and the method further includes: determining a first movement speed, the current movement speed, a first mixing factor, and a first mixing speed calculation formula, and calculating the first movement speed, the current movement speed, and the first mixing factor based on the first mixing speed calculation formula to obtain the first mixing speed.
[0071] The formula for calculating the first mixed speed is used to calculate the first mixed speed, which refers to the vehicle speed that the game vehicle has at the first target moment during the prediction phase.
[0072] For example, the formula for calculating the first mixing velocity is shown in formula (4).
[0073] V f =V+(V n –V)F1(4)
[0074] Among them, V f V is the first mixing velocity. n V is the first moving speed, V is the current moving speed corresponding to the current time T included in the second vehicle moving data, and F1 is the first mixing factor. Specifically, the value range of F1 is [0, 1].
[0075] To improve the accuracy of the predicted vehicle speed at the first target moment, a first mixing factor is introduced to adjust the influence of the current movement speed and the first movement speed on the first mixed speed (i.e., the predicted vehicle speed).
[0076] After determining the formula for calculating the first mixing velocity, the first mixing velocity V is calculated using this formula. f .
[0077] In this exemplary embodiment, the first mixing speed calculation formula includes a first mixing factor. Based on the first mixing factor, the influence of the current moving speed and the first moving speed on the first mixing speed is adjusted to further improve the accuracy of the calculated first mixing speed.
[0078] In an optional embodiment, the method further includes: determining a first factor calculation formula between a first preset parameter, a time interval, and a first mixing factor, and calculating the first preset parameter and the time interval based on the first factor calculation formula to obtain the first mixing factor.
[0079] The formula for calculating the first factor is used to calculate the first mixing factor. It's worth noting that a first preset parameter and a time interval are introduced into the first factor calculation formula. The time interval is introduced to ensure that the first mixing factor is not affected by the terminal's calculation speed, and the first preset parameter is introduced to adjust the magnitude of the first factor.
[0080] For example, the formula for calculating the first factor is shown in formula (5).
[0081]
[0082] Where F1 is the first mixing factor, K1 is the first preset parameter, and the first preset parameter is usually set to 0.099. Δ For time intervals.
[0083] After determining the formula for calculating the first factor, the formula for calculating the first factor can be used to calculate the first mixing factor, and the first mixing factor can be substituted into formula (4) to calculate the first mixing speed, thereby predicting the vehicle speed of the game vehicle at the first target moment.
[0084] In this exemplary embodiment, a first preset parameter and a time interval are introduced into the first factor calculation formula, which makes the first hybrid factor not affected by the terminal's computing speed and can be flexibly adjusted, thereby predicting vehicle speed with higher accuracy.
[0085] In an optional embodiment, a mixed calculation is performed on the first vehicle position and the second vehicle position to predict the vehicle position of the game vehicle at the first target time, including: determining a first position prediction formula among the first vehicle position, the second vehicle position, the vehicle position and the first mixing factor; and calculating the first vehicle position, the second vehicle position and the first mixing factor based on the first position prediction formula to predict the vehicle position of the game vehicle at the first target time.
[0086] The first position prediction formula is used to predict the vehicle's position at the first target moment.
[0087] For example, the formula for predicting the first position is shown in formula (6).
[0088] P new1 =P1+(P2-P1)F1 (6)
[0089] Where F1 is the first mixing factor, P new1 P1 represents the predicted vehicle position at the first target moment, and P2 represents the second vehicle position.
[0090] After determining the first position prediction formula, the first vehicle position calculated using formula (1) and the second vehicle position calculated using formula (2) are substituted into formula (6) to obtain the vehicle position of the game vehicle at the first target time.
[0091] In this exemplary embodiment, the first position prediction formula includes a first mixing factor. The first mixing factor is used to adjust the first vehicle position corresponding to the first target time and the second vehicle position corresponding to the current time, so as to improve the accuracy of the predicted vehicle position of the game vehicle.
[0092] In an optional embodiment, Figure 5 The diagram illustrates the process of predicting the trajectory of a game vehicle under deceleration conditions, as shown in the trajectory prediction method. Figure 5 As shown, the method includes at least the following steps: In step S510, the predicted speed is obtained by calculating the first target acceleration, the time interval, and the first moving speed.
[0093] It is worth noting that the game vehicle may decelerate during its movement. Therefore, when the game vehicle decelerates, it is necessary to predict the vehicle's position according to steps S510 and S520.
[0094] Predicted speed refers to the speed that a game vehicle may have after a certain time interval. By predicting the speed, it can be determined whether the game vehicle is decelerating at this time.
[0095] For example, the predicted speed can be obtained by calculating the first moving speed, the first target acceleration, and the time interval according to formula (7).
[0096] Predicted speed = V n +A n T Δ (7)
[0097] Among them, V nAs the first moving speed, A n For the first target acceleration, T Δ For time intervals.
[0098] In step S520, a preset threshold corresponding to the predicted speed is determined. If the predicted speed is less than the preset threshold, the vehicle position at the first target moment is predicted as the current moving position.
[0099] The preset threshold refers to the value used to determine the direction of speed in the predicted speed. Generally, the preset threshold is 0. When the predicted speed is less than the preset threshold, it proves that the game vehicle is indeed decelerating. In this case, the predicted position of the game vehicle at the first target moment is the current moving position (that is, after decelerating, the game vehicle stops at the current moving position at the first target moment).
[0100] For example, if the preset threshold is 0, and the predicted speed is less than 0, then the predicted vehicle position at the first target moment is the current moving position P.
[0101] In this exemplary embodiment, a method is provided for predicting the position of a game vehicle at a first target moment when the game vehicle is decelerating. This improves the logic for predicting the position of the game vehicle, avoids predicting the wrong vehicle position when the game vehicle is decelerating, and improves the accuracy of the predicted vehicle position.
[0102] In an optional embodiment, Figure 6 The diagram illustrates the process of recovering from the prediction phase to the normal phase in a trajectory prediction method. Figure 6 As shown, the method includes at least the following steps: In step S610, if the data transmission time is greater than the current time, the first moving position is determined as the position of the third vehicle corresponding to the transition end time.
[0103] In this process, after predicting the vehicle's position at the first target time, if the data transmission time is later than the current time, it indicates that the game is in a transition phase (i.e., the network is no longer experiencing jitter and needs to gradually transition from the prediction phase to the normal phase). The transition end time is the time when the transition phase ends, and the game is fully restored to the normal phase. At this point, the first vehicle position in the first vehicle movement data received from the server can be directly used as the third vehicle position at the transition end time.
[0104] In step S620, the target vehicle position and the target first mixing velocity are determined, and the fourth vehicle position corresponding to the transition end time is obtained based on the target vehicle position and the target first mixing velocity; the target vehicle position and the target first mixing velocity both correspond to the second target time, which is the last first target time.
[0105] It is worth noting that there are multiple prediction moments in the prediction phase (i.e., multiple first target moments), and the second target moment refers to the last first target moment, which is the last prediction moment in the prediction phase.
[0106] The target vehicle position is the predicted position of the game vehicle at the second target time, and the target first mixed speed is the predicted speed of the game vehicle at the second target time.
[0107] Based on the target vehicle position and the target first mixing speed, the fourth vehicle position corresponding to the end of the transition can be calculated, so that the third and fourth vehicle positions can be mixed to obtain a more accurate vehicle position of the game vehicle at the current moment.
[0108] In step S630, the positions of the third and fourth vehicles are calculated together to predict the vehicle position of the game vehicle at the current moment.
[0109] After obtaining the positions of the third and fourth vehicles, it is necessary to perform a combined calculation on the positions of the third and fourth vehicles to predict the vehicle's position at the current moment during the transition phase.
[0110] For example, Figure 7 This diagram illustrates the interaction between the terminal and the server during the transition phase, as shown below. Figure 7 As shown, T e The timeframe is the moment during the prediction phase when the vehicle's position was last predicted (i.e., the second target moment). T e +T E The time is the end of the transition. Based on this, at T... e Time and T E Between points T and T, the vehicle positions at time T need to be predicted based on the positions of the third and fourth vehicles. Time T is the current time, which is within the range of T. e Time and T e +T E Between moments.
[0111] In this exemplary embodiment, a method for predicting the vehicle position of a game vehicle during a transition phase is provided, which improves the logic for determining the vehicle position of a game vehicle and further enhances the accuracy of the predicted vehicle position.
[0112] In an optional embodiment, Figure 8 The flowchart illustrating the trajectory prediction method for obtaining the position of the fourth vehicle corresponding to the current moment is shown, as follows: Figure 8As shown, the method includes at least the following steps: in step S810, determining the target first mixing speed, the first moving speed, the second mixing factor, and the second mixing speed calculation formula.
[0113] The second mixing speed calculation formula is used to calculate the second mixing speed, which is the vehicle speed of the game vehicle at the current moment predicted during the transition phase.
[0114] For example, the formula for calculating the second mixing velocity is shown in formula (8).
[0115] V f1 =V+(V n –V)F3 (8)
[0116] Among them, V f1 V is the second mixing velocity, and V is the target first mixing velocity. n Let F1 be the first moving speed and F2 be the second mixing factor. Based on this, the second mixing speed V can be calculated using formula (8). f1 The second mixing factor is used to adjust the effect of the target first mixing speed and the first moving speed on the second mixing speed, so as to improve the accuracy of the calculated second mixing speed.
[0117] In step S820, the formula for calculating the second acceleration between the first moving speed, the target first mixed speed, the first moving time, the current time, the time interval, and the second target acceleration is determined.
[0118] The second acceleration calculation formula is used to calculate the second target acceleration.
[0119] For example, the formula for calculating the second acceleration is shown in formula (9).
[0120] A n1 =(V n -V1) / (T n -T1+T Δ (9)
[0121] Among them, A n1 For the second objective acceleration, V n V1 is the first moving speed, and T is the target's first mixed speed. n For the first move time, T1-T Δ For the second target time, T Δ For time intervals.
[0122] Based on this, the acceleration A of the second target can be calculated using formula (9). n1 .
[0123] In step S830, a third calculation formula is determined between the second mixed velocity, the time interval, the second target acceleration, the target vehicle position, and the fourth vehicle position. Based on the second mixed velocity calculation formula, the second acceleration calculation formula, and the third calculation formula, the second mixed velocity, the time interval, the second target acceleration, and the target vehicle position are calculated to obtain the fourth vehicle position corresponding to the transition end time.
[0124] The third calculation formula is used to calculate the position of the fourth vehicle.
[0125] For example, the third calculation formula is shown in formula (10).
[0126]
[0127] Where P4 is the location of the fourth vehicle, P0 is the location of the target vehicle, and V f1 For the second mixing speed, T Δ For the time interval, A n1 The acceleration is the second target. Based on this, the position P4 of the fourth vehicle can be calculated using formula (10).
[0128] After calculating the second mixed velocity using formula (8) and the second target acceleration using formula (9), the second mixed velocity and the second target acceleration are substituted into formula (10) to calculate the position of the fourth vehicle.
[0129] In an optional embodiment, Figure 9 The flowchart illustrating the process of obtaining the second mixing factor in the trajectory prediction method is shown below. Figure 9 As shown, the method includes at least the following steps: In step S910, the calculation formula for the first transition factor between the time interval, the second preset parameter, and the first transition factor is determined.
[0130] The formula for calculating the first transition factor is used to calculate the first transition factor.
[0131] For example, the formula for calculating the first transition factor is shown in formula (11).
[0132]
[0133] Where F2 is the first transition factor, T Δ K2 is the time interval, and K2 is the second preset parameter, specifically, the second preset parameter is 0.2.
[0134] In step S920, the formula for calculating the second transition factor is determined among the current time, the preset transition duration, the second target time, and the second transition factor.
[0135] The preset transition duration refers to the pre-set duration used to transition from the prediction phase to the normal phase. Specifically, the preset transition duration can be represented by T. E express.
[0136] The formula for calculating the second transition factor is used to calculate the second transition factor. For example, the formula for calculating the second transition factor is shown in formula (12).
[0137]
[0138] Where F3 is the second transition factor, T is the current time, and T e For the second target time, T E The preset transition time is 1.2.
[0139] Based on this, the value of the second transition factor can be calculated using formula (12).
[0140] In step S930, the formula for calculating the second mixing factor, the first transition factor, and the second mixing factor among the second transition factor is determined.
[0141] The formula for calculating the second mixing factor is used to calculate the second mixing factor.
[0142] For example, the formula for calculating the second mixing factor is shown in formula (13).
[0143] F4=F2+(F3-F2)×F3(13)
[0144] Among them, F2 is the first transition factor, F3 is the second transition factor, and F4 is the second hybrid factor, which are used to control the third and fourth vehicle positions and the degree of influence on the predicted vehicle positions of the game vehicles during the transition phase.
[0145] In step S940, based on the first transition factor calculation formula, the second transition factor calculation formula, and the second mixed factor calculation formula, the first transition factor, the current time, the preset transition duration, and the second target time are calculated to obtain the second mixed factor.
[0146] The value of the second transition factor can be calculated using formulas (11), (12), and (13).
[0147] In this exemplary embodiment, on the one hand, a time interval is introduced into the first transition factor to ensure that the second hybrid factor calculated subsequently is not affected by the terminal's computing speed; on the other hand, a preset transition duration is introduced into the second transition factor to improve the accuracy of the vehicle position predicted at that time.
[0148] In an optional embodiment, the third vehicle position and the fourth vehicle position are mixed and calculated to predict the vehicle position of the game vehicle at the current moment, including: determining a second position prediction formula between the third vehicle position, the fourth vehicle position, the vehicle position and the second mixing factor; and calculating the third vehicle position, the fourth vehicle position and the second mixing factor based on the second position prediction formula to predict the vehicle position of the game vehicle at the current moment.
[0149] The second position prediction formula is a formula for predicting the vehicle position of the game vehicle during the transition phase.
[0150] For example, the second position prediction formula is shown in formula (14).
[0151] P newa =P3+(P4-P3)F4 (14)
[0152] Among them, P newa To predict the vehicle position during the transition phase, P3 is the third position data, P4 is the fourth position data, and F4 is the second mixing factor.
[0153] In this exemplary embodiment, a second mixing factor is introduced into the second position prediction formula. Based on this, the influence of the third vehicle position and the fourth vehicle position on the predicted vehicle position in the transition phase can be adjusted by adjusting the second mixing factor, so as to recover from the prediction phase to the normal phase more quickly and smoothly.
[0154] In the methods and apparatus provided in the exemplary embodiments of this disclosure, the predicted vehicle position is obtained by mixing a first vehicle position and a second vehicle position. The first vehicle position and the second vehicle position are calculated by processing first vehicle movement data and second vehicle movement data. By mixing the first vehicle position and the second vehicle position, the accuracy of the predicted vehicle position is increased.
[0155] The trajectory prediction method in this embodiment will be described in detail below with reference to an application scenario.
[0156] Receive the first vehicle movement data of the game vehicle "scooter" sent by the server. Determine the second vehicle movement data of the game vehicle "scooter" corresponding to the current time T.
[0157] Determine the data transmission time T when the first vehicle movement data is sent from the server. n If the current time T is greater than the data transmission time T n If this is true, it proves that we are in the prediction stage, and we need to predict the vehicle speed and position of the game vehicle at the first target moment.
[0158] Among them, by calculating the movement data of the first vehicle and the movement data of the second vehicle, the position of the first vehicle P1 of the game vehicle "scooter" at the first target time and the position of the second vehicle P2 of the game vehicle "scooter" at the current time can be obtained; by using formula (6) to calculate the position of the first vehicle P1 and the position of the second vehicle P2, the position of the game vehicle "scooter" at the first target time can be predicted.
[0159] In this application scenario, the predicted vehicle position is obtained by mixing the first vehicle position and the second vehicle position. The first vehicle position and the second vehicle position are calculated by processing the first vehicle movement data and the second vehicle movement data. By mixing the first vehicle position and the second vehicle position, the accuracy of the predicted vehicle position is increased.
[0160] Furthermore, in an exemplary embodiment of this disclosure, a trajectory prediction apparatus is also provided. Figure 10 A schematic diagram of the trajectory prediction device is shown, as follows: Figure 10 As shown, the trajectory prediction device 1000 may include: a determination module 1010, a calculation module 1020, and a prediction module 1030. Wherein:
[0161] The determining module 1010 is configured to receive first vehicle movement data corresponding to the game vehicle sent by the server, and determine the second vehicle movement data that the game vehicle has at the current time; the first vehicle movement data includes the data transmission time; the calculation module 1020 is configured to calculate the first vehicle movement data and the second vehicle movement data respectively if the current time is greater than the data transmission time, to obtain the first vehicle position corresponding to the first target time and the second vehicle position corresponding to the current time; the first target time and the current time differ by a time interval; the prediction module 1030 is configured to perform a mixed calculation on the first vehicle position and the second vehicle position to predict the vehicle position of the game vehicle at the first target time.
[0162] The specific details of the trajectory prediction device 1000 have been described in detail in the corresponding trajectory prediction method, so they will not be repeated here.
[0163] It should be noted that although several modules or units of the trajectory prediction device 1000 are mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0164] Furthermore, in an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.
[0165] The following reference Figure 11 To describe an electronic device 1100 according to such an embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0166] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110), and a display unit 1140.
[0167] The storage unit stores program code that can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.
[0168] Storage unit 1120 may include readable media in the form of volatile storage units, such as random access memory (RAM) 1121 and / or cache memory 1122, and may further include read-only memory (ROM) 1123.
[0169] Storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may contain the reality of the network environment.
[0170] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0171] Electronic device 1100 can also communicate with one or more external devices 1170 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 1100, and / or with any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0172] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0173] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section above.
[0174] refer to Figure 12 As shown, a program product 1200 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0175] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable 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 devices, magnetic storage devices, or any suitable combination thereof.
[0176] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0177] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0178] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0179] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
Claims
1. A trajectory prediction method, characterized in that, The method includes: The system receives first vehicle movement data corresponding to a game vehicle from the server and determines second vehicle movement data of the game vehicle at the current moment. The first vehicle movement data includes the data transmission time and includes multiple movement data. Adjacent movement data are separated by a transmission time interval. Each movement data includes movement speed, movement position, and movement time. The second vehicle movement data includes the current movement position corresponding to the current moment. If the current time is greater than the data transmission time, a first target mobile data is determined from the plurality of mobile data, and a first mobile speed, a first mobile position, and a first mobile time corresponding to the first target mobile data are determined. A first calculation formula is determined between the first mixed velocity, the time interval, the first target acceleration, the current moving position, and the first vehicle position. Based on the first calculation formula, the first mixed velocity, the time interval, the first target acceleration, and the current moving position are calculated to obtain the first vehicle position corresponding to the first target time. The first mixed velocity is obtained based on the first moving velocity and the second vehicle movement data, and the first target acceleration is obtained based on the second vehicle movement data. The first target time differs from the current time by a time interval. A second calculation formula is determined between the first moving position, the first moving time, the first moving speed, the current time, the first target acceleration, and the second vehicle position. Based on the second calculation formula, the first moving position, the first moving time, the first moving speed, the current time, and the first target acceleration are calculated to obtain the second vehicle position corresponding to the current time. The positions of the first vehicle and the second vehicle are combined for calculation to predict the vehicle position of the game vehicle at the first target time.
2. The trajectory prediction method according to claim 1, characterized in that, The method further includes: A second target movement data is determined from the plurality of movement data, and a second movement speed and a second movement time corresponding to the second target movement data are determined; the second target movement data differs from the first target movement data by a transmission time interval; A first acceleration calculation formula is determined among the first moving speed, the second moving speed, the first moving time, the second moving time, and the first target acceleration. Based on the first acceleration calculation formula, the first target acceleration is calculated from the first moving speed, the second moving speed, the first moving time, and the second moving time.
3. The trajectory prediction method according to claim 1, characterized in that, The second vehicle movement data also includes the current movement speed corresponding to the current moment; The method further includes: A first mixing speed calculation formula is determined among the first moving speed, the current moving speed, the first mixing factor, and the first mixing speed. Based on the first mixing speed calculation formula, the first moving speed, the current moving speed, and the first mixing factor are calculated to obtain the first mixing speed.
4. The trajectory prediction method according to claim 3, characterized in that, The method further includes: A first factor calculation formula is determined among the first preset parameter, the time interval, and the first mixing factor. Based on the first factor calculation formula, the first preset parameter and the time interval are calculated to obtain the first mixing factor.
5. The trajectory prediction method according to claim 3, characterized in that, The step of performing a combined calculation on the positions of the first vehicle and the second vehicle to predict the vehicle's position at the first target time includes: A first position prediction formula is determined among the first vehicle position, the second vehicle position, the vehicle position, and the first mixing factor. Based on the first position prediction formula, the first vehicle position, the second vehicle position, and the first mixing factor are calculated to predict the vehicle position of the game vehicle at the first target time.
6. The trajectory prediction method according to claim 1, characterized in that, The method further includes: The predicted velocity is calculated based on the first target acceleration, the time interval, and the first moving speed. A preset threshold corresponding to the predicted speed is determined. If the predicted speed is less than the preset threshold, the vehicle position at the first target time is predicted as the current moving position.
7. The trajectory prediction method according to claim 1, characterized in that, After predicting the vehicle's position at the first target time, the method further includes: If the data transmission time is greater than the current time, the first moving position is determined as the position of the third vehicle corresponding to the transition end time; The target vehicle position and the target first mixing velocity are determined, and based on the target vehicle position and the target first mixing velocity, the fourth vehicle position corresponding to the transition end time is obtained; both the target vehicle position and the target first mixing velocity correspond to a second target time, which is the last first target time; The positions of the third and fourth vehicles are combined for calculation to predict the vehicle position of the game vehicle at the current moment.
8. The trajectory prediction method according to claim 7, characterized in that, The step of obtaining the fourth vehicle position corresponding to the transition end time based on the target vehicle position and the target first mixing velocity includes: Determine the target first mixing speed, the first moving speed, the second mixing factor, and the second mixing speed calculation formula; A second acceleration calculation formula is determined among the first moving speed, the first target mixed speed, the first moving moment, the current moment, the time interval, and the second target acceleration; A third calculation formula is determined between the second mixing velocity, the time interval, the second target acceleration, the target vehicle position, and the fourth vehicle position. Based on the second mixing velocity calculation formula, the second acceleration calculation formula, and the third calculation formula, the second mixing velocity, the time interval, the second target acceleration, and the target vehicle position are calculated to obtain the fourth vehicle position corresponding to the transition end time.
9. The trajectory prediction method according to claim 8, characterized in that, The method further includes: Determine the formula for calculating the first transition factor among the time interval, the second preset parameter, and the first transition factor; Determine the formula for calculating the second transition factor among the current time, the preset transition duration, the second target time, and the second transition factor; Determine the formula for calculating the second mixture factor among the second mixture factor, the first transition factor, and the second mixture factor; Based on the first transition factor calculation formula, the second transition factor calculation formula, and the second hybrid factor calculation formula, the first transition factor, the current time, the preset transition duration, and the second target time are calculated to obtain the second hybrid factor.
10. The trajectory prediction method according to claim 8, characterized in that, The step of performing a combined calculation on the positions of the third and fourth vehicles to predict the vehicle's position at the current moment includes: A second position prediction formula is determined among the third vehicle position, the fourth vehicle position, the vehicle position, and the second mixing factor. Based on the second position prediction formula, the third vehicle position, the fourth vehicle position, and the second mixing factor are calculated to predict the vehicle position of the game vehicle at the current time.
11. A trajectory prediction device, characterized in that, include: The determination module is configured to receive first vehicle movement data corresponding to a game vehicle sent by the server, and determine second vehicle movement data of the game vehicle at the current moment; the first vehicle movement data includes the data transmission time; the first vehicle movement data includes multiple movement data; adjacent movement data are separated by a transmission time interval; each movement data includes movement speed, movement position, and movement time; the second vehicle movement data includes the current movement position corresponding to the current moment; The calculation module is configured to, if the current time is greater than the data transmission time, determine a first target moving data among the plurality of moving data, and determine a first moving speed, a first moving position and a first moving time corresponding to the first target moving data; A first calculation formula is determined between the first mixing velocity, the time interval, the first target acceleration, the current moving position, and the first vehicle position. Based on the first calculation formula, the first mixing velocity, the time interval, the first target acceleration, and the current moving position are calculated to obtain the first vehicle position corresponding to the first target time. The first mixed speed is obtained based on the first moving speed and the second vehicle moving data, and the first target acceleration is obtained based on the second vehicle moving data; the first target time differs from the current time by a time interval; a second calculation formula is determined between the first moving position, the first moving time, the first moving speed, the current time, the first target acceleration, and the second vehicle position, and based on the second calculation formula, the first moving position, the first moving time, the first moving speed, the current time, and the first target acceleration are calculated to obtain the second vehicle position corresponding to the current time; The prediction module is configured to perform a mixed calculation on the first vehicle position and the second vehicle position to predict the vehicle position of the game vehicle at the first target time.
12. An electronic device, characterized in that, include: processor; Memory for storing the executable instructions of the processor; The processor is configured to execute the trajectory prediction method of any one of claims 1-10 by executing the executable instructions.
13. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the trajectory prediction method according to any one of claims 1-10.