Method, device and equipment for spatiotemporal trajectory completion based on big data, and medium
By using big data technology and least squares fitting curves to calculate trajectory similarity, the discontinuity problem caused by the loss of positional information in spatiotemporal trajectories is solved, and efficient and accurate trajectory completion is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 深圳市恒扬数据股份有限公司
- Filing Date
- 2023-05-25
- Publication Date
- 2026-04-10
AI Technical Summary
In the field of spatiotemporal trajectory calculation, the loss of location information leads to discontinuous trajectories, and existing technologies are unable to efficiently and with low complexity draw complete trajectories.
Based on big data technology, the trajectory similarity is calculated by fitting curves using the least squares method, and the trajectory similarity is calculated by the cosine similarity of the angle between the lines. Combining spatiotemporal information, the trajectory with the highest matching degree is selected for completion.
It achieves low-complexity and high-efficiency trajectory completion, improving the accuracy of trajectory matching and computational performance.
Smart Images

Figure CN116662315B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of spatiotemporal trajectory calculation, and in particular to a method, apparatus, device and medium for spatiotemporal trajectory completion based on big data. Background Technology
[0002] In the field of spatiotemporal trajectory calculation, when a target moves, its position and time will change. Based on this spatiotemporal information, the target's activity trajectory can be drawn, such as the trajectory of a pedestrian walking, cycling, driving, the flight trajectory of an aircraft, the activity trajectory of an animal, etc. However, due to the uncertainty of equipment or signals, its position information may be lost in certain time periods. This will result in multiple segmented trajectories or blank trajectories, making it difficult to draw a reasonable and complete trajectory.
[0003] Therefore, in the field of spatiotemporal trajectory calculation, if location information is lost for certain time periods, how to provide a drawing method with low computational complexity and high computational performance to draw a reasonable and complete trajectory is an urgent problem to be solved. Summary of the Invention
[0004] The main purpose of this application is to provide a method, apparatus, device and medium for spatiotemporal trajectory completion based on big data. It aims to solve the technical problem in the field of spatiotemporal trajectory calculation where location information is lost in certain time periods. This problem requires a drawing method with low computational complexity and high computational performance to draw a reasonable and complete trajectory.
[0005] To achieve the aforementioned objectives, this application proposes a method for spatiotemporal trajectory completion based on big data technology, the method comprising:
[0006] Acquire trajectory data of a specified target, wherein the trajectory data includes location information and time information;
[0007] Generate a coordinate map of the trajectory to be completed based on the location information;
[0008] If there are blank trajectories in the coordinate graph of the trajectory to be completed, then the similarity between the trajectory to be completed and the approximate trajectory in the historical trajectory is calculated based on the disconnection points of the blank trajectory.
[0009] The blank trajectory is completed based on the approximate trajectory with similarity within a specified threshold;
[0010] The matching degree is calculated based on the completed trajectory, and the completed trajectory with the highest matching degree is retained.
[0011] Further, the longitude and latitude data in the location information are obtained;
[0012] The longitude and latitude data are then converted into X-coordinate and Y-coordinate data respectively.
[0013] The points corresponding to the X-coordinate data and the Y-coordinate data are connected in chronological order to generate a coordinate map of the trajectory to be completed.
[0014] Further, obtain the timestamp information of the trajectory to be completed;
[0015] If the time interval between adjacent timestamps is greater than a specified threshold, it is determined that there is a blank trajectory.
[0016] Further, determine whether there is a trajectory in the historical trajectory that passes through the range specified by the break point;
[0017] If so, it is determined to be an approximate trajectory.
[0018] Further, let the trajectory to be completed be A, and the approximate trajectory be B. Use the least squares method to find the approximate straight lines at the break points of the trajectory and the approximate trajectory, where the coordinate values are selected according to a preset range.
[0019] Using formula Calculate the similarity S; where k Ab k represents the direction vector of trajectory A at the break point b. Bb k represents the direction vector of the approximate trajectory B at the break point b. Ac k represents the direction vector of trajectory A at the break point c. Bc The direction vector represents the approximate trajectory B at the break point c; the direction vector can be obtained by using the slope of the approximate straight line obtained by the least squares method.
[0020] Furthermore, the completed trajectory is divided into three line segments: ab, bc, and cd, where bc is a line segment composed of two adjacent disconnected points;
[0021] According to the formula Calculate the mismatch degree M between line bc and lines ab and cd; where: It is the average velocity calculated using the completed trajectory. It is the average speed calculated by removing the blank trajectory from the trajectory to be completed.
[0022] Further, obtain the calculated value of M and sort it;
[0023] Based on the sorting results, retain the complete trajectory with the smallest corresponding M value.
[0024] A second aspect of this application proposes a spatiotemporal trajectory completion device based on big data technology, the device comprising:
[0025] The trajectory data acquisition module is used to acquire trajectory data of a specified target, wherein the trajectory data includes location information and time information;
[0026] A coordinate generation module is used to generate a coordinate map of the trajectory to be completed based on the location information.
[0027] The similarity calculation module is used to calculate the similarity between the trajectory to be completed and the approximate trajectory in the historical trajectory based on the disconnection points of the blank trajectory in the coordinate map of the trajectory to be completed.
[0028] The trajectory completion module is used to complete the blank trajectory based on the approximate trajectory with a similarity within a specified threshold.
[0029] The final filtering module is used to calculate the matching degree based on the completed trajectory and retain the completed trajectory with the highest matching degree.
[0030] A third aspect of this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.
[0031] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0032] This application provides a method for spatiotemporal trajectory completion based on big data technology. This application utilizes big data technology to propose a new spatiotemporal trajectory completion algorithm. In a large amount of historical trajectory data, the least squares method is used to fit curves with straight lines, and the trajectory similarity is calculated using the cosine similarity of the angle between the straight lines. The trajectory routes to be matched are preliminarily selected. Then, the spatiotemporal information is fully utilized to calculate the matching degree between the completed trajectory and the original trajectory, and the trajectory with the highest matching degree is selected as the complete target activity trajectory route.
[0033] The method for calculating trajectory similarity in this application has low complexity and high computational performance. Moreover, by comprehensively considering the incident and outgoing direction information of the blank trajectory, it achieves high accuracy in trajectory matching. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating a spatiotemporal trajectory completion method based on big data technology according to an embodiment of this application.
[0035] Figure 2 A schematic block diagram of a spatiotemporal trajectory completion device based on big data technology according to an embodiment of this application;
[0036] Figure 3This is a schematic block diagram of the structure of a computer device according to an embodiment of this application;
[0037] Figure 4 This is a schematic diagram of the coordinates of the trajectory to be completed in one embodiment of this application;
[0038] Figure 5 This is a coordinate diagram of the trajectory to be completed and the approximate trajectory in one embodiment of this application;
[0039] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0041] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0042] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0043] Reference Figure 1 This invention provides a method for spatiotemporal trajectory completion based on big data technology, including steps S1-S5, specifically:
[0044] S1. Obtain trajectory data of a specified target, wherein the trajectory data includes location information and time information.
[0045] First, based on a specified target in the database, the trajectory data of that target is obtained. The specified target can be single or multiple and contains various types of keywords. The trajectory data includes location information and time information. The location information includes latitude and longitude information. The time information represents the time node of the target's current latitude and longitude. The time can be stored in the database in the form of a timestamp and retrieved and called.
[0046] S2. Generate a coordinate map of the trajectory to be completed based on the location information.
[0047] Based on the location information in the acquired trajectory data, the location information is converted into coordinate points. The specific coordinate conversion method can refer to map-related conversion technologies. The converted coordinate points are connected in chronological order to form a continuous trajectory path, which can generate a coordinate map of the trajectory to be completed. If the trajectory data is missing some location information in a certain period of time, it will cause the trajectory to be discontinuous, and subsequent completion processing is required.
[0048] S3. If there is a blank trajectory in the coordinate graph of the trajectory to be completed, then the similarity between the trajectory to be completed and the approximate trajectory in the historical trajectory is calculated based on the disconnection points of the blank trajectory.
[0049] If there are blank trajectories in the generated trajectory to be completed, i.e., discontinuous parts of the trajectory, they can be completed by approximate trajectories in historical trajectories. Specifically, based on the break points of the blank trajectory, points in historical trajectories that are close to or close to it can be found, and the similarity between the two can be calculated.
[0050] S4. Complete the blank trajectory based on the approximate trajectory with similarity within a specified threshold.
[0051] If there are several historical trajectories that are similar to the blank trajectory within a certain threshold range, then this historical trajectory information can be used to complete the missing trajectory at the blank trajectory, thereby making the trajectory to be completed complete and continuous.
[0052] S5. Calculate the matching degree based on the completed trajectory and retain the completed trajectory with the highest matching degree.
[0053] Since there are several similar trajectories within a certain threshold range, it is necessary to calculate the matching degree for the completed trajectory that has already been completed, and then select the completed trajectory with the highest matching value based on the calculated matching degree.
[0054] As described above, this embodiment utilizes big data technology to propose a novel spatiotemporal trajectory completion algorithm. From a large amount of historical trajectory data, the least squares method is used to fit curves using straight lines. The trajectory similarity is calculated using the cosine similarity of the angle between the straight lines, initially pre-selecting trajectory routes to be matched. Then, by fully utilizing spatiotemporal information, the matching degree between the completed trajectory and the original trajectory is calculated, and the trajectory with the highest matching degree is selected as the complete target activity trajectory route. The method for calculating trajectory similarity in this application has low complexity and high computational efficiency. Furthermore, by comprehensively considering the incident and exit direction information of the blank trajectory, it achieves high accuracy in trajectory matching.
[0055] In one embodiment, the step of generating the coordinate map of the trajectory to be completed based on the location information includes:
[0056] S101. Obtain the longitude and latitude data from the location information;
[0057] S102. Convert the longitude and latitude data into X-coordinate data and Y-coordinate data respectively;
[0058] S103. Connect the points corresponding to the X coordinate data and the y coordinate data in chronological order to generate a coordinate map of the trajectory to be completed.
[0059] In this embodiment, a method is used to convert the latitude and longitude carried in the location information into coordinate data and generate a trajectory map to be completed. Specifically, taking the driving trajectory of a vehicle as an example, the latitude and longitude information of the vehicle at a certain moment can be obtained, and then processed into point coordinate data according to the method. Connecting these points in chronological order can obtain the driving trajectory of the vehicle. Converting the location information into coordinate data makes it easier to analyze and process it, such as performing data visualization, generating trajectory maps, etc. It is easier to grasp the driving situation of the trajectory and understand the inherent pattern of the data, which is very important for subsequent trajectory analysis and processing, and helps to conduct further analysis and comparison based on image information.
[0060] In one embodiment, after the step of generating the coordinate map of the trajectory to be completed based on the location information, the following steps are included:
[0061] S201. Obtain the timestamp information of the trajectory to be completed;
[0062] S202. If the time interval between adjacent timestamps is greater than the specified threshold, it is determined that there is a blank trajectory.
[0063] In this embodiment, it is necessary to obtain the timestamp information of the trajectory to be completed and set a time threshold in advance. The timestamp refers to the time point recorded when the trajectory to be completed is sampled, and it is usually used to represent the time interval between trajectory points. If the time interval between two adjacent timestamps is greater than the specified time threshold, it can be determined that there is a blank trajectory between these two timestamps. For example, if a series of geographical location data and timestamp information are obtained based on the vehicle's GPS information, we can arrange the data in chronological order. When the time interval between adjacent timestamps is greater than the set threshold, the trajectory part between these two timestamps can be determined as a blank trajectory.
[0064] like Figure 4 As shown, the dashed line in segment bc represents the blank trajectory caused by missing data in the trajectory to be completed.
[0065] By setting time thresholds to identify blank tracks, potentially missed or lost track data can be quickly discovered, avoiding errors and impacts caused by missing data, improving the accuracy of data analysis results, reducing the need for manual intervention, and improving data processing efficiency and accuracy.
[0066] In one embodiment, before the step of calculating the similarity between the trajectory to be completed and the approximate trajectory in the historical trajectory based on the break points of the blank trajectory, the following steps are included:
[0067] S301. Determine whether there is a trajectory in the historical trajectory that passes through the specified range of the disconnection point;
[0068] S302. If present, it is determined to be an approximate trajectory.
[0069] In this embodiment, historical trajectory data is required, including the latitude and longitude information and timestamp information of each trajectory point, as well as the location information of the disconnection points of the current trajectory to be completed. Optionally, the area where the disconnection point is located can be divided into a circular region, and a radius threshold can be set. This radius threshold can be the same as the disconnection point. Then, for each trajectory point in the historical trajectory, it is determined whether it falls within the circular region. If a trajectory point falls within the circular region and the distance between the landing point and the disconnection point is less than the set radius threshold, it can be determined as an approximate trajectory. For example, if a vehicle encounters a signal blind spot during a certain period, resulting in a disconnection point in the trajectory data, we can use this method to determine whether there are trajectory points that pass through the disconnection point and whether these trajectory points constitute an approximate trajectory. This method can identify approximate trajectories, that is, trajectories formed by trajectory points re-collected after encountering a disconnection point, thereby providing a more comprehensive understanding of the vehicle's driving situation and providing strong support for subsequent data analysis and vehicle operation management. For situations where disconnection points exist in the trajectory data due to sudden situations such as signal blind spots, determining whether an approximate trajectory exists can enhance the robustness of the data and reduce the impact of data anomalies on the analysis results.
[0070] In one embodiment, the step of calculating the similarity between the trajectory to be completed and approximate trajectories in historical trajectories based on the disconnection points of the blank trajectory includes:
[0071] S401. Let the trajectory to be completed be A, and the approximate trajectory be B. Use the least squares method to find the approximate straight lines at the break points of the trajectory and the approximate trajectory, where the coordinate values are selected according to a preset range.
[0072] S402, Using the formula Calculate the similarity S; where k Ab k represents the direction vector of trajectory A at the break point b. Bb k represents the direction vector of the approximate trajectory B at the break point b. Ac k represents the direction vector of trajectory A at the break point c. Bc The direction vector represents the approximate trajectory B at the break point c; the direction vector can be obtained by using the slope of the approximate straight line obtained by the least squares method.
[0073] In this embodiment, the linear equation obtained by the least squares method is used to fit the trajectory curve, and then the cosine of the included angle is used to approximate the trajectory similarity. The least squares method is a commonly used regression analysis method used to find a linear model to describe the relationship between the independent and dependent variables. Its basic idea is to find a straight line that minimizes the sum of the squared distances between the line and the data points.
[0074] (Assuming there are n data points, the independent variable is x, and the dependent variable is y), the steps of the least squares method are as follows:
[0075] Establish a linear regression model; assuming a linear relationship between y and x, the following linear regression model can be established:
[0076] y = β0 + β1 * x
[0077] Where β0 and β1 represent the intercept and slope, respectively.
[0078] Define the error function; assuming the coordinates of the i-th data point are (xi, yi) and the predicted value is y^i, then the error of the i-th data point is:
[0079] ei=yi-y^i
[0080] The squared error is:
[0081] ei^2=(yi-y^i)^2
[0082] The sum of the squared errors of all data points is:
[0083] S = ∑(ei^2)
[0084] Solve for the parameters that minimize the error function; minimize the error function S by solving for β0 and β1. The least-squares estimates of β0 and β1 can be obtained by taking partial derivatives.
[0085] β1=(∑(xi-x ˉ (yi-y) ˉ )) / (∑(xi-x ˉ )^2)
[0086] β0=y - -β1*x
[0087] Where, x ˉ and y ˉ Let x and y be the average values, respectively, so that the equation of the line y = β0 + β1*x can be found.
[0088] like Figure 5 As shown, assuming there are two trajectories, the thick line A is the trajectory to be completed, and B is an approximate trajectory that passes through points b and c in the historical trajectory. The similarity between the two trajectories can be solved by the following steps.
[0089] Based on the above formula for solving the least squares method, we can obtain:
[0090] The approximate straight line of trajectory A at point b is: y Ab =K Ab x+B Ab
[0091] The approximate straight line of trajectory A at point c is: y Ac =K Ac x+B Ac
[0092] The approximate straight line of trajectory B at point b is: y Bb =K Bb x+B Bb
[0093] The approximate straight line of trajectory B at point c is: y Bc =K Bc x+B Bc During the calculation process, the coordinates of 10-20 points near the original coordinate can be selected and substituted into the calculation.
[0094] The similarity S between trajectories A and B can be calculated using the following formula:
[0095]
[0096] Where: k Ab =(K Ab ,1), k Bb =(K Bb ,1)k Bb =(K Bb ,1), k Ac =(K Ac ,1), k Bc =(K Bc ,1), · represents dot product;
[0097] In summary, the similarity S between two trajectories can be calculated quickly. The overall steps are simple and the algorithm complexity is not high. Even when faced with a large number of trajectories, the similarity can be calculated quickly.
[0098] In one embodiment, the above-mentioned step of calculating the matching degree based on the completed trajectory includes:
[0099] S501. Divide the completed trajectory into three line segments ab, bc, and cd according to the break points, where bc is a line segment formed by two adjacent break points;
[0100] S502, According to the formula Calculate the mismatch degree M between line bc and lines ab and cd; where: It is the average velocity calculated using the completed trajectory. It is the average speed calculated by removing the blank trajectory from the trajectory to be completed.
[0101] In this embodiment, after similarity threshold filtering, most trajectories are filtered out. Based on the approximate trajectories with similarity within a specified threshold, the blank trajectories are completed. Then, time information is used to calculate the matching degree of the completed trajectories. Analysis shows that the trajectory of a moving target should be smooth, and the motion information of the blank trajectory is likely consistent with the running information of the recorded trajectory. This can be understood as the average speed between b and c not differing significantly from the speeds between a, b and c, d. Since the line between b and c is blank, its motion state—whether it is accelerating, decelerating, or moving at a constant speed—is unknown. However, since ab, bc, and cd are all trajectories of target A, their motion information is roughly consistent. This patent uses the following formula to measure the mismatch degree M between line bc and lines ab and cd:
[0102]
[0103] in: It is the average velocity calculated using the completed trajectory. It is the average velocity calculated by removing blank trajectories from the trajectory to be completed;
[0104] This allows us to calculate the mismatch between the current completed trajectory segment bc and the other two segments.
[0105] In one embodiment, the step of retaining the completed trajectory with the highest matching degree includes:
[0106] S601. Obtain the calculated value of M and sort it.
[0107] S602. Based on the sorting results, retain the complete trajectory with the smallest corresponding M value.
[0108] In this embodiment, the completed trajectory corresponding to the minimum M value is the trajectory with the highest matching degree. This embodiment selects the completed trajectory with the highest matching degree for retention.
[0109] Reference Figure 2 In one embodiment, the above-mentioned spatiotemporal trajectory completion device based on big data technology includes:
[0110] The trajectory data acquisition module 100 is used to acquire trajectory data of a specified target, wherein the trajectory data includes location information and time information;
[0111] The coordinate generation module 200 is used to generate a coordinate map of the trajectory to be completed based on the location information.
[0112] The similarity calculation module 300 is used to calculate the similarity between the trajectory to be completed and the approximate trajectory in the historical trajectory based on the break points of the blank trajectory in the coordinate map of the trajectory to be completed.
[0113] The trajectory completion module 400 is used to complete the blank trajectory based on the approximate trajectory with a similarity within a specified threshold.
[0114] The final filtering module 500 is used to calculate the matching degree based on the completed trajectory and retain the completed trajectory with the highest matching degree.
[0115] In one embodiment, the coordinate generation module 200 includes:
[0116] The latitude and longitude acquisition unit is used to acquire the longitude and latitude data in the location information;
[0117] The data conversion unit is used to convert the longitude and latitude data into X-coordinate data and Y-coordinate data respectively;
[0118] The sequential connection unit is used to connect the points corresponding to the X coordinate data and the Y coordinate data in chronological order to generate a coordinate map of the trajectory to be completed.
[0119] In one embodiment, the blank determination module includes:
[0120] A timestamp acquisition unit is used to acquire the timestamp information of the trajectory to be completed.
[0121] An interval exists as a unit, which is used to determine that a blank trajectory exists if the time interval between adjacent timestamps is greater than a specified threshold.
[0122] In one embodiment, the approximation determination module includes:
[0123] The judgment unit is used to determine whether there is a trajectory in the historical trajectory that passes through the range specified by the disconnection point;
[0124] There exists an approximate unit, which is used to determine if it is an approximate trajectory.
[0125] In one embodiment, the similarity calculation module 300 includes:
[0126] The least squares unit is used to find the approximate straight lines at the break points of the trajectory to be completed (A) and the approximate trajectory (B) using the least squares method, where the coordinate values are selected according to a preset range.
[0127] The included angle cosine unit is used to apply the formula Calculate the similarity S; where k Ab k represents the direction vector of trajectory A at the break point b. Bb k represents the direction vector of the approximate trajectory B at the break point b. Ac k represents the direction vector of trajectory A at the break point c.Bc The direction vector represents the approximate trajectory B at the break point c; the direction vector can be obtained by using the slope of the approximate straight line obtained by the least squares method.
[0128] In one embodiment, the final screening module 500 includes:
[0129] A line segment segmentation unit is used to divide the completed trajectory into three line segments ab, bc, and cd according to the break points, where bc is a line segment composed of two adjacent break points;
[0130] Calculation unit, used to calculate according to formula Calculate the mismatch degree M between line bc and lines ab and cd; where: It is the average velocity calculated using the completed trajectory. It is the average speed calculated by removing the blank trajectory from the trajectory to be completed.
[0131] In one embodiment, the final screening module 500 includes:
[0132] The M-value acquisition unit is used to obtain the calculated value of M and sort it.
[0133] The optimal unit is retained, which is used to retain the complete trajectory with the smallest corresponding M value based on the sorting results.
[0134] Reference Figure 3 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data used in the spatiotemporal trajectory completion method based on big data technology. The network interface allows communication with external terminals via a network connection. Furthermore, the computer device may also include input devices and a display screen. When the aforementioned computer program is executed by a processor, it implements a method for spatiotemporal trajectory completion based on big data technology, comprising the following steps: acquiring trajectory data of a specified target, wherein the trajectory data includes location information and time information; generating a coordinate map of the trajectory to be completed based on the location information; if there are blank trajectories in the coordinate map of the trajectory to be completed, calculating the similarity between the trajectory to be completed and approximate trajectories in historical trajectories based on the disconnection points of the blank trajectories; completing the blank trajectories according to the approximate trajectories with similarity within a specified threshold; calculating the matching degree based on the completed trajectory, and retaining the completed trajectory with the highest matching degree.
[0135] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0136] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements a method for spatiotemporal trajectory completion based on big data technology, comprising the following steps: acquiring trajectory data of a specified target, wherein the trajectory data includes location information and time information; generating a coordinate map of the trajectory to be completed based on the location information; if there is a blank trajectory in the coordinate map of the trajectory to be completed, then calculating the similarity between the trajectory to be completed and an approximate trajectory in historical trajectories based on the break points of the blank trajectory; completing the blank trajectory according to the approximate trajectory whose similarity is within a specified threshold; calculating the matching degree based on the completed trajectory, and retaining the completed trajectory with the highest matching degree.
[0137] It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and 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. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0139] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0140] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for spatiotemporal trajectory completion based on big data technology, characterized in that, The method comprises: acquiring trajectory data of a specified target, wherein the trajectory data comprises position information and time information; generating a to-be-completed trajectory coordinate graph based on the position information; if there is a blank trajectory in the to-be-completed trajectory coordinate graph, calculating the similarity between the to-be-completed trajectory and an approximate trajectory in historical trajectories based on a disconnected point of the blank trajectory; the step of calculating the similarity between the to-be-completed trajectory and the approximate trajectory in the historical trajectories based on the disconnected point of the blank trajectory comprises: assuming that the to-be-completed trajectory is A and the approximate trajectory is B, using the least square method to calculate the approximate straight line of the to-be-completed trajectory and the approximate trajectory at the disconnected point, wherein the value of the coordinates is selected according to a preset range; The similarity S is calculated using the formula wherein represents the direction vector of the trajectory A at the break point b, represents the direction vector of the approximation trajectory B at the break point b, represents the direction vector of the trajectory A at the break point c, represents the direction vector of the approximation trajectory B at the break point c; the direction vectors are represented by the slope of the straight line approximated by the least squares method; completing the blank trajectory according to the approximate trajectory with a similarity within a specified threshold to obtain a completed trajectory; performing matching degree calculation based on the completed trajectory and retaining the completed trajectory with the highest matching degree; the step of performing matching degree calculation based on the completed trajectory and retaining the completed trajectory with the highest matching degree comprises: dividing the completed trajectory into three line segments ab, bc and cd according to the disconnected points, wherein bc is a line segment composed of two adjacent disconnected points; According to the formula , the mismatch degree M of the bc line segment with the ab line segment and the cd line segment is calculated; wherein: is the average speed calculated using the completed trajectory, is the average speed calculated by removing the blank trajectory from the to-be-completed trajectory; acquiring the calculation value of M and sorting it; retaining the completed trajectory corresponding to the smallest M value according to the sorting result, and the completed trajectory corresponding to the smallest M value is the trajectory with the highest matching degree; before the step of calculating the similarity between the to-be-completed trajectory and the approximate trajectory in the historical trajectories based on the disconnected point of the blank trajectory, the method comprises: judging whether there is a trajectory passing through a specified range of the disconnected point in the historical trajectories; if yes, determining that it is an approximate trajectory.
2. The method for spatiotemporal trajectory completion based on big data technology according to claim 1, characterized in that, the step of generating the to-be-completed trajectory coordinate graph based on the position information comprises: acquiring the longitude data and latitude data in the position information; correspondingly converting the longitude data and latitude data into X coordinate data and Y coordinate data; connecting the points corresponding to the X coordinate data and the Y coordinate data in time sequence to generate the to-be-completed trajectory coordinate graph. 3.The method of spatiotemporal trajectory completion based on big data technology according to claim 1, characterized in that, after the step of generating the to-be-completed trajectory coordinate graph based on the position information, the method comprises: acquiring the timestamp information of the to-be-completed trajectory; if the interval time between adjacent timestamps is greater than a specified threshold, determining that there is a blank trajectory.
4. An apparatus for spatiotemporal trajectory completion based on big data technology, configured to implement the method for spatiotemporal trajectory completion based on big data technology according to any one of claims 1-3. The device comprises: a trajectory data acquisition module for acquiring trajectory data of a specified target, wherein the trajectory data comprises position information and time information; a coordinate generation module for generating a to-be-completed trajectory coordinate graph based on the position information; a similarity calculation module for calculating the similarity between the to-be-completed trajectory and an approximate trajectory in historical trajectories based on a disconnected point of the blank trajectory if there is a blank trajectory in the to-be-completed trajectory coordinate graph; a trajectory completion module for completing the blank trajectory according to the approximate trajectory with a similarity within a specified threshold to obtain a completed trajectory; a final screening module for performing matching degree calculation based on the completed trajectory and retaining the completed trajectory with the highest matching degree. The processor implements the steps of the method of any one of claims 1 to 3 when executing the computer program. 5.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-4 when the computer program is executed by the processor. The processor implements the steps of the method of any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Trajectory data processing method and device and electronic equipment
CN110727757A
Track data complementation and traffic flow prediction method based on space-time buffer
CN114297328A