MaxCompute-based staying oil station behavior track identification method and system
Through MaxCompute technology, the driver's gas station behavior pattern is identified, the problem of misjudgment of traditional methods is solved, accurate data support is provided, personalized marketing strategies are formulated for gas station operators, and operational efficiency and customer satisfaction are improved.
Patent Information
- Application Number
- CN202411201419.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-29
AI Technical Summary
Traditional calculation methods have misjudgments when judging whether a driver passes through a gas station, which lacks accuracy and personalization, making it difficult to provide effective marketing strategies for gas station operators.
Using MaxCompute-based behavioral trajectory recognition method, the behavioral patterns of drivers of gas stations are accurately identified through data preprocessing, trajectory smoothing and filling, distance calculation and screening, behavior pattern recognition and other technologies, so as to accurately identify the behavioral patterns of the gas stations, reduce the amount of data processing, and provide personalized Serve.
It improves data processing efficiency and accuracy, realizes refined behavior pattern recognition, provides detailed data support for gas station operators, helps formulate personalized marketing strategies, and improves customer satisfaction and operational efficiency.
Smart Images

Figure CN119167013A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobile trajectory recognition, and in particular to an intelligent recommendation direction of a refueling or charging POI location, and in particular to a MaxCompute-based method and system for recognizing a behavior trajectory of a stop at a gas station. Background Art
[0002] In the context of the rapid development of today's automobile industry and new energy technologies, gas stations and charging stations are key nodes for energy replenishment, and their operational efficiency and service quality have a direct impact on the travel experience of car owners. Although traditional marketing methods, such as advertising and promotional activities, can promote sales growth to a certain extent, these methods often lack accuracy and personalization.
[0003] To overcome this challenge, the application of massive trajectory data has become an innovative solution. By accurately calculating whether the driver actually passes by the point of interest (POI) for refueling or charging, the intelligent recommendation function is realized. Operators can develop more personalized marketing strategies by deeply analyzing the driving trajectory and refueling habits of drivers. For example, recommend nearby gas stations to drivers who often travel in a specific area, or provide customized services for drivers who prefer specific brands or oil products.
[0004] However, the traditional calculation method is to determine whether the driver has passed the gas station by calculating the straight-line distance between the driver's position and the gas station POI point. Due to the rough strategy, the traditional method often leads to a large number of misjudgments.
[0005] To this end, the present invention proposes a MaxCompute-based method and system for identifying gas station stop behavior trajectories. Summary of the invention
[0006] In view of this, the present invention hopes to provide a MaxCompute-based gas station stop behavior trajectory identification method and system to solve or alleviate the technical problems existing in the prior art, namely, how to analyze the driver's behavior pattern and then efficiently screen out each POI point and the driver point within it to reduce the amount of data processing, and at least provide a beneficial option for this; the technical solution of the present invention is implemented as follows:
[0007] First, the MaxCompute-based method for identifying the behavior trajectory of gas station stops:
[0008] 1. Overview:
[0009] The present invention aims to achieve efficient identification and screening of driver behavior patterns through data processing and analysis technology. First, the original driver point data is cleaned and optimized through data preprocessing and trajectory smoothing and filling technology to improve the accuracy and reliability of subsequent analysis. Using distance calculation and screening methods, drivers located near specific POIs (such as gas stations) are further screened out to provide basic data for behavior pattern recognition. Through behavioral pattern recognition and optimization technology, the driver's entry and exit behavior of the gas station can be accurately identified, and the continuous trajectory can be split into independent entry, stay and exit events. By aggregating and analyzing these events, the number of drivers passing through each gas station per day, the number of drivers staying per day, and the stay time of each driver are calculated, providing gas station operators with accurate data support and personalized services and marketing strategies.
[0010] (II) Technical solution:
[0011] 2.1 Step S1, data preprocessing:
[0012] Read the daily driver location data from the database to form a data set D, including timestamp t, longitude l and latitude d;
[0013] The acceleration threshold is used to filter out abnormal points in the data set D to ensure the accuracy and reliability of the data.
[0014] 2.1.1 Step S100, reading data:
[0015] Read the daily driver location data from the database to form data set D:
[0016] D={(t i ,l i ,d i )|i=1,2,…,n};
[0017] where t i is the i-th timestamp, l i is the i-th longitude, d i is the i-th latitude.
[0018] 2.1.2 Step S101, data thinning:
[0019] A data thinning algorithm is applied to reduce the amount of data in the dataset D. A data thinning algorithm is a preset screening strategy to remove redundant or unnecessary data points.
[0020] 2.1.3 Step S102, acceleration threshold filtering:
[0021] Calculate the speed change between adjacent data points, and then estimate the acceleration and judge it with the threshold T. If the acceleration a satisfies |a|>T, the data point is filtered out.
[0022] 2.2 Step S2, trajectory smoothing and filling:
[0023] The dataset D is windowed; for the missing trajectory points within the time window, the spline interpolation method is used to fill in the missing coordinates.
[0024] 2.2.1 Step S200, window opening processing:
[0025] For the data set D = {(t i ,l i ,d i )|i=1,2,…,n} and the set time window size Δt, each data point (t i ,l i ,d i ) corresponds to the data set D in the time window i It is expressed as:
[0026]
[0027] 2.2.2 Step S201, fill in missing coordinates using spline interpolation method:
[0028] For the time window D i The missing trajectory points within are filled using spline interpolation:
[0029] Assume that there are m known data points in the time window and they are sorted by time as follows:
[0030] (t i1 ,l i1 ,d i1 ),(t i2 ,l i2 ,d i2 ),…,(t im ,l im ,d im );
[0031] For the missing time point t ij ′(where t ij <t ij ' <t ij+1 ), use cubic spline interpolation to calculate the corresponding longitude and latitude l ij ′ and d ij ′, so that:
[0032]
[0033] And S(t) in each subinterval [t ik ,t ik+1 ] is a polynomial on the entire interval and satisfies smoothness conditions (such as continuity or differentiability).
[0034] 2.3 Step S3, distance calculation and screening:
[0035] The actual distance d between any geographic coordinate points in the two datasets D and the distance between the driver's trajectory points d' are calculated based on the Haversine formula. The driver's trajectory data that did not drive on that day is filtered out based on the driver's driving record.
[0036] 2.3.1 Step S300, calculate the distance d:
[0037] For any two geographic coordinate points (l i ,d i ) and (l j ,d j ), use the Haversine formula to calculate the actual distance d between them:
[0038]
[0039] Here, r is the radius of the earth, which is 6371 kilometers.
[0040] The method for calculating the distance d' is to use the above Haversine formula to calculate for each driver's trajectory point (t', l', d').
[0041] 2.3.2 Step S301, filter the track data of drivers who have not driven:
[0042] Suppose the driver's driving records are a set R, where each element r is a time range, indicating the driver's driving time. For each driver's trajectory point (t', l', d'), check whether there is r∈R such that t' is within the time range of r. If there is no such r, filter out the trajectory point, otherwise keep it; the filtered data set is recorded as D', which only contains the trajectory data of drivers who drove on that day.
[0043] 2.4 Step S4, POI and driver location matching:
[0044] For each POI point, query the driver trajectory point d' within the grid where it is located and the adjacent grids on each side. Calculate the distance between the queried driver trajectory point d' and the POI, and filter out the drivers near the POI.
[0045] 2.4.1 Step S400, mapping to H3 grid index system:
[0046] Set the POI point ( lPOI ,d POI ) and the driver trajectory point (l', d') are mapped to the H3 level 7 grid index system, and the corresponding grid (index) h is obtainedPOI and h'.
[0047] 2.4.2 Step S401, query the driver's track points in the adjacent grid:
[0048] For each POI point, query its grid h POI And the driver trajectory points (l', d') within the adjacent grids on each side. Let the set of adjacent grids be N(h POI ), the query condition is:
[0049] h′∈{h POI}∪N(h POI );
[0050] 2.4.3 Step S402, calculate distance and screen drivers:
[0051] For each driver trajectory point (l',d') found, calculate its distance from the POI point (l POI ,d POI ) POI ' (Using the Haversine formula, as described in step S3).
[0052] Based on the distance threshold θ, drivers near the POI are selected, that is, those who meet d POI '≤θ;
[0053] The distance threshold θ is a distance range set according to actual needs, which is used to determine the specific business needs of "nearby".
[0054] 2.5 Step S5, behavior pattern recognition and optimization:
[0055] Identify the patterns of driver trajectories entering, staying, and leaving outside the POI range. Then split the continuous trajectory into independent entry events, stay events, and exit events, mark them, and record the relevant timestamps and location information.
[0056] 2.5.1 Step S500, define the driver's trajectory data as a series of timestamps and location points:
[0057] {(t1,loc1),(t2,loc2),…,(t n ,loc n )}
[0058] Among them, t i is the i-th timestamp, loc i is the i-th location point (including longitude and latitude).
[0059] The scope of a POI (point of interest) is defined as an area represented by a center point and radius, or represented by a polygon, such as:
[0060] POI = (center, radius);
[0061] Among them, center and radius are the center point and radius respectively.
[0062] 2.5.2 Step S501, executing the judgment mechanism:
[0063] (1) Entry event: When the driver's position enters the POI range for the first time from outside the POI range, an entry event is recorded. The conditional statement is as follows:
[0064] if distance(loc i ,center)≤radius and distance(loci) -1 ,center)>radiusthen Evententer=(t i ,loc i );
[0065] (2) Stay event: When the driver's position stays within the POI range for a period of time, a stay event is recorded. A time threshold can be set to determine the stay. The conditional statement is as follows:
[0066] if distance(loc i ,center)≤radius forΔt≥thresholdstay then Eventstay=[(tstart,locstart),(tend,locend)];
[0067] Where Δt is the time the driver stays within the POI range, and thresholdstay is the time threshold for judging the stay.
[0068] (3) Exit event: When the driver's position leaves the POI range, a exit event is recorded. The conditional statement is as follows:
[0069] if distance(loc i ,center)>radius and distance(loc i-1 ,center)≤radiusthen Eventleave=(t i ,loc i );
[0070] Finally, these events are marked and the relevant timestamps and location information are recorded. In this way, the continuous trajectory data can be split into independent entry events, stay events, and exit events for subsequent analysis and optimization.
[0071] 2.6 Step S6, gas station indicator aggregation and output:
[0072] Based on the split and marked events, the number of drivers passing through each gas station, the number of drivers staying at the gas station, and the time each driver stays at the gas station are calculated.
[0073] 2.6.1 Step S600, calculate the number of drivers passing by on a daily basis:
[0074] For each gas station j, the number of drivers passing through the gas station (Npass,j) is obtained by counting the number of all independent events that pass through the gas station, including entry events and exit events, but without repeated counting.
[0075] This is done by iterating over the list of events and counting the unique identifier of each driver.
[0076] 2.6.2 Step S601, calculate the number of drivers staying per day:
[0077] Number of drivers staying per day (Nstay, j ) is the number of all independent drivers who have stopped within the gas station.
[0078] This can also be achieved by traversing the event list and counting the unique identifiers of drivers who have stopped.
[0079] 2.6.3 Step S602, calculate the time each driver stays at the gas station:
[0080] For each driver i who has a stop event, the stop time T at gas station j is stay,i,j By calculating the difference between the start time and end time of the driver's stop event, we get:
[0081] T stay,i,j =t end,i,j -t start,i,j ;
[0082] Among them, t start,i,j and tend,i,j are the start time and end time of driver i’s stop at gas station j, respectively.
[0083] (III) Mechanism for solving technical problems:
[0084] Map POI points and driver locations to grid index systems such as H3, and use spatial indexing technology to quickly find driver points around each POI. By calculating the distance between the driver point and the POI, drivers near the POI are screened out to reduce unnecessary data processing.
[0085] The continuous trajectory data is split into independent entry events, stay events and exit events, and each event is marked, and the relevant timestamp and location information are recorded. The accuracy and efficiency of recognition are improved by performing statistical analysis on the split and marked events.
[0086] Second, the MaxCompute-based gas station stop behavior trajectory recognition system:
[0087] The system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the behavior trajectory recognition method as described above, and the processor is connected to:
[0088] (1) The data preprocessing module is responsible for reading the original driver location data from the database: including key information such as timestamp, longitude and latitude. At the same time, the data is thinned to reduce the amount of data and the complexity of subsequent processing. In addition, methods such as acceleration threshold are used to filter out abnormal locations to ensure the accuracy and reliability of the data.
[0089] The output is a cleaned and optimized driver location dataset.
[0090] (2) A trajectory smoothing and filling module for further processing the pre-processed driver trajectory data: This includes windowing the trajectory data, and then using spline interpolation to fill in the missing coordinates of the missing trajectory points within the time window to make the trajectory more continuous and smooth.
[0091] The output is the smoothed and padded driver trajectory data.
[0092] (3) Distance calculation and spatial indexing module for calculating the actual distance between driver trajectory points: Based on geographic calculation methods such as the Haversine formula, the POI points and driver locations are mapped to a grid indexing system such as H3. Spatial indexing technology is used to quickly find the driver points around each POI and filter out drivers near the POI.
[0093] The output is a list of driver locations near each POI and their distance to the POI.
[0094] (4) Behavior pattern recognition and optimization module for mining driver trajectory data: Identify the driver's behavior patterns of entering from outside the POI range, staying within the POI range, and leaving the POI range. At the same time, split the continuous trajectory data into independent entry events, stay events, and exit events, and mark and record each event.
[0095] The output is a split and labeled driver behavior event dataset.
[0096] (5) Gas station index aggregation and output module: Based on the split and marked events, key indicators such as the number of drivers passing through each gas station, the number of drivers staying at each gas station, and the length of stay of each driver are calculated. The calculation results are then output to a database or report for gas station operators to analyze and make decisions.
[0097] The output is a gas station operation indicator dataset and a visualization report.
[0098] Compared with the prior art, the present invention has the following beneficial effects:
[0099] 1. Improve data processing efficiency and accuracy: This invention effectively reduces the redundancy and erroneous data in the original data set through data thinning and outlier filtering, reduces the complexity and amount of calculation for subsequent processing, and improves the overall data processing efficiency. The trajectory smoothing and filling technology makes the driver's driving trajectory more continuous and smooth, providing a basic guarantee for accurately identifying the driver's behavior pattern.
[0100] 2. Realize refined behavior pattern recognition: The present invention can accurately identify the behavior patterns of drivers entering from outside the POI range, staying within the POI range, and leaving the POI range, providing detailed driver behavior data for gas station operators. The continuous trajectory is split into independent entry events, stay events, and exit events, and each event is marked and recorded, making the analysis of driver behavior more refined and in-depth.
[0101] 3. Provide personalized service and marketing strategy support: This invention provides comprehensive data support for gas station operators by calculating the number of drivers passing through each gas station, the number of drivers staying at each gas station, and the length of stay of each driver, so that they can make decisions and optimize based on data. Based on the behavior patterns of drivers and the flow of people at gas stations, gas station operators can formulate personalized services and marketing strategies to improve customer satisfaction and the competitiveness of gas stations.
[0102] 4. Improve operational efficiency and reduce costs: The present invention realizes the automation of data processing and analysis, reduces manual intervention and errors, and improves operational efficiency. By optimizing the data processing process and improving the accuracy of analysis, the present invention helps gas station operators reduce operating costs and improve profitability. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0104] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0105] Figure 2 This is a schematic diagram of the “driver trajectory” described in the first embodiment of the present invention;
[0106] Figure 3 It is a schematic diagram of the system composition of the present invention. DETAILED DESCRIPTION
[0107] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0108] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0109] Embodiment 1: Figures 1-2 As shown, this embodiment will provide an application of a MaxCompute-based gas station stop behavior trajectory recognition method in an online car-hailing platform, including the following process:
[0110] In this embodiment, regarding step S1, data preprocessing: reading the driver's location data of each day from the database to form a data set D, including timestamp t, longitude l and latitude d; using the acceleration threshold to filter out abnormal points in the data set D to ensure the accuracy and reliability of the data.
[0111] Specifically, step S100, read data: read the daily driver location data from the database of the online car-hailing platform to form a data set D, where each data point contains a timestamp t, longitude l and latitude d:
[0112] D={(t i ,l i ,d i )|i=1,2,…,n};
[0113] where t i is the i-th timestamp, l i is the i-th longitude, d i is the i-th latitude.
[0114] Specifically, step S101, data thinning: applying a data thinning algorithm to reduce the amount of data in the data set D. The data thinning algorithm is a preset screening strategy to remove redundant or unnecessary data points.
[0115] Exemplarily, time interval sampling or road network matching algorithm is applied to reduce the data volume of data set D and remove redundant or unnecessary data points.
[0116] Specifically, step S102, acceleration threshold filtering: calculate the velocity change between adjacent data points, and then estimate the acceleration. If the absolute value of the acceleration a is greater than the preset threshold T, the data point is filtered out to ensure the accuracy and reliability of the data.
[0117] In this embodiment, regarding step S2, trajectory smoothing and filling: windowing is performed on the data set D; for missing trajectory points within the time window, the missing coordinates are filled using the spline interpolation method.
[0118] Specifically, step S200, windowing processing: for each data point in the data set D, a time window size Δt is set to construct the data set D within the time window i For the data set D = {(t i ,l i ,d i )|i=1,2,…,n} and the set time window size Δt, each data point (t i ,l i ,d i ) corresponds to the data set D in the time window i It is expressed as:
[0119]
[0120] Specifically, step S201, fill in the missing coordinates using the spline interpolation method: for the time window D i The missing trajectory points within are filled using spline interpolation:
[0121] For example, assume that there are m known data points in the time window, and they are sorted by time as follows:
[0122] (ti1 ,l i1 ,d i1 ),(t i2 ,l i2 ,d i2 ),…,(t im ,l im ,d im );
[0123] For the missing time point t ij ′(where t ij <t ij ' <t ij+1 ), use cubic spline interpolation to calculate the corresponding longitude and latitude l ij ′ and d ij ′, so that:
[0124]
[0125] And S(t) in each subinterval [t ik ,t ik+1 ] is a polynomial on the entire interval and satisfies smoothness conditions (such as continuity or differentiability).
[0126] In this embodiment, regarding step S3, distance calculation and screening: the actual distance d between any geographic coordinate points in the two data sets D and the distance between the driver's trajectory points d' are calculated based on the Haversine formula. And the driver's trajectory data that did not drive on that day is filtered out according to the driver's driving record.
[0127] Specifically, step S300, calculate the distance d: use the Haversine formula to calculate the actual distance d between any two geographic coordinate points in the data set D, and the distance d' between the driver's trajectory point and the gas station:
[0128]
[0129] Here, r is the radius of the earth, which is 6371 kilometers.
[0130] The method for calculating the distance d' is to use the above Haversine formula to calculate for each driver's trajectory point (t', l', d').
[0131] Specifically, step S301, filtering the trajectory data of drivers who have not driven: according to the driver's driving record, filtering out the trajectory data of drivers who have not driven on that day, and only retaining the trajectory data of drivers who have driven.
[0132] For example, let the driver's driving records be a set R, where each element r is a time range, indicating the driver's driving time. For each driver's trajectory point (t', l', d'), check whether there is r∈R such that t' is within the time range of r. If there is no such r, filter out the trajectory point, otherwise keep it; the filtered data set is recorded as D', which only contains the trajectory data of drivers who drove on that day.
[0133] In this embodiment, regarding step S4, POI and driver position matching: for each POI point, query the driver trajectory point d' within the grid where it is located and the adjacent grids on each side. Calculate the distance between the queried driver trajectory point d' and the POI, and filter out the drivers near the POI.
[0134] Specifically, step S400, mapping to the H3 grid index system: mapping the gas station location and the driver trajectory point to the H3 level 7 grid index system, obtaining the corresponding grid index, and obtaining the corresponding grid (index) h POI and h'.
[0135] Specifically, step S401, querying the driver's track points in the adjacent grids: for each gas station location, querying the driver's track points in the grid where it is located and the adjacent grids on each side. Let the set of adjacent grids be N(h POI ), the query condition is:
[0136] h′∈{h POI}∪N(h POI );
[0137] Specifically, step S402, calculate the distance and screen the drivers: calculate the distance between each queried driver trajectory point and the gas station location, and screen out the drivers located near the gas station based on the distance threshold θ.
[0138] For example, for each driver trajectory point (l', d') found, the distance between it and the POI point (l POI ,d POI ) POI ' (Using the Haversine formula, as described in step S3).
[0139] Based on the distance threshold θ, drivers near the POI are selected, that is, those who meet d POI '≤θ;
[0140] It should be noted that the distance threshold θ is a distance range set according to actual needs, and is used to determine the specific business needs of “nearby”.
[0141] In this embodiment, regarding step S5, behavior pattern recognition and optimization: identify the patterns of driver trajectories entering, staying, and leaving outside the POI range. Then split the continuous trajectory into independent entry events, stay events, and exit events, mark them, and record relevant timestamps and location information.
[0142] Specifically, step S500 defines the driver's trajectory data as a series of timestamps and location points:
[0143] {(t1,loc1),(t2,loc2),…,(t n ,loc n )};
[0144] Among them, t i is the i-th timestamp, loc i is the i-th location point (including longitude and latitude).
[0145] Furthermore, the range of a POI (point of interest) is defined as an area represented by a center point and a radius, or represented by a polygon, such as POI = (center, radius); wherein center and radius are the center point and radius, respectively.
[0146] Specifically, in step S501, a judgment mechanism is executed:
[0147] (1) Entry event: When the driver's position enters the POI range for the first time from outside the POI range, an entry event is recorded. The conditional statement is as follows:
[0148] if distance(loc i ,center)≤radius and distance(loci) -1 ,center)>radiusthen Evententer=(t i ,loc i );
[0149] (2) Stay event: When the driver's position stays within the POI range for a period of time, a stay event is recorded. A time threshold can be set to determine the stay. The conditional statement is as follows:
[0150] if distance(loc i ,center)≤radius forΔt≥thresholdstay then Eventstay=[(tstart,locstart),(tend,locend)];
[0151] Where Δt is the time the driver stays within the POI range, and thresholdstay is the time threshold for judging the stay.
[0152] (3) Exit event: When the driver's position leaves the POI range, a exit event is recorded. The conditional statement is as follows:
[0153] if distance(loc i ,center)>radius and distance(loc i-1 ,center)≤radiusthen Eventleave=(t i ,loc i );
[0154] In this embodiment, regarding step S6, gas station index aggregation and output: based on the split and marked events, the number of drivers passing through each gas station per day, the number of drivers staying at the gas station per day, and the time each driver stays at the gas station are calculated.
[0155] Specifically, step S600, calculate the number of drivers passing through the gas station on a daily basis: for each gas station j, the number of drivers passing through the gas station on a daily basis (Npass,j) is obtained by calculating the number of all independent events passing through the gas station, including entry events and exit events, but without repeated counting.
[0156] This is done by iterating over the list of events and counting the unique identifier of each driver.
[0157] Specifically, step S601 calculates the number of drivers who stay per day: the number of drivers who stay per day (Nstay, j ) is to count the number of all independent drivers who have stopped at the gas station. This can also be achieved by traversing the event list and counting the unique identifiers of drivers who have stopped.
[0158] Specifically, step S602 calculates the time each driver spends at a gas station: for each driver i who has a stop event, the stop time T at gas station j is stay,i,j By calculating the difference between the start time and the end time of the driver's stop event, we can get: T stay,i,j =t end,i,j -t start,i,j ;
[0159] Among them, t start,i,j and tend,i,j are the start time and end time of driver i’s stop at gas station j, respectively.
[0160] In this embodiment, the Python execution program of the above steps S1 to S6 is as follows:
[0161]
[0162]
[0163]
[0164]
[0165]
[0166] Embodiment 2: Figure 2 As shown, based on the first embodiment, this embodiment further discloses a MaxCompute-based gas station stop behavior trajectory recognition system:
[0167] The system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the behavior trajectory recognition method as described above, and the processor is connected to:
[0168] (1) The data preprocessing module is responsible for reading the original driver location data from the database: including key information such as timestamp, longitude and latitude. At the same time, the data is thinned to reduce the amount of data and the complexity of subsequent processing. In addition, methods such as acceleration threshold are used to filter out abnormal locations to ensure the accuracy and reliability of the data.
[0169] The output is a cleaned and optimized driver location dataset.
[0170] (2) A trajectory smoothing and filling module for further processing the pre-processed driver trajectory data: This includes windowing the trajectory data, and then using spline interpolation to fill in the missing coordinates of the missing trajectory points within the time window to make the trajectory more continuous and smooth.
[0171] The output is the smoothed and padded driver trajectory data.
[0172] (3) Distance calculation and spatial indexing module for calculating the actual distance between driver trajectory points: Based on geographic calculation methods such as the Haversine formula, the POI points and driver locations are mapped to a grid indexing system such as H3. Spatial indexing technology is used to quickly find the driver points around each POI and filter out drivers near the POI.
[0173] The output is a list of driver locations near each POI and their distance to the POI.
[0174] (4) Behavior pattern recognition and optimization module for mining driver trajectory data: Identify the driver's behavior patterns of entering from outside the POI range, staying within the POI range, and leaving the POI range. At the same time, split the continuous trajectory data into independent entry events, stay events, and exit events, and mark and record each event.
[0175] The output is a split and labeled driver behavior event dataset.
[0176] (5) Gas station index aggregation and output module: Based on the split and marked events, key indicators such as the number of drivers passing through each gas station, the number of drivers staying at each gas station, and the length of stay of each driver are calculated. The calculation results are then output to a database or report for gas station operators to analyze and make decisions.
[0177] The output is a gas station operation indicator dataset and a visualization report.
[0178] All the above embodiments only express the implementation methods of the relevant practical applications of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
[0179] For those skilled in the art, it can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0180] At the same time, those skilled in the art can understand that all or part of the processes in all the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Claims
1. The MaxCompute-based method for identifying gas station stop behavior trajectories is characterized by: The steps include: S1, read the daily driver location data from the database to form a data set D, including timestamp t, longitude l and latitude d; S2, perform windowing on the data set D; for the missing trajectory points within the time window, fill in the missing coordinates; S3, calculating the actual distance d between any geographic coordinate points in the two data sets D and the distance between the driver's trajectory points d'; and filtering out the driver's trajectory data that did not drive on that day according to the driver's driving records; S4, for each POI point, query the driver trajectory point d' within the grid where it is located and the adjacent grids on each side; calculate the distance between the query driver trajectory point d' and the POI; S5, identifying the patterns of the driver's trajectory entering, staying, and leaving the POI; then splitting the continuous trajectory into independent entry events, stay events, and exit events, marking them, and recording relevant timestamps and location information; S6, based on the split and marked events, calculate the number of drivers passing through each gas station, the number of drivers staying at the gas station, and the time each driver stays at the gas station.
2. The behavior trajectory recognition method according to claim 1, characterized in that: The execution method of S1 includes: S100, data set D = {(t i ,l i ,d i )|i=1,2,…,n}; where t i is the i-th timestamp, l i is the i-th longitude, d i is the i-th latitude; S101, applying a data thinning algorithm to reduce the amount of data in the data set D; S102, calculate the speed change between adjacent data points, and then estimate the acceleration and judge it with the threshold T; if the acceleration a satisfies |a|>T, filter out the data point.
3. The behavior trajectory recognition method according to claim 1, characterized in that: The execution method of S2 includes: S200, for the data set D = {(t i ,l i ,d i )|i=1,2,…,n} and the set time window size Δt, each data point (t i ,l i ,d i ) corresponds to the data set D in the time window i for: S201, for time window D i The missing trajectory points within are filled using spline interpolation.
4. The behavior trajectory recognition method according to claim 3, characterized in that: The spline interpolation method is a cubic spline interpolation method: Assume that there are m known data points in the time window and they are sorted by time as follows: (t i1 ,l i1 ,d i1 ),(t i2 ,l i2 ,d i2 ),…,(t im ,l im ,d im ); For the missing time point t ij ′(where t ij <t ij ' <t ij+1 ), use cubic spline interpolation to calculate the corresponding longitude and latitude l ij ′ and d ij ′, and based on the spline function S(t) in each subinterval [t ik ,t ik+1 ] is a polynomial and satisfies the smoothness condition on the entire interval, such that:
5. The behavior trajectory recognition method according to claim 1, characterized in that: The implementation method of S3 includes: for any two geographic coordinate points (l i ,d i ) and (l j ,d j ), use the Haversine formula to calculate the actual distance d between them: Where r is the radius of the Earth; The method for calculating the distance d' is to use the above Haversine formula to calculate for each driver's trajectory point (t', l', d').
6. The behavior trajectory recognition method according to claim 5, characterized in that: In S3, the driver's driving records are set R, where each element r is a time range. For each driver's trajectory point (t', l', d'), check whether there is r∈R such that t' is within the time range of r; if not, filter out the trajectory point, otherwise retain it.
7. The behavior trajectory recognition method according to claim 1, characterized in that: The implementation method of S5 includes: S400, set the POI point ( lPOI ,d POI ) and the driver trajectory point (l', d') are mapped to the H3 level 7 grid index system, and the corresponding grid h POI and h'; S401, for each POI point, query the grid h where it is located POI and the driver’s trajectory points (l’, d’) within the adjacent grids on each side; S402, for each driver trajectory point (l', d') found, calculate its distance from the POI point (l POI ,d POI ) POI ', based on the distance threshold θ, the drivers near the POI are screened out, that is, satisfying d POI '≤θ.
8. The behavior trajectory recognition method according to claim 1, characterized in that: The implementation method of S5 includes: When the driver's position enters the POI range for the first time from outside the POI range, an entry event is recorded; When the driver's position stays within the POI range for a period of time, a stay event is recorded; When the driver's position leaves the POI range, a leaving event is recorded.
9. The MaxCompute-based gas station stop behavior trajectory recognition system is characterized by: The system includes a processor and a memory connected to the processor, wherein program instructions are stored in the memory, and when the program instructions are executed by the processor, the processor executes the behavior trajectory recognition method as described in any one of claims 1-8.
10. The behavior trajectory recognition system according to claim 9, characterized in that: The processor is connected with, A data preprocessing module responsible for reading the original driver location data from the database; A trajectory smoothing and filling module that processes the preprocessed driver trajectory data; A distance calculation and spatial indexing module that calculates the actual distance between driver trajectory points; A behavior pattern recognition and optimization module that mines driver trajectory data.
Citation Information
Patent Citations
Hot spot identification method and system for trajectory data
CN118427457A
Virtual Grid Dictionary Based Target Heading Class Intention Recognition Method and Device
US20220018660A1
