Early warning methods, devices, media, and equipment for order and vehicle trajectory risks
By collecting and combining the driver's APP and vehicle GPS data, generating target line information and judging risks, the problem of failure to early warning of waybills, drivers and vehicles in the prior art is solved, and timely warning and prevention of risks is achieved.
Patent Information
- Application Number
- CN202210011073.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-01-06
AI Technical Summary
The existing technology has failed to effectively warn of safety risks of waybills, drivers and vehicles, resulting in an increase in accident rates.
By collecting real-time GPS data and historical navigation data of the driver's APP and the vehicle, the processing is combined to generate target line information, and risk events during transportation, such as trajectory deviation and GPS signal loss.
It has achieved timely early warning of drivers and truck risks, prevented the occurrence of risks, and improved transportation safety.
Smart Images

Figure CN114511193B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, medium, and equipment for early warning of order and vehicle trajectory risks. Background Art
[0002] Online freight platforms hold extensive information on waybills, drivers, vehicles, and their trajectory. Furthermore, the accident rate for large trucks in my country has been rising year by year in recent years. Various factors are impacting the safety of waybills, drivers, and vehicles. Developing early warning systems for potential risks is a pressing technical challenge. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to address the deficiencies of the existing technology and provide a method, device, medium and equipment for early warning of order and vehicle trajectory risks.
[0004] The technical solution of the present invention to solve the above technical problems is as follows:
[0005] A method for early warning of order and vehicle trajectory risks, comprising:
[0006] During the order transportation process, the real-time GPS data of the driver's app, historical navigation data information and the real-time GPS data of the vehicle's on-board terminal are collected, and the historical navigation data information is processed to obtain the target route information;
[0007] The real-time GPS data of the vehicle terminal, the real-time GPS data of the driver's app and the target route information are combined to obtain real-time streaming data during the order transportation process;
[0008] Based on the real-time streaming data, determine whether a risk event occurs during the order transportation process. The risk events include the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal and the GPS signal of the driver-side APP being lost.
[0009] The beneficial effects of the present invention are: a method for early warning of order and vehicle trajectory risks is proposed, including collecting real-time GPS data of the driver-side APP, historical navigation data information and real-time GPS data of the vehicle's on-board terminal during the order transportation process, and processing the historical navigation data information to obtain target route information; merging the on-board terminal real-time GPS data, the driver-side APP real-time GPS data and the target route information to obtain real-time streaming data during the order transportation process; judging whether a risk event occurs during the order transportation process based on the real-time streaming data, the risk event includes the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the on-board terminal GPS signal loss and the driver-side APP GPS signal loss. The present invention realizes timely early warning of risks that may be encountered by drivers and trucks, and prevents the occurrence of risks.
[0010] Furthermore, the processing of the historical navigation data information to obtain target route information specifically includes:
[0011] By associating the order ID in the order data with the order table, the shipping place and the delivery place of the order are obtained. Based on the shipping place and the delivery place of the order, the historical navigation data information is queried to obtain a historical navigation route with the shipping place as the starting point and the delivery place as the end point;
[0012] The road names included in each of the historical navigation routes are obtained, the road names that appear the most times are used as frequently traveled navigation roads, and the frequently traveled navigation roads are spliced to obtain the target route information.
[0013] Furthermore, the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP and the target route information are combined to obtain real-time streaming data during the order transportation process, specifically including:
[0014] Obtain the vehicle ID of the vehicle transporting the order through the real-time GPS data of the vehicle terminal, associate the vehicle ID with the driver-side APP, and obtain the order ID;
[0015] According to the vehicle ID and the order ID, the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP and the target route information are extracted to obtain the real-time streaming data. The real-time streaming data includes the order ID, the vehicle ID, the real-time latitude and longitude position information of the vehicle, the real-time latitude and longitude position information of the driver, the latitude and longitude information in the target route, the real-time speed and timestamp of the vehicle.
[0016] Furthermore, judging whether a risk event occurs during the order transportation process based on the real-time streaming data specifically includes:
[0017] Execute the KeyBy operator on the order ID to obtain the real-time stream data;
[0018] Extracting the first timestamp in the real-time GPS data of the driver-side APP, the second timestamp in the real-time GPS data of the vehicle terminal, and the third timestamp in the target route from the real-time streaming data respectively, performing a bitwise OR operation on the first timestamp, the second timestamp, and the third timestamp, and judging whether the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal, and the target route information are complete based on the obtained calculation result;
[0019] If so, a first real-time distance between the current location of the driver-side APP and the location indicated by the real-time GPS data of the vehicle terminal, and a second real-time distance between the location indicated by the real-time GPS data of the vehicle terminal and the location indicated by the target route are calculated according to the two-point distance formula on the spherical surface;
[0020] Obtaining a first theoretical distance between the vehicle terminal and the driver-side APP based on the first timestamp, the second timestamp, and the real-time speed;
[0021] Obtaining a second theoretical distance between the vehicle-mounted terminal and the current position of the vehicle when traveling along the target route according to the second timestamp, the third timestamp, and the real-time speed;
[0022] When the difference between the first real-time distance and the second theoretical distance is greater than a first preset threshold, it is determined that the driver-side APP deviates from the vehicle trajectory;
[0023] When the difference between the second real-time distance and the second theoretical distance is greater than a second preset threshold, it is determined that the vehicle trajectory deviates from the target route.
[0024] Furthermore, the method further comprises:
[0025] If the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are incomplete, obtaining the missing data type, which includes the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information;
[0026] Get the time window start time of the latest data received and the current window time of the missing data type;
[0027] If the difference between the current window time and the start time of the time window of the most recent data is greater than the preset window time, determine whether the missing data type starting from the current window time is obtained;
[0028] If not, when the missing data type is the real-time GPS data of the vehicle-mounted terminal, it is determined that the GPS signal of the vehicle-mounted terminal is lost; when the missing data type is the real-time GPS data of the driver-side APP, it is determined that the GPS signal of the driver-side APP is lost.
[0029] Furthermore, the method further comprises:
[0030] If the missing data type starting from the current window time is obtained, the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are obtained;
[0031] Using the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information, it is determined whether there is a risk event that the vehicle trajectory deviates from the target route in the target route information and the driver-side APP deviates from the vehicle trajectory.
[0032] Another technical solution of the present invention to solve the above technical problems is as follows:
[0033] An early warning device for order and vehicle trajectory risks, comprising:
[0034] The collection module is used to collect real-time GPS data from the driver's app, historical navigation data information, and real-time GPS data from the vehicle's onboard terminal during the order transportation process, and processes the historical navigation data information to obtain target route information;
[0035] A merging module, configured to merge the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process;
[0036] A determination module is used to determine whether a risk event occurs during the order transportation process based on the real-time stream data. The risk events include the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal, and the GPS signal of the driver-side APP being lost.
[0037] Furthermore, an early warning device for order and vehicle trajectory risks includes:
[0038] The collection module is used to collect real-time GPS data from the driver's app, historical navigation data information, and real-time GPS data from the vehicle's onboard terminal during the order transportation process, and processes the historical navigation data information to obtain target route information;
[0039] A merging module, configured to merge the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process;
[0040] A determination module is used to determine whether a risk event occurs during the order transportation process based on the real-time stream data. The risk events include the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal, and the GPS signal of the driver-side APP being lost.
[0041] In addition, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for early warning of order and vehicle trajectory risks described in any one of the above technical solutions.
[0042] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the method for early warning of order and vehicle trajectory risks as described in any one of the above technical solutions are implemented.
[0043] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention or the description of the prior art. 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 paying any creative work.
[0045] Figure 1 This is a flow chart of a method for early warning of order and vehicle trajectory risks according to an embodiment of the present invention;
[0046] Figure 2 This is a module schematic diagram of a warning device for order and vehicle trajectory risks shown in another embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0048] like Figure 1 As shown, an early warning method for order and vehicle trajectory risks according to an embodiment of the present invention includes the following steps:
[0049] 110. During the order transportation process, the real-time GPS data of the driver-side APP, historical navigation data information and the real-time GPS data of the vehicle's on-board terminal are collected, and the historical navigation data information is processed to obtain the target route information.
[0050] 120. Combine the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process.
[0051] 130. Based on the real-time streaming data, determine whether a risk event occurs during the order transportation process, the risk event includes the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal and the GPS signal of the driver-side APP being lost.
[0052] Based on the above-mentioned embodiment, a method for early warning of order and vehicle trajectory risks is proposed, which includes collecting real-time GPS data of the driver-side APP, historical navigation data information and real-time GPS data of the vehicle's on-board terminal during the order transportation process, and processing the historical navigation data information to obtain target route information; merging the real-time GPS data of the on-board terminal, the real-time GPS data of the driver-side APP and the target route information to obtain real-time streaming data during the order transportation process; judging whether a risk event occurs during the order transportation process based on the real-time streaming data, the risk event includes the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the loss of the GPS signal of the on-board terminal and the loss of the GPS signal of the driver-side APP. The present invention realizes timely early warning of risks that may be encountered by drivers and trucks, and prevents the occurrence of risks.
[0053] Furthermore, in step 110, the historical navigation data information is processed to obtain target route information, which specifically includes:
[0054] By associating the order ID in the order data with the order table, the shipping place and delivery place of the order are obtained. Based on the shipping place and delivery place of the order, the historical navigation data information is queried to obtain the historical navigation route with the shipping place as the starting point and the delivery place as the end point.
[0055] The road names included in each of the historical navigation routes are obtained, the road names that appear the most times are used as frequently traveled navigation roads, and the frequently traveled navigation roads are spliced to obtain the target route information.
[0056] Furthermore, step 120 specifically includes:
[0057] The real-time GPS data of the vehicle terminal is used to obtain the vehicle ID for transporting the order, and the vehicle ID is associated with the driver-side APP to obtain the order ID.
[0058] According to the vehicle ID and the order ID, the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP and the target route information are extracted to obtain the real-time streaming data. The real-time streaming data includes the order ID, the vehicle ID, the real-time latitude and longitude position information of the vehicle, the real-time latitude and longitude position information of the driver, the latitude and longitude information in the target route, the real-time speed and timestamp of the vehicle.
[0059] Furthermore, in step 130, judging whether a risk event occurs during the order transportation process based on the real-time streaming data specifically includes:
[0060] 131. Execute the KeyBy operator on the order ID to obtain the real-time stream data.
[0061] 132. Extract the first timestamp from the real-time GPS data of the driver-side APP, the second timestamp from the real-time GPS data of the vehicle-mounted terminal, and the third timestamp from the target route in the real-time streaming data respectively, and perform bitwise OR calculation on the first timestamp, the second timestamp, and the third timestamp. Based on the calculation result, determine whether the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle-mounted terminal, and the target route information are complete.
[0062] 133. If so, calculate the first real-time distance between the current location of the driver-side APP and the location indicated by the real-time GPS data of the vehicle terminal, and the second real-time distance between the location indicated by the real-time GPS data of the vehicle terminal and the location indicated by the target route according to the two-point distance formula on the sphere.
[0063] 134. Obtain a first theoretical distance between the vehicle-mounted terminal and the driver-side APP based on the first timestamp, the second timestamp, and the real-time speed.
[0064] 135. Obtain a second theoretical distance between the vehicle-mounted terminal and the current position of the vehicle when traveling along the target route based on the second timestamp, the third timestamp, and the real-time speed.
[0065] 136. When the difference between the first real-time distance and the second theoretical distance is greater than a first preset threshold, it is determined that the driver-side APP deviates from the vehicle trajectory.
[0066] 137. When the difference between the second real-time distance and the second theoretical distance is greater than a second preset threshold, it is determined that the vehicle trajectory deviates from the target route.
[0067] Furthermore, the method further includes step 138:
[0068] If the real-time GPS data from the driver app, the real-time GPS data from the vehicle terminal, and the target route information are incomplete, the missing data types are obtained, which include the real-time GPS data from the driver app, the real-time GPS data from the vehicle terminal, and the target route information.
[0069] Get the time window start time and current window time of the most recently received data of the missing data type.
[0070] If the difference between the current window time and the start time of the time window of the most recent data is greater than the preset window time, it is determined whether the missing data type starting from the current window time is obtained.
[0071] If not, when the missing data type is the real-time GPS data of the vehicle-mounted terminal, it is determined that the GPS signal of the vehicle-mounted terminal is lost; when the missing data type is the real-time GPS data of the driver-side APP, it is determined that the GPS signal of the driver-side APP is lost.
[0072] Furthermore, the method further includes step 139:
[0073] If the missing data type starting from the current window time is obtained, the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are obtained.
[0074] By using the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information, it is determined whether there is a risk event that the vehicle trajectory deviates from the target route in the target route information and the driver-side APP deviates from the vehicle trajectory.
[0075] It should be understood that vehicle information is uploaded to the server in real time through the vehicle terminal, and GPS data from the driver-side app is collected and stored in real time. Offline analysis is performed to analyze the navigation routes taken by other drivers for orders on this route. The vehicle terminal GPS information includes the vehicle ID, real-time GPS latitude and longitude location information, vehicle speed, and timestamp, while the driver-side app GPS data includes the order ID, driver ID, and timestamp. The order data includes the order ID, shipping location, delivery location, and timestamp. The driver-vehicle relationship data includes the driver ID, vehicle ID, and timestamp. Historical route analysis is based on MySQL order information.
[0076] Specific collection method: First, configure Flink and set the event_time data to use, checkpoint semantics to EXACTLY_ONCE, save a maximum of two checkpoint versions, trigger a checkpoint interval of 60 seconds for the first checkpoint, and a minimum interval of 10 seconds for each subsequent checkpoint, with a checkpoint timeout of 60 seconds. Write the data to an HDFS file, specifying the HDFS path and the UTF-8 encoder. Set the HDFS file bucket size to 128MB, the file generation rollover interval to 60 seconds, and the write timeout to 60 seconds.
[0077] The vehicle terminal GPS information uses Flink to subscribe to Kafka data. First, the side stream output is defined to determine whether there is null value data in the vehicle terminal GPS data read by Kafka. If null value data exists, the data needs to be stored in the side stream and then stored in the HDFS file system center for dirty data analysis.
[0078] The original GPS data of the driver-side app is stored in MySQL. After subscribing to and collecting the MySQL binlog logs through Flink CDC, it is determined whether there is null value data in the read data. If there is null value data, it needs to be stored in the side stream and then stored in the HDFS file system center for dirty data analysis.
[0079] Offline analysis of historical order navigation routes: First, use the order ID in the order data to link to the order table to obtain the shipping and receiving locations of the local order route. Pass this as a parameter to the FlinkTable API to read all navigation routes for this route in Hive over the past year. Then, call the map API based on the longitude and latitude to obtain the road name corresponding to each longitude and latitude. Then, use FlinkSQL to group and remove duplicates by road name to obtain the specific road name of each navigation route. Use the row_number() function partition by road name to obtain the most frequently traveled navigation route for this route. Load the result into memory for later use.
[0080] The vehicle terminal GPS data reads the driver-vehicle relationship table through the vehicle ID and associates the driver ID, then associates the order ID with the order table through the driver ID. Finally, the order ID field is added to the vehicle terminal GPS data. The final vehicle terminal GPS data format is order ID, vehicle ID, real-time GPS latitude and longitude location information, real-time speed and timestamp of the vehicle.
[0081] The historical order navigation route table API uses AppendStream to convert table data into a DataStream formatted as the order ID, frequently used route ID, and the latitude and longitude of the most frequently used route. The three streams are then merged using the DataStream union operator. The merged data stream formatted as the order ID, (vehicle ID / driver ID / frequently used route ID), real-time GPS latitude and longitude information, the vehicle's real-time speed, timestamp, historical latitude and longitude information of the most frequently used route, and driver app latitude and longitude information. This merged data is stored in an HBASE database for displaying real-time vehicle, driver, and historical navigation data on the data dashboard. When creating an hbase sink connection, inherit the low-level API RichSinkFunction and implement its open, close, and invoke functions. The open() and close() functions are instantiated, one-time execution functions. Within the open function, create an hbaseConnection and obtain the HBASEAdmin. The HBase table is checked to determine if it exists. If so, the batch write size is immediately set to 2MB and flushed to the HBase table. If the table has not been created, the HBase table is first created, specifying the column cluster and the number of pre-partitions, and then the batch write size is set. The HBase connection is closed in the close() function, and the invoke() function implements the specific HBase write method: after converting the stream data into an object, mutator.mutate(put) is used to flush it to disk. Here, a check is performed again: if the cache contains more than 500 entries, the data is flushed, or if the cached data size exceeds 2MB, the data is flushed to the HBase database. Risk assessments include vehicle trajectories exceeding the recommended trajectory and information loss timeouts due to failure to obtain new data. After merging, a watermark and rolling window are added to the stream data, using the timestamp in the data as the event_time. The specific watermark time needs to be appropriately set based on the estimated latency from preliminary data testing. For now, a watermark of 1 second is used. The keyBy operator is applied based on the order ID to put the data of the same order in the same window. The latest data in the stream is obtained by applying the window operator. The three types of GPS data information are defined in the same bean for storage. The bean fields include order ID, GPS data type, longitude, latitude, speed, and timestamp.First, the initial timestamp and order ID are written to the bean. Based on the window's iterable data, the loop iterator determines which of three ID types it is: vehicle, driver, or historical navigation route. The timestamp in the iterator is greater than 0 because only the vehicle terminal's GPS information includes speed. The results of this determination are then written to different beans. Because window timing may result in data loss, the window opening time cannot be the same as the data upload frequency. Instead, it should be larger than the maximum upload frequency. Therefore, after looping and encapsulating the beans, multiple beans are encapsulated into an ArrayList and sent to downstream operations. Each window has an iterator, and the iterator ends when the window is closed.
[0082] First, retrieve the data from all windows and use Java bitwise calculations to determine whether the data is complete. For historical routes, use a=a|1; for driver app GPS information, use a=a|2; and for vehicle terminal GPS data, use a=a|4. Therefore, the possible values for a range from 0 to 7. When a=0, the current window has no data. When a=1, the current window has historical route data, no driver app data, and no vehicle terminal GPS data. When a=2, the current window has no historical route data, driver app data, and no vehicle terminal GPS data. When a=3, the current window has historical route data, driver app data, and no vehicle terminal GPS data. When a=4, the current window has no historical route data, no driver app data, and vehicle terminal GPS data. When a=5, the current window has historical route data, no driver app data, and vehicle terminal GPS data. When a=6, the current window has no historical route data, driver app data, and vehicle terminal GPS data. When a=7: This indicates that the current window contains historical route data, driver app data, and vehicle terminal GPS data. Note: Bitwise OR operation | is 0 when both are 0, otherwise it is 1. Therefore, when a=7, the data in the window is complete. To calculate the distance between two longitudes and latitudes: Because the parameters of methods such as cos and sin in the Math class in Java are all in radians, first convert longitude and latitude to radians: d*Math.PI / 180.0, where d is longitude or latitude; convert both longitudes to radians and latitudes to radians, and then use the distance formula between two points on a sphere to calculate the distance between the two points: Point A, latitude angle β1, longitude angle α1; Point B, latitude angle β2, longitude angle α2. The distance S = R·arccos[cosβ1cosβ2cos(α1-α2)+sinβ1sinβ2], where R is the radius of the sphere. The distances between the driver's app and the vehicle's GPS are calculated, and the distances between the vehicle and the historical route at a given point in time are a1 and a2. Then, based on the value b1 (vehicle speed / 3.6*|vehicle GPS timestamp - driver's app timestamp) and the theoretical distance between the two points, vehicle speed / 3.6*|vehicle GPS timestamp - historical route timestamp) and the theoretical distance between the two points, a given threshold is used to compare a1-b1 and a2-b2. If the values are greater than the given threshold, the driver's app trajectory and the vehicle's trajectory are considered too far from the recommended trajectory, triggering the warning mechanism.
[0083] For GPS data loss exceeding a certain threshold, no new data is received. Because track data points may be temporarily lost due to tunnels, phone calls, or weak signal conditions in mountainous areas, determining GPS data loss requires considering the simultaneous loss of data for a particular track across multiple consecutive time windows, rather than issuing an alert based on the loss of a single timestamp. The bean storing intact data in the historical window includes the order ID, missing data flag, window start time, and intact data. When determining whether a track's distance is excessive at a specific moment, the incomplete data flag or the current window's flag a!=7 indicates missing data. In this case, the intact data is stored in a defined sidestream using context.output(). Complete data is then spliced across multiple windows. A custom ProcessFunction is then created to read data from the sidestream storing the intact data. In the open function, a ValueStateDescriptor is defined, setting the state name and type. The ValueState is then initialized from RuntimeContext(). In the processElement function, incomplete data is retrieved from the sidestream and the start time of the current window is obtained using the TimeWindow.getWindowStartWithOffset method. Check whether there is data in the ValueState. If not, write the current window start time and the data in the current window to the ValueState reassembly bean. The reassembly bean contains the following fields: the current window start time, the incomplete data window start time, and the missing incomplete data flag. If the current window start time minus the incomplete data window start time is greater than the windowsize (window time), write the current window start time and the data in the current window to the ValueState reassembly bean. If the incomplete data flag or the flag a of the current window data is equal to 7, the data in the ValueState plus the data in the current window can complete the three tracks. The completed data is sent downstream to determine if there is a warning about excessive distance between two points at the same time. If the data cannot be completed, determine whether the current window start time minus the incomplete data window start time is greater than the specified threshold. This indicates that the data loss period is long and a warning is required.
[0084] like Figure 2 As shown, an early warning device for order and vehicle trajectory risks includes:
[0085] The collection module is used to collect real-time GPS data from the driver's app, historical navigation data information, and real-time GPS data from the vehicle's onboard terminal during the order transportation process, and processes the historical navigation data information to obtain target route information;
[0086] A merging module, configured to merge the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process;
[0087] A determination module is used to determine whether a risk event occurs during the order transportation process based on the real-time stream data. The risk events include the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal, and the GPS signal of the driver-side APP being lost.
[0088] Furthermore, an early warning device for order and vehicle trajectory risks includes:
[0089] The collection module is used to collect real-time GPS data from the driver's app, historical navigation data information, and real-time GPS data from the vehicle's onboard terminal during the order transportation process, and processes the historical navigation data information to obtain target route information;
[0090] A merging module, configured to merge the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process;
[0091] A determination module is used to determine whether a risk event occurs during the order transportation process based on the real-time stream data. The risk events include the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the GPS signal of the vehicle terminal, and the GPS signal of the driver-side APP being lost.
[0092] In addition, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for early warning of order and vehicle trajectory risks described in any one of the above technical solutions.
[0093] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the method for early warning of order and vehicle trajectory risks as described in any one of the above technical solutions are implemented.
[0094] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A method for early warning of order and vehicle trajectory risks, characterized in that: include: During the order transportation process, the real-time GPS data of the driver's app, historical navigation data information and the real-time GPS data of the vehicle's on-board terminal are collected, and the historical navigation data information is processed to obtain the target route information; The real-time GPS data of the vehicle terminal, the real-time GPS data of the driver's app and the target route information are combined to obtain real-time streaming data during the order transportation process; Determine, based on the real-time streaming data, whether a risk event occurs during the order transportation process, wherein the risk event includes the vehicle trajectory deviating from the target route in the target route information, the driver-side APP deviating from the vehicle trajectory, the vehicle terminal's GPS signal being lost, and the driver-side APP's GPS signal being lost; The determining, based on the real-time streaming data, whether a risk event occurs during the order transportation process specifically includes: Execute the KeyBy operator on the order ID to obtain the real-time stream data; Extracting the first timestamp in the real-time GPS data of the driver-side APP, the second timestamp in the real-time GPS data of the vehicle terminal, and the third timestamp in the target route from the real-time streaming data respectively, performing a bitwise OR operation on the first timestamp, the second timestamp, and the third timestamp, and judging whether the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal, and the target route information are complete based on the obtained calculation result; If so, a first real-time distance between the current location of the driver-side APP and the location indicated by the real-time GPS data of the vehicle terminal, and a second real-time distance between the location indicated by the real-time GPS data of the vehicle terminal and the location indicated by the target route are calculated according to the two-point distance formula on the spherical surface; Obtaining a first theoretical distance between the vehicle terminal and the driver-side APP based on the first timestamp, the second timestamp, and the real-time speed; Obtaining a second theoretical distance between the vehicle-mounted terminal and the current position of the vehicle when traveling along the target route according to the second timestamp, the third timestamp, and the real-time speed; When the difference between the first real-time distance and the second theoretical distance is greater than a first preset threshold, it is determined that the driver-side APP deviates from the vehicle trajectory; When the difference between the second real-time distance and the second theoretical distance is greater than a second preset threshold, it is determined that the vehicle trajectory deviates from the target route; The method further comprises: If the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are incomplete, obtaining the missing data type, which includes the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information; Get the time window start time of the latest data received and the current window time of the missing data type; If the difference between the current window time and the start time of the time window of the most recent data is greater than the preset window time, determine whether the missing data type starting from the current window time is obtained; If not, when the missing data type is the real-time GPS data of the vehicle terminal, it is determined that the GPS signal of the vehicle terminal is lost; when the missing data type is the real-time GPS data of the driver-side APP, it is determined that the GPS signal of the driver-side APP is lost; The method further comprises: If the missing data type starting from the current window time is obtained, the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are obtained; Using the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information, it is determined whether there is a risk event that the vehicle trajectory deviates from the target route in the target route information and the driver-side APP deviates from the vehicle trajectory.
2. The method for early warning of order and vehicle trajectory risks according to claim 1, characterized in that: The processing of the historical navigation data information to obtain target route information specifically includes: By associating the order ID in the order data with the order table, the shipping place and the delivery place of the order are obtained. Based on the shipping place and the delivery place of the order, the historical navigation data information is queried to obtain a historical navigation route with the shipping place as the starting point and the delivery place as the end point; The road names included in each of the historical navigation routes are obtained, the road names that appear the most times are used as frequently traveled navigation roads, and the frequently traveled navigation roads are spliced to obtain the target route information.
3. The method for early warning of order and vehicle trajectory risks according to claim 1, characterized in that: The real-time GPS data of the vehicle terminal, the real-time GPS data of the driver's APP and the target route information are combined to obtain the real-time streaming data of the order transportation process, specifically including: Obtain the vehicle ID of the vehicle transporting the order through the real-time GPS data of the vehicle terminal, and associate the vehicle ID with the driver-side APP to obtain the order ID; According to the vehicle ID and the order ID, the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP and the target route information are extracted to obtain the real-time streaming data. The real-time streaming data includes the order ID, the vehicle ID, the real-time latitude and longitude position information of the vehicle, the real-time latitude and longitude position information of the driver, the latitude and longitude information in the target route, the real-time speed and timestamp of the vehicle.
4. A warning device for order and vehicle trajectory risks, characterized by: include: The collection module is used to collect real-time GPS data from the driver's app, historical navigation data information, and real-time GPS data from the vehicle's onboard terminal during the order transportation process, and processes the historical navigation data information to obtain target route information; A merging module, configured to merge the real-time GPS data of the vehicle terminal, the real-time GPS data of the driver-side APP, and the target route information to obtain real-time streaming data during the order transportation process; a determination module, configured to determine, based on the real-time streaming data, whether a risk event occurs during the order transportation process, the risk event including a vehicle trajectory deviating from the target route in the target route information, a driver-side APP deviating from the vehicle trajectory, a vehicle-mounted terminal GPS signal loss, and a driver-side APP GPS signal loss; The determining, based on the real-time streaming data, whether a risk event occurs during the order transportation process specifically includes: Execute the KeyBy operator on the order ID to obtain the real-time stream data; Extracting the first timestamp in the real-time GPS data of the driver-side APP, the second timestamp in the real-time GPS data of the vehicle terminal, and the third timestamp in the target route from the real-time streaming data respectively, performing a bitwise OR operation on the first timestamp, the second timestamp, and the third timestamp, and judging whether the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal, and the target route information are complete based on the obtained calculation result; If so, a first real-time distance between the current location of the driver-side APP and the location indicated by the real-time GPS data of the vehicle terminal, and a second real-time distance between the location indicated by the real-time GPS data of the vehicle terminal and the location indicated by the target route are calculated according to the two-point distance formula on the spherical surface; Obtaining a first theoretical distance between the vehicle terminal and the driver-side APP based on the first timestamp, the second timestamp, and the real-time speed; Obtaining a second theoretical distance between the vehicle-mounted terminal and the current position of the vehicle when traveling along the target route according to the second timestamp, the third timestamp, and the real-time speed; When the difference between the first real-time distance and the second theoretical distance is greater than a first preset threshold, it is determined that the driver-side APP deviates from the vehicle trajectory; When the difference between the second real-time distance and the second theoretical distance is greater than a second preset threshold, it is determined that the vehicle trajectory deviates from the target route; If the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are incomplete, obtaining the missing data type, which includes the real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information; Get the time window start time of the latest data received and the current window time of the missing data type; If the difference between the current window time and the start time of the time window of the most recent data is greater than the preset window time, determine whether the missing data type starting from the current window time is obtained; If not, when the missing data type is the real-time GPS data of the vehicle terminal, it is determined that the GPS signal of the vehicle terminal is lost; when the missing data type is the real-time GPS data of the driver-side APP, it is determined that the GPS signal of the driver-side APP is lost; If the missing data type starting from the current window time is obtained, the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information are obtained; Using the complete real-time GPS data of the driver-side APP, the real-time GPS data of the vehicle terminal and the target route information, it is determined whether there is a risk event that the vehicle trajectory deviates from the target route in the target route information and the driver-side APP deviates from the vehicle trajectory.
5. The early warning device for order and vehicle trajectory risks according to claim 4 is characterized in that: The acquisition module is specifically configured to obtain the shipping location and delivery location of the order by associating the order ID in the order data with the order table, and query the historical navigation data information based on the shipping location and delivery location of the order to obtain a historical navigation route with the shipping location as the starting point and the delivery location as the end point; The road names included in each of the historical navigation routes are obtained, the road names that appear the most times are used as frequently traveled navigation roads, and the frequently traveled navigation roads are spliced to obtain the target route information.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the early warning method for order and vehicle trajectory risks described in any one of claims 1-3 are implemented.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for early warning of order and vehicle trajectory risks as described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Intelligent analysis method of vehicle and driver binding relationship through fusion of multi-channel position data acquisition
CN107680373A
Method and device for determining route
CN109084788A
Order travel anomaly identification method and system
CN110751586A
Risk prevention method and system based on signal loss abnormity
CN111598369A