Method for acquiring running state of vehicle, electronic equipment and storage medium
By acquiring and analyzing the vehicle data set reported by GPS, combined with the prediction of the random forest model, the problem of inaccurate acquisition of vehicle operating status in the prior art is solved, and higher accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202510088563.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, when the vehicle speed at a target time is obtained through GPS, it is difficult to accurately determine the operating status of the vehicle due to the time interval and position information spacing of data reported by GPS twice, especially when the vehicle is slow or stops after driving rapidly.
The GPS report data set of the target vehicle is obtained and the vehicle operating status is determined based on the vehicle speed and GPS coordinates. When the vehicle speed is not less than the preset value, it is determined to be the driving state; otherwise, a key vehicle data set is obtained, input it into a random forest model, and the vehicle state is determined by predicting the vehicle running state mark.
The accuracy of obtaining the vehicle's operating status is improved. Regardless of the time interval between the two adjacent data reported by GPS, the vehicle's operating status can be accurately determined, improving the accuracy of obtaining the vehicle's operating status.
Smart Images

Figure CN119920027A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for obtaining a vehicle operating status, an electronic device and a storage medium. Background Art
[0002] When the vehicle's operating state at a certain point in time is a parking state, obtaining the vehicle's driving trajectory is helpful for the user to determine the reason for the vehicle's parking according to the vehicle's driving trajectory, for example: since the traffic light in the straight direction is red, it is necessary to stop and wait to go straight; since the traffic light in the left turn direction is red, it is necessary to stop and wait to turn left; since there is a traffic jam on the lane in the straight direction, it is necessary to stop and wait; the user can adjust the cycle, green signal ratio and other parameters of the traffic lights in the road where the vehicle is located when the vehicle's operating state is a parking state according to the reason for the vehicle's parking, so as to improve the road's traffic efficiency.
[0003] In the prior art, the method for determining the vehicle operating status of a vehicle at a target time point mainly relies on a GPS installed in the vehicle, and the speed of the target vehicle at the target time point is obtained based on the position information reported by the GPS at the target time point and the position information reported before the target time point, and the vehicle operating status of the target vehicle at the target time point is determined based on the speed of the target vehicle at the target time point.
[0004] However, the above method also has the following technical problems:
[0005] The vehicle's speed at the target time point is affected by the time interval between two adjacent time points when GPS reports data and the distance between the location information reported by GPS at the target time point and the location information reported before the target time point. When the time interval between two adjacent time points when GPS reports data is long, the distance between the location information reported by GPS at the target time point and the location information reported before the target time point is also long. There is a situation where the vehicle slows down or drives quickly and then stops during the period between two adjacent time points when GPS reports data. In the above situations, the vehicle's speed at the target time point is a lower speed, and the vehicle's operating status at the target time point cannot be determined based on the speed. Summary of the invention
[0006] In view of the above technical problems, the technical solution adopted by the present invention is:
[0007] According to a first aspect of the present invention, a method for obtaining a vehicle running state is provided, the method comprising the following steps:
[0008] S1. Obtain a target vehicle data set A={A1, A2, A3} reported by the GPS of the target vehicle, where A1 is the target time point, A2 is the speed of the target vehicle at A1, and A3 is the GPS coordinates of the target vehicle at A1.
[0009] S2, when A2 ≥ A 0 When A1 is determined, the vehicle running state of the target vehicle is the driving state; when A2<A 0 When the key vehicle data set B corresponding to the target vehicle is obtained, B = {B1, B2, B3, B4}, B1 = {B 11 , B 12 , ..., B 1i , ..., B 1m}, A 0 is the preset speed, B1 is the key speed list corresponding to the target vehicle, B 1i is the i-th key speed corresponding to the target vehicle, i ranges from 1 to m, m is the number of key speeds corresponding to the target vehicle and is an odd number, B2 is the limited speed corresponding to the target road, B3 is the urban road grade corresponding to the target road, B4 is the time period identifier corresponding to A1, wherein the target road is the road where the target vehicle is located determined according to A3, and the limited speed corresponding to the target road is the maximum speed at which the vehicle is allowed to travel on the target road.
[0010] S3, B 11 , B 12 , ..., B 1i , ..., B 1m , B2, B3, B4 are all input into the target random forest model to obtain the predicted vehicle running state identification list C = {C1, C2, ..., C j , ..., C n}, where C j is the predicted vehicle running state identifier output by the jth decision tree in the target random forest model, the value of j ranges from 1 to n, n is the number of decision trees in the target random forest model, and the predicted vehicle running state identifier includes identifier "0" and identifier "1", identifier "0" indicates that the vehicle running state of the target vehicle is a parking state, and identifier "1" indicates that the vehicle running state of the target vehicle is a driving state.
[0011] S4. When D / n≥D 0 When D / n<D 0 When A1 is determined, the target vehicle's vehicle operation state is the driving state, and D is C1, C2, ..., C j , ..., C n The number of "0" in D 0 is the preset ratio.
[0012] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the aforementioned method.
[0013] According to a third aspect of the present invention, there is provided an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned method when executing the computer program.
[0014] The present invention has at least the following beneficial effects:
[0015] The present invention provides a method for obtaining a vehicle running state, an electronic device and a storage medium. The method can obtain a target vehicle data set reported by a GPS of a target vehicle. The target vehicle data set includes a target time point, a speed of the target vehicle at the target time point and a GPS coordinate of the target vehicle at the target time point. When the speed of the target vehicle is not less than a preset speed, it is determined that the vehicle running state of the target vehicle at the target time point is a driving state. Otherwise, a key vehicle data set corresponding to the target vehicle is obtained, and data in the key vehicle data set is input into a target random forest model to obtain a predicted vehicle running state identifier. When the ratio of the number of predicted vehicle running state identifiers with an identifier of "0" to the number of all predicted vehicle running state identifiers is not less than a preset ratio, it is determined that the vehicle running state of the target vehicle at the target time point is a parking state. Otherwise, it is determined that the vehicle running state of the target vehicle at the target time point is a driving state. It can be seen that no matter how much the time interval between two adjacent time points of the GPS of the target vehicle reporting data is, the key vehicle data set can be obtained according to the target vehicle data set, and the vehicle running state of the target vehicle at the target time point is further determined, which is conducive to improving the accuracy of obtaining the vehicle running state of the target vehicle at the target time point. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 A flowchart of a method for obtaining a vehicle operating status provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar tasks, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0020] An embodiment of the present invention provides a method for obtaining a vehicle running state, the method comprising the following steps: Figure 1 As shown:
[0021] S1. Obtain a target vehicle data set A={A1, A2, A3} reported by the GPS of the target vehicle, where A1 is the target time point, A2 is the speed of the target vehicle at A1, and A3 is the GPS coordinates of the target vehicle at A1, wherein the target time point is a target vehicle data reporting time point determined by a technician in this field according to actual needs from a number of target vehicle data reporting time points, and the target vehicle data reporting time point is the time point of the GPS reporting data of the target vehicle.
[0022] S2, when A2 ≥ A 0 When A1 is determined, the vehicle running state of the target vehicle is the driving state; when A2<A 0 When the key vehicle data set B corresponding to the target vehicle is obtained, B = {B1, B2, B3, B4}, B1 = {B 11 , B 12 , ..., B 1i , ..., B 1m}, A 0 is the preset speed, B1 is the key speed list corresponding to the target vehicle, B 1iis the i-th key speed corresponding to the target vehicle, i ranges from 1 to m, m is the number of key speeds corresponding to the target vehicle and is an odd number, B2 is the limited speed corresponding to the target road, B3 is the urban road grade corresponding to the target road, and B4 is the time period identifier corresponding to A1, wherein the target road is the road where the target vehicle is located determined according to A3, which can be understood as: a road with a specific length obtained by processing A3 according to preset rules, and the limited speed corresponding to the target road is the maximum speed at which the vehicle is allowed to travel on the target road, for example: the speed limit of the target road is 60km / h, then the limited speed corresponding to the target road is 60km / h. Those skilled in the art know that any method in the prior art for determining the road where the target vehicle is located according to the GPS coordinates of the target vehicle belongs to the protection scope of the present invention, such as map matching method, which will not be repeated here.
[0023] Specifically, the urban road grades include: expressways, trunk roads, secondary trunk roads and branch roads. Those skilled in the art know that any method of obtaining the urban road grade of a road in the prior art falls within the protection scope of the present invention and will not be described in detail here.
[0024] Specifically, the time period identifier includes an identifier "a" and an identifier "b", wherein the identifier "a" indicates that the target time point is in a peak time period, and the identifier "b" indicates that the target time point is in a flat time period.
[0025] Specifically, step S2 includes the following steps to obtain B 1i :
[0026] When i = (m-1) / 2, A2 is used as B 1i ;
[0027] When i<(m-1) / 2, A1-△t i The speed of the target vehicle is taken as B 1i , where △t i For B 1i The corresponding preset time interval is a time interval preset by those skilled in the art according to actual needs, which will not be described in detail here;
[0028] When i>(m-1) / 2, A1+△t i The speed of the target vehicle is taken as B 1i .
[0029] Optionally, m=7.
[0030] Specifically, step S2 also includes the following steps to obtain B4:
[0031] When A1∈D1, B4 is determined to be the identifier "a", where D1 is the preset peak time period;
[0032] When A1∈D2, B4 is determined to be labeled "b", wherein D2 is a preset off-peak time period. The preset peak time period and the preset off-peak time period are time periods pre-set by technicians in this field according to actual needs, and will not be repeated here.
[0033] S3, B 11 , B 12 , ..., B 1i , ..., B 1m , B2, B3, B4 are all input into the target random forest model to obtain the predicted vehicle running state identification list C = {C1, C2, ..., C j , ..., C n}, where C j It is the predicted vehicle operating status identifier output by the jth decision tree in the target random forest model, where j ranges from 1 to n, and n is the number of decision trees in the target random forest model. Those skilled in the art know that the target random forest model is a random forest model trained by those skilled in the art according to actual needs, and will not be described in detail here.
[0034] Specifically, the predicted vehicle running state identifier includes an identifier "0" and an identifier "1", wherein the identifier "0" indicates that the vehicle running state of the target vehicle is a parking state, and the identifier "1" indicates that the vehicle running state of the target vehicle is a driving state.
[0035] S4. When D / n≥D 0 When D / n<D 0 When A1 is determined, the target vehicle's vehicle operation state is the driving state, and D is C1, C2, ..., C j , ..., C n The number of "0" in D 0 is the preset ratio.
[0036] Specifically, D 0 The value range of D is (0, 1], where the technicians in this field know that the technicians in this field can determine D from (0, 1] according to actual needs. 0 The specific value of is not described here.
[0037] Through the above steps, the target vehicle data set reported by the GPS of the target vehicle is obtained. The target vehicle data set includes the target time point, the speed of the target vehicle at the target time point and the GPS coordinates of the target vehicle at the target time point. When the speed of the target vehicle is not less than the preset speed, it is determined that the vehicle running state of the target vehicle at the target time point is the driving state. Otherwise, the key vehicle data set corresponding to the target vehicle is obtained, and the data in the key vehicle data set is input into the target random forest model to obtain the predicted vehicle running state. When the ratio of the number of predicted vehicle running states marked "0" to the number of all predicted vehicle running states is not less than the preset ratio, it is determined that the vehicle running state of the target vehicle at the target time point is the parking state. Otherwise, it is determined that the vehicle running state of the target vehicle at the target time point is the driving state. It can be seen that no matter how much the time interval between the two adjacent time points of the GPS reporting data of the target vehicle is, the key vehicle data set can be obtained according to the target vehicle data set, and the vehicle running state of the target vehicle at the target time point is further determined, which is conducive to improving the accuracy of obtaining the vehicle running state of the target vehicle at the target time point.
[0038] Specifically, in a specific embodiment, A 0 Meet the following conditions:
[0039] A 0 =V×(1-α×(E / (L×B2))-β×F-γ×G), wherein V is the average vehicle speed corresponding to the target road within the preset time period, α is the first preset vehicle speed adjustment weight, E is the traffic volume of the target road at A1, L is the number of lanes in the target road, β is the second preset vehicle speed adjustment weight, F is the identification weight corresponding to B4, γ is the third preset vehicle speed adjustment weight, and G is the preset environmental impact weight. Those skilled in the art know that the first preset vehicle speed adjustment weight, the second preset vehicle speed adjustment weight, and the third preset vehicle speed adjustment weight are set by those skilled in the art according to actual needs and will not be repeated here.
[0040] Specifically, the value range of G is [0, 1]. The larger G is, the more unfavorable the environment of the target road is for the target vehicle to pass. Those skilled in the art know that those skilled in the art can determine the specific value of G from [0, 1] according to actual needs, which will not be repeated here.
[0041] Specifically, the starting time point of the preset time point is the time point obtained by subtracting the preset duration from A1, the end time point of the preset time period is A1, and the preset duration is the duration pre-set by technical personnel in this field according to actual needs, which will not be repeated here.
[0042] Specifically, when B4 is identified as "a", it is determined that F=1; when B4 is identified as "b", it is determined that F=0.
[0043] Through the above steps, the preset vehicle speed is obtained according to the relevant data of the target road, which is conducive to improving the accuracy of obtaining the preset vehicle speed. When the speed of the target vehicle is not less than the preset speed, the vehicle operating state of the target vehicle at the target time point is determined to be the driving state. Otherwise, the key vehicle data set corresponding to the target vehicle is obtained, and the data in the key vehicle data set is input into the target random forest model to obtain the predicted vehicle operating state. When the ratio of the number of predicted vehicle operating states marked "0" to the number of all predicted vehicle operating states is not less than the preset ratio, the vehicle operating state of the target vehicle at the target time point is determined to be the parking state. Otherwise, the vehicle operating state of the target vehicle at the target time point is determined to be the driving state, which is conducive to improving the accuracy of obtaining the vehicle operating state of the target vehicle at the target time point.
[0044] An embodiment of the present invention further provides a method for obtaining a vehicle driving trajectory, the method being used to obtain a vehicle driving trajectory of a target vehicle whose vehicle running state is a parking state. The method is different from the above embodiment in that after step S4, the method further includes the following steps:
[0045] S10. If the vehicle operating state of the target vehicle is a parked state at the target time point, the designated driving distance corresponding to the target vehicle is obtained according to the average vehicle speed of the target vehicle in the designated time period and the length of the designated time period. The starting time point of the designated time period is the time point obtained by subtracting the first preset designated time length from the target time point, and the ending time point of the designated time period is the time point obtained by adding the first preset designated time length to the target time point. Those skilled in the art know that the first preset designated time length is a time length pre-set by those skilled in the art according to actual needs, and will not be repeated here.
[0046] Specifically, if the vehicle operating state of the target vehicle at the target time point is a driving state, the vehicle driving trajectory of the target vehicle is not obtained.
[0047] Specifically, step S10 includes the following steps:
[0048] When the product of the average speed of the target vehicle in the specified time period and the length of the specified time period is greater than the road length of the target road, the product of the average speed of the target vehicle in the specified time period and the length of the specified time period is used as the designated driving distance corresponding to the target vehicle.
[0049] When the product of the average speed of the target vehicle within the specified time period and the length of the specified time period is not greater than the road length of the target road, the specified time period is updated and the specified driving distance corresponding to the target vehicle is obtained according to the average speed of the target vehicle within the specified time period and the length of the specified time period. The starting time point of the updated specified time period is the time point obtained by subtracting the second preset specified time length from the starting time point of the specified time period before the update. The end time point of the updated specified time period is the time point obtained by adding the second preset specified time length to the end time point of the specified time period before the update. The second preset specified time length is 0.8 times the first preset specified time length.
[0050] S20. Obtain the number of initial trajectory points according to the specified driving distance and the original interval distance. The number of initial trajectory points is the quotient obtained by dividing the specified driving distance by the original interval distance. The original interval distance is the quotient obtained by dividing the product of the average speed of the target vehicle in the specified time period and the time interval between two adjacent time points of the target vehicle's GPS reporting data by the unit conversion coefficient corresponding to the average speed of the target vehicle. The unit of measurement of the time interval between two adjacent time points of the target vehicle's GPS reporting data is seconds.
[0051] Specifically, if the unit of measurement of the average speed of the target vehicle is kilometers per hour, the unit conversion coefficient corresponding to the average speed of the target vehicle is determined to be 3.6; if the unit of measurement of the average speed of the target vehicle is meters per second, the unit conversion coefficient corresponding to the average speed of the target vehicle is determined to be 1.
[0052] Specifically, the unit conversion coefficient corresponding to the average speed of the target vehicle can be understood as: the value that needs to be divided to convert the unit of measurement of the average speed of the target vehicle into the unit of measurement corresponding to the time interval between two consecutive time points of the target vehicle's GPS reporting data. Since the unit of measurement of the time interval between two consecutive time points of the target vehicle's GPS reporting data is seconds, the unit conversion coefficient corresponding to the average speed of the target vehicle can also be understood as: the value that needs to be divided to convert the unit of measurement of the average speed of the target vehicle into meters per second. Since 1 meter per second is equal to 3.6 kilometers per hour, when the unit of measurement of the average speed of the target vehicle is kilometers per hour, the unit conversion coefficient corresponding to the average speed of the target vehicle is determined to be 3.6. When the unit of measurement of the average speed of the target vehicle is meters per second, the unit conversion coefficient corresponding to the average speed of the target vehicle is determined to be 1. Examples are as follows:
[0053] If the average speed of the target vehicle in the specified time period is 36 kilometers per hour, and the time interval between two consecutive GPS data reporting points of the target vehicle is 10 seconds, then according to the above “the original interval distance is the quotient obtained by dividing the product of the average speed of the target vehicle in the specified time period and the time interval between two consecutive GPS data reporting points of the target vehicle by the conversion coefficient of the measurement unit corresponding to the average speed of the target vehicle”, at this time, the original interval distance is (36×10 / 3.6) meters, that is, the original interval distance is 100 meters;
[0054] If the average speed of the target vehicle in the specified time period is 10 meters per second, and the time interval between two consecutive time points when the GPS of the target vehicle reports data is 10 seconds, then according to the above "the original interval distance is the quotient obtained by dividing the product of the average speed of the target vehicle in the specified time period and the time interval between two consecutive time points when the GPS of the target vehicle reports data by the measurement unit conversion coefficient corresponding to the average speed of the target vehicle", it can be known that at this time, the original interval distance is (10×10 / 1) meters, that is, the original interval distance is 100 meters.
[0055] S30. When the number of initial trajectory points is greater than the preset number of trajectory points, the initial number of trajectory points is used as the target number of trajectory points. When the number of initial trajectory points is not greater than the preset number of trajectory points, the target number of trajectory points is obtained according to the specified driving distance and the preset number of trajectory points. It is known to those skilled in the art that the preset number of trajectory points is the number of trajectory points pre-set by those skilled in the art according to actual needs, which will not be described in detail herein.
[0056] Specifically, when the number of initial track points is not greater than the preset number of track points, the step of obtaining the target number of track points according to the specified driving distance and the preset number of track points includes the following steps:
[0057] S31. Obtain a specified interval distance, where the specified interval distance is a quotient obtained by dividing a specified driving distance by a preset number of track points.
[0058] S32. Acquire a critical road distance, where the critical road distance is the road distance between the center point of a target road intersection and the position corresponding to the GPS coordinates of the target vehicle at a target time point in the target road. The target road intersection is the road intersection where the target vehicle enters the target road.
[0059] S33. When the quotient obtained by dividing the key road distance by the specified interval distance is an integer, the preset number of trajectory points is used as the target number of trajectory points; when the quotient obtained by dividing the key road distance by the specified interval distance is not an integer, the sum of the integer part of the quotient obtained by dividing the key road distance by the specified interval distance and 1 is used as the number of intermediate trajectory points.
[0060] S34. Divide the critical road distance by the number of intermediate trajectory points to obtain a quotient as the intermediate interval distance.
[0061] S35. When the quotient obtained by dividing the specified driving distance by the intermediate interval distance is an integer, the quotient obtained by dividing the specified driving distance by the intermediate interval distance is used as the number of target trajectory points. When the quotient obtained by dividing the specified driving distance by the intermediate interval distance is not an integer, the sum obtained by adding the integer part of the quotient obtained by dividing the specified driving distance by the intermediate interval distance and 1 is used as the number of target trajectory points.
[0062] In the prior art, the method for obtaining the vehicle driving trajectory of a vehicle whose vehicle running state is a parking state mainly relies on the GPS set in the vehicle, obtains the vehicle position information reported by the GPS within a preset time period, and generates the vehicle driving trajectory according to the vehicle position information. However, in the process of generating the vehicle driving trajectory according to the vehicle position information, a certain amount of vehicle position information is required. When the amount of vehicle position information is small, the accuracy of the generated vehicle driving trajectory is low. When the amount of vehicle position information is large, there is a lot of meaningless vehicle position information, which reduces the efficiency of generating the vehicle driving trajectory. In the above method, the vehicle position information reported by the GPS within a preset time period is obtained, and the vehicle driving trajectory is generated according to the vehicle position information. The duration of the preset time period is a manually preset duration, which cannot be adjusted according to the time interval between two adjacent GPS data reports. Therefore, when the time interval between two adjacent GPS data reports is long, there is a situation where the duration of the preset time period is too short, resulting in a small amount of vehicle position information reported by the GPS, which reduces the accuracy of generating the vehicle driving trajectory, and there is also a situation where the duration of the preset time period is too long, resulting in a large amount of vehicle position information reported by the GPS, which reduces the efficiency of generating the vehicle driving trajectory.
[0063] Through the above steps, when the number of initial trajectory points is not greater than the preset number of trajectory points, the specified interval distance and the key road distance are obtained. When the quotient obtained by dividing the key road distance by the specified interval distance is an integer, the preset number of trajectory points is used as the target number of trajectory points. Otherwise, the number of intermediate trajectory points is obtained, and the intermediate interval distance is obtained according to the key road distance and the number of intermediate trajectory points. Further, the target number of trajectory points is obtained according to the specified driving distance and the intermediate interval distance, so as to avoid a small or large number of target GPS coordinates caused by a small or large number of target trajectory points, thereby resulting in low accuracy and efficiency of the generated vehicle driving trajectory.
[0064] S40, sequentially obtaining Q GPS coordinates from a number of preceding GPS coordinates in the order of reporting time of the preceding GPS coordinates from back to front as first GPS coordinates, and sequentially obtaining Q subsequent GPS coordinates from a number of subsequent GPS coordinates in the order of reporting time of the subsequent GPS coordinates from front to back as second GPS coordinates, the preceding GPS coordinates are GPS coordinates reported by the target vehicle before the target time point, and the subsequent GPS coordinates are GPS coordinates reported by the target vehicle after the target time point, wherein Q is the number of key track points obtained according to the number of target track points, and Q meets the following conditions:
[0065] When the number of target trajectory points is an even number, Q is equal to the number of target trajectory points divided by 2, and when the number of target trajectory points is an odd number, Q is equal to the sum of the target trajectory points and 1 divided by 2.
[0066] S50, taking the first GPS coordinate, the GPS coordinate of the target vehicle at the target time point, and the second GPS coordinate as the target GPS coordinates and generating a vehicle driving trajectory of the target vehicle according to the target GPS coordinates, wherein those skilled in the art know that any method of generating a trajectory according to a plurality of GPS coordinates in the prior art falls within the protection scope of the present invention and will not be described in detail herein.
[0067] Specifically, the number of target GPS coordinates is the sum of the product of 2 and Q plus 1.
[0068] Through the above steps, when the vehicle running state of the target vehicle at the target time point is the parking state, the specified driving distance corresponding to the target vehicle is obtained, the initial trajectory point number is obtained according to the specified driving distance and the original interval distance, the target trajectory point number is obtained according to the initial trajectory point number and the preset trajectory point number, the key trajectory point number is obtained according to the target trajectory point number, the first GPS coordinate and the second GPS coordinate are obtained according to the key trajectory point number, the first GPS coordinate, the GPS coordinate of the target vehicle at the target time point and the second GPS coordinate are all used as the target GPS coordinates, and the vehicle driving trajectory of the target vehicle is generated according to the target GPS coordinates. It can be seen that the present invention determines the number of key trajectory points based on the specified driving distance and the original interval distance corresponding to the target vehicle, obtains the target GPS coordinates according to the number of key trajectory points, and generates the vehicle driving trajectory of the target vehicle based on the target GPS coordinates. Regardless of the time interval between two adjacent time points when the GPS of the target vehicle reports data, a certain number of target GPS coordinates can be obtained, which is beneficial to improving the accuracy of generating the vehicle driving trajectory and also beneficial to improving the efficiency of generating the vehicle driving trajectory.
[0069] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store a computer program related to a method in a method embodiment, and the computer program is loaded and executed by the processor to implement the method provided in the above embodiment.
[0070] An embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method provided in the above embodiment when executing the computer program.
[0071] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0072] The present invention provides a method for obtaining a vehicle running state, an electronic device and a storage medium. The method can obtain a target vehicle data set reported by a GPS of a target vehicle. The target vehicle data set includes a target time point, a speed of the target vehicle at the target time point and a GPS coordinate of the target vehicle at the target time point. When the speed of the target vehicle is not less than a preset speed, it is determined that the vehicle running state of the target vehicle at the target time point is a driving state. Otherwise, a key vehicle data set corresponding to the target vehicle is obtained, and data in the key vehicle data set is input into a target random forest model to obtain a predicted vehicle running state identifier. When the ratio of the number of predicted vehicle running state identifiers with an identifier of "0" to the number of all predicted vehicle running state identifiers is not less than a preset ratio, it is determined that the vehicle running state of the target vehicle at the target time point is a parking state. Otherwise, it is determined that the vehicle running state of the target vehicle at the target time point is a driving state. It can be seen that no matter how much the time interval between two adjacent time points of the GPS of the target vehicle reporting data is, the key vehicle data set can be obtained according to the target vehicle data set, and the vehicle running state of the target vehicle at the target time point is further determined, which is conducive to improving the accuracy of obtaining the vehicle running state of the target vehicle at the target time point.
[0073] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are only for illustration, not for limiting the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention.
Claims
1. A method for obtaining a vehicle operating status, characterized in that: The method comprises the following steps: S1. Obtain a target vehicle data set A={A1, A2, A3} reported by the GPS of the target vehicle, where A1 is the target time point, A2 is the speed of the target vehicle at A1, and A3 is the GPS coordinates of the target vehicle at A1; S2, when A2 ≥ A 0 When A1 is determined, the vehicle running state of the target vehicle is the driving state; when A2<A 0 When the key vehicle data set B corresponding to the target vehicle is obtained, B = {B1, B2, B3, B4}, B1 = {B 11 , B 12 , ..., B 1i , ..., B 1m }, A 0 is the preset speed, B1 is the key speed list corresponding to the target vehicle, B 1i is the i-th key speed corresponding to the target vehicle, i ranges from 1 to m, m is the number of key speeds corresponding to the target vehicle and is an odd number, B2 is the limited speed corresponding to the target road, B3 is the urban road grade corresponding to the target road, B4 is the time period identifier corresponding to A1, wherein the target road is the road where the target vehicle is located determined according to A3, and the limited speed corresponding to the target road is the maximum speed at which the vehicle is allowed to travel on the target road; S3, B 11 , B 12 , ..., B 1i , ..., B 1m , B2, B3, B4 are all input into the target random forest model to obtain the predicted vehicle running state identification list C = {C1, C2, ..., C j , ..., C n }, where C j is the predicted vehicle running state identifier output by the jth decision tree in the target random forest model, the value of j ranges from 1 to n, n is the number of decision trees in the target random forest model, and the predicted vehicle running state identifier includes identifier "0" and identifier "1", identifier "0" indicates that the vehicle running state of the target vehicle is a parking state, and identifier "1" indicates that the vehicle running state of the target vehicle is a driving state; S4. When D / n≥D 0 When D / n<D 0 When A1 is determined, the target vehicle's vehicle operation state is the driving state, and D is C1, C2, ..., C j , ..., C n The number of "0" in D 0 is the preset ratio.
2. The method for obtaining the vehicle running status according to claim 1, characterized in that: The time period identifier includes an identifier "a" and an identifier "b".
3. The method for obtaining the vehicle running status according to claim 2, characterized in that: The symbol "a" indicates that the target time point is in the peak time period.
4. The method for obtaining the vehicle running status according to claim 3, characterized in that: The mark "b" indicates that the target time point is in the flat peak period.
5. The method for obtaining the vehicle running status according to claim 1, characterized in that: Step S2 includes the following steps to obtain B 1i : When i = (m-1) / 2, A2 is used as B 1i ; When i<(m-1) / 2, A1-△t i The speed of the target vehicle is taken as B 1i , where △t i For B 1i corresponding preset time interval; When i>(m-1) / 2, A1+△t i The speed of the target vehicle is taken as B 1i .
6. The method for obtaining the vehicle running status according to claim 2, characterized in that: Step S2 also includes the following steps to obtain B4: When A1∈D1, determine B4 as the identifier "a", where D1 is the preset peak time period; When A1∈D2, B4 is determined to be the identifier "b", where D2 is a preset off-peak time period.
7. The method for obtaining the vehicle running status according to claim 1, characterized in that: Urban road grades include: expressways, trunk roads, secondary trunk roads and branch roads.
8. The method for obtaining vehicle operating status according to claim 1, characterized in that: A 0 Meet the following conditions: A 0 =V×(1-α×(E / (L×B2))-β×F-γ×G), where V is the average vehicle speed corresponding to the target road within the preset time period, the starting time point of the preset time point is the time point obtained by subtracting the preset duration from A1, the end time point of the preset time period is A1, α is the first preset speed adjustment weight, E is the traffic volume of the target road at A1, L is the number of lanes in the target road, β is the second preset speed adjustment weight, F is the identification weight corresponding to B4, γ is the third preset speed adjustment weight, and G is the preset environmental impact weight.
9. A non-transitory computer-readable storage medium, characterized in that: The storage medium stores a computer program, which is loaded and executed by a processor to implement the method for obtaining the vehicle operating status as described in any one of claims 1 to 8.
10. An electronic device comprising: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for obtaining the vehicle operating status as described in any one of claims 1 to 8 when executing the computer program.