Trajectory restoration method and device, storage medium and electronic device
Through the combination of multi-head attention mechanism and road network information, the accuracy of vehicle trajectory restoration under sparse position information is solved, and a higher precision trajectory restoration is achieved.
Patent Information
- Application Number
- CN202210023475.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-12-16
- Filing Date
- 2022-01-10
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-01-10
AI Technical Summary
The accuracy and accuracy of vehicle trajectory restoration in the case of sparse position information in the prior art are poor.
By obtaining the target position set of target devices, using the multi-head attention mechanism model for position aggregation, combining the target road network information, the target movement trajectory is determined, and trajectory supplementation and optimization are performed through historical position correspondence information and road network information.
The accuracy of trajectory restoration is improved, especially in the case of sparse position information, and the accuracy and integrity of trajectory restoration are enhanced.
Smart Images

Figure CN114428888B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular, to a trajectory restoration method, an apparatus, a storage medium, and an electronic device. Background Art
[0002] In the related art, in the trajectory restoration of a vehicle, the vehicle is usually positioned by the position information of the vehicle (for example, GPS information), and the trajectory of the vehicle is restored based on the position information of the vehicle. This method has better accuracy for the trajectory restoration of relatively dense position information, but has poor performance and accuracy in the case of sparse position information.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of the present invention provide a trajectory restoration method, an apparatus, a storage medium, and an electronic device to at least solve the technical problem of low accuracy of trajectory restoration.
[0005] According to one aspect of the embodiments of the present invention, a trajectory restoration method is provided, including: obtaining a target position set of a target device; aggregating the positions in the target position set, and obtaining a first target movement trajectory of the target device through a multi-head attention mechanism model; obtaining target road network information, and adsorbing the positions in the target position set onto multiple roads in the target road network information to obtain a second target movement trajectory of the target device; determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0006] Optionally, the aggregating the positions in the target position set and obtaining a first movement trajectory of the target device through a multi-head attention mechanism model includes: aggregating the positions in the target position set to obtain a first movement trajectory, where the first movement trajectory includes some positions in the target position set; searching for the movement trajectories corresponding to each position in a first position subset in the pre-recorded historical position correspondence information to obtain a first movement trajectory set, where the first position subset includes the positions in the target position set except for the some positions, and the historical position correspondence information records multiple groups of historical positions and movement trajectories with a corresponding relationship, and the positions in the historical position correspondence information include the historical positions of the target device, or include the historical positions of multiple devices; determining the first movement trajectory and the first movement trajectory set as the first target movement trajectory.
[0007] Optionally, searching for the movement trajectories corresponding to each position in the first position subset in the pre-recorded historical position correspondence information to obtain a first set of movement trajectories includes: searching for the movement trajectory corresponding to the current position in the first position subset in the historical position correspondence information through the following steps: determining a set of historical positions in the historical position correspondence information whose similarity to the current position is greater than or equal to a preset value, and determining the movement trajectories corresponding to each historical position in the set of historical positions to obtain a second set of movement trajectories; determining the movement trajectory corresponding to the current position in the second set of movement trajectories.
[0008] Optionally, determining the movement trajectory corresponding to the current position in the second set of movement trajectories includes: determining the weight of each movement trajectory in the second set of movement trajectories according to a multi-head attention mechanism model, where the multi-head attention mechanism model is a model obtained through self-learning using the historical position correspondence information; determining the movement trajectory with the largest weight in the second set of movement trajectories as the movement trajectory corresponding to the current position.
[0009] Optionally, adsorbing the positions in the target position set to multiple roads included in the target road network information to obtain a second target movement trajectory of the target device includes: when the positions in the target position set are all located on the multiple roads, determining the trajectory formed by the roads where the positions in the target position set are located as the second target movement trajectory.
[0010] Optionally, adsorbing the positions in the target position set to multiple roads included in the target road network information to obtain a second target movement trajectory of the target device further includes: when some of the positions in the target position set are located on the multiple roads, determining the trajectory formed by the roads where the some positions are located as the second movement trajectory; determining the second set of movement trajectories according to each position in the second position subset and the adjacent positions of each position in the second position subset, where the second position subset includes the positions in the target position set except the some positions, and the adjacent position of each position in the second position subset is the position adjacent to each position in the target position set sorted in the order of positioning time; determining the second movement trajectory and the second set of movement trajectories as the second target movement trajectory.
[0011] Optionally, determining the second set of movement trajectories according to each position in the second subset of positions and the adjacent positions of each position in the second subset of positions includes: performing the following steps for each position in the second subset of positions. When performing the following steps, each position in the second subset of positions is the current position: determining a first set of roads in the plurality of roads whose distance from the current position is less than or equal to a first distance threshold; determining a second set of roads in the plurality of roads whose distance from the adjacent position of the current position is less than or equal to a second distance threshold; determining the movement trajectory corresponding to the current position according to the first set of roads and the second set of roads, where the movement trajectory corresponding to the current position is included in the second set of movement trajectories.
[0012] Optionally, determining the movement trajectory corresponding to the current position according to the first set of roads and the second set of roads includes: determining the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first set of roads and the second set of roads, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a first preset value; or determining the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first set of roads and the second set of roads, where the number of turns from the current position along the movement trajectory corresponding to the current position to the connected position of the current position is less than or equal to a second preset value; or determining the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first set of roads and the second set of roads, where the turning angle from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a third preset value; or determining the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first set of roads and the second set of roads, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to the first preset value, and the number of turns is less than or equal to the second preset value, and the turning angle is less than or equal to the third preset value; or determining the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first set of roads and the second set of roads, where the speed limit of the movement trajectory corresponding to the current position matches the speed of the target device moving from the current position to the adjacent position of the current position.
[0013] Optionally, determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory includes: determining, as the target movement trajectory, the movement trajectory with the largest number of positions in the target position set among the first target movement trajectory and the second target movement trajectory; or, determining weights of the first target movement trajectory and the second target movement trajectory according to an attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include historical movement trajectories of the target device, or include historical movement trajectories of multiple devices; determining, as the target movement trajectory, the movement trajectory with the largest weight among the first target movement trajectory and the second target movement trajectory; or, determining weights of the first target movement trajectory and the second target movement trajectory according to an attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include historical movement trajectories of the target device, or include historical movement trajectories of multiple devices; performing weighted fusion on the first target movement trajectory and the second target movement trajectory according to the weight of the first target movement trajectory and the weight of the second target movement trajectory to obtain the target movement trajectory.
[0014] Optionally, after determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory, the method further includes: in a case where the target offline media information is within a preset range of the target movement trajectory, determining the target device as an exposure object of the target offline media information.
[0015] According to another aspect of the embodiments of the present invention, there is also provided a trajectory restoration device, including: an acquisition module, configured to acquire a target position set of a target device; an aggregation module, configured to aggregate positions in the target position set and obtain a first target movement trajectory of the target device through a multi-head attention mechanism; an adsorption module, configured to aggregate positions in the target position set and obtain a second target movement trajectory of the target device through a multi-head attention mechanism; a determination module, configured to determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0016] According to another aspect of the embodiments of the present invention, there is also provided a trajectory restoration system, which is applied to the above-mentioned trajectory restoration method, and includes: a preprocessing unit, which includes a path restoration module and a commuting path module. Among them, the path restoration module is connected to the positioning log module and is used to obtain a set of target positions of the target device. The positioning log module records the positions of the target device. The path restoration module is also used to aggregate the positions in the set of target positions and obtain the first target movement trajectory of the target device through the multi-head attention mechanism; obtain target road network information, and adsorb the positions in the set of target positions onto multiple roads included in the target road network information to obtain the second target movement trajectory of the target device; determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory; the commuting path module is connected to the path restoration module and is used to store the target movement trajectory of the target device.
[0017] Optionally, the system further includes: an exposure statistics module, which is connected to the offline media information point module and the commuting path module. Among them, the exposure statistics module is used to determine the target device as the exposure object of the target offline media information when it is determined that the target offline media information is within the preset range of the target movement trajectory. The offline media information point module records the positions of the target offline media information.
[0018] According to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the above-mentioned trajectory restoration method when running.
[0019] According to yet another aspect of the embodiments of the present application, there is provided a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the trajectory restoration method as above.
[0020] According to yet another aspect of the embodiments of the present invention, there is also provided an electronic device, which includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the above-mentioned trajectory restoration method through the computer program.
[0021] In the embodiments of the present invention, a set of target positions of the target device is obtained. By aggregating the positions in the set of target positions and combining with the multi-head attention mechanism, a first target movement trajectory is obtained, and by combining with the target road network information, the positions in the set of target positions are adsorbed onto multiple roads in the target road network information. This solves the problem of low accuracy of trajectory restoration in the prior art and achieves the effect of improving the accuracy of trajectory restoration. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings described herein are used to provide a further understanding of the present invention, and constitute a part of this application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:
[0023] Figure 1 is a schematic diagram of an application environment of an optional trajectory restoration method according to an embodiment of the present invention;
[0024] Figure 2 is a flowchart of an optional trajectory restoration method according to an embodiment of the present invention;
[0025] Figure 3 is a schematic diagram of an optional movement trajectory according to an embodiment of the present invention;
[0026] Figure 4 is a schematic diagram of another optional movement trajectory according to an embodiment of the present invention;
[0027] Figure 5 is a schematic diagram of yet another optional movement trajectory according to an embodiment of the present invention;
[0028] Figure 6 is a schematic diagram of yet another optional movement trajectory according to an embodiment of the present invention;
[0029] Figure 7 is a schematic diagram of an optional road according to an embodiment of the present invention;
[0030] Figure 8 is a schematic diagram of another optional road according to an embodiment of the present invention;
[0031] Figure 9 is a schematic diagram of another optional road according to an embodiment of the present invention;
[0032] Figure 10 is a schematic block diagram according to an embodiment of the present invention;
[0033] Figure 11 is a schematic diagram of yet another optional movement trajectory according to an embodiment of the present invention;
[0034] Figure 12It is another alternative structural block diagram according to an embodiment of the present invention;
[0035] Figure 13 It is a schematic structural diagram of an optional trajectory restoration device according to an embodiment of the present invention;
[0036] Figure 14 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention;
[0037] Figure 15 It is a structural block diagram of a computer system of an optional electronic device according to an embodiment of the present invention. Detailed implementation manners
[0038] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0039] It can be understood that in the specific implementation manners of the present application, target device information is involved, such as data related to the location of the target device, etc. When the above embodiments of the present application are applied to specific products or technologies, permission or consent of the target device needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or devices.
[0041] According to one aspect of the embodiments of the present invention, a trajectory restoration method is provided. Optionally, as an alternative implementation manner, the above trajectory restoration method can be, but is not limited to, applied to, for example, Figure 1In the application environment shown above. The above application environment includes a mobile terminal 102, and this mobile terminal 102 can be a terminal device, such as the above-mentioned target device. The above mobile terminal includes: a memory 104, a processor 106, and a display 108. Among them, the display 108 is used to display pictures, including but not limited to video pictures, game pictures, and display pictures of various application programs. The above processor may include a positioning device, which can position the mobile terminal. The above memory 104 is used to store data, including but not limited to storing the positioning data of the mobile terminal, such as the positions in the above-mentioned target position set.
[0042] Optionally, in this embodiment, the above terminal device can be a terminal device configured with a target client, and can include at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptop computers, tablet computers, handheld computers, MID (Mobile Internet Devices, mobile Internet devices), PADs, desktop computers, intelligent voice interaction devices, intelligent home appliances, vehicle-mounted terminals, etc. If the mobile terminal enables positioning (such as enabling the Global Positioning System GPS), the mobile terminal can be positioned to obtain the position of the target device. The above target client can be a video client, an instant messaging client, a browser client, a game client, etc.
[0043] The above network 110 can include but not limited to: wired networks, wireless networks. Among them, the wired network includes: local area networks, metropolitan area networks, and wide area networks, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication.
[0044] The above server includes a database 114 and a processing engine 116. Among them, the above data path 114 is used to store data, including but not limited to the positions in the above-mentioned target position set. The above processing engine can process data, including but not limited to being used to perform the following steps:
[0045] Step S102, obtain the target position set of the target device;
[0046] Among them, the above target device can be a vehicle, or an in-vehicle terminal on the vehicle, or a mobile terminal, such as a mobile phone, a computer, etc.
[0047] Step S104, aggregate the positions in the target position set, and obtain the first target movement trajectory of the target device through the multi-head attention mechanism model;
[0048] Step S106, obtain the target road network information, and adsorb the positions in the target position set to multiple roads in the target road network information to obtain the second target movement trajectory of the target device;
[0049] Step S108, determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0050] The above server can be a single server, a server cluster composed of multiple servers, or a cloud server. The above is only an example, and this embodiment does not make any limitation thereto.
[0051] Optionally, as an alternative implementation, as Figure 2 shown, the above trajectory restoration method includes:
[0052] Step S202, obtain the target location set of the target device;
[0053] Optionally, the above target device can be a vehicle-mounted terminal or a mobile terminal. A global positioning system is set on the target device, and the target device is positioned through the global positioning system. For example, if a vehicle can be positioned by GPS positioning.
[0054] Step S204, aggregate the positions in the target location set, and obtain the first target movement trajectory of the target device through the multi-head attention mechanism model;
[0055] Step S206, obtain target road network information, and adsorb the positions in the target location set onto multiple roads in the target road network information to obtain the second target movement trajectory of the target device;
[0056] Step S208, determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0057] Optionally, the aggregating the positions in the target location set and obtaining the first movement trajectory of the target device through the multi-head attention mechanism model includes: aggregating the positions in the target location set to obtain a first movement trajectory, where the first movement trajectory includes some positions in the target location set; searching for the movement trajectories corresponding to each position in the first position subset in the pre-recorded historical position correspondence information to obtain a first movement trajectory set, where the first position subset includes the positions in the target location set except for the some positions, and the historical position correspondence information records multiple groups of historical positions and movement trajectories with corresponding relationships, and the positions in the historical position correspondence information include the historical positions of the target device, or include the historical positions of multiple devices; determining the first movement trajectory and the first movement trajectory set as the first target movement trajectory.
[0058] As an optional implementation, the above set of target positions may include the positions obtained by positioning the target device for n days. The position data obtained by positioning for n days may include a movement trajectory or may include position points, where n is greater than or equal to 1. For example, if the target device uses navigation positioning, a movement trajectory can be obtained. If the target device is turned off after positioning at a certain position, the obtained position is a position point. Through multi-trajectory aggregation, the positions of the target device for n days can be aggregated to obtain a trajectory with a relatively dense position. The aggregation can be performed in the following manner:
[0059]
[0060] Among them, represents the position with a relatively high positioning frequency within n days, represents the trajectory obtained by positioning the y target device u on the nth day. Taking the set of target positions obtained by positioning for 3 days as an example, as Figure 3 shown, on the first day, the target device is positioned to obtain the position obtained by positioning on the first day shown in the figure, and the positioned position is represented by a circle. On the second day, the target device is positioned to obtain the position obtained by positioning on the second day shown in the figure, and the positioned position is represented by a triangle. On the third day, the target device is positioned to obtain the position obtained by positioning on the third day shown in the figure, and the positioned position is represented by a rectangle. It can be seen from the figure that the positions obtained by positioning each day are relatively sparse. By aggregating the positions obtained by positioning for three days, a relatively dense position can be obtained. From the relatively dense position shown in the figure, the first movement trajectory of the target device shown in the figure can be obtained.
[0061] As an optional implementation, since the computer processes feature data, the above spatial mapping matrix in the computer is:
[0062]
[0063] Among them, e l ∈R d is a trainable d-dimensional vector, and all positions in the set of target positions can be represented by the matrix E l ∈R |Γ+1|×d in the computer.
[0064]
[0065] The time mapping is:
[0066]
[0067] Among them, i represents the i-th dimension, and both the time dimension and the spatial dimension are d-dimensional vectors.
[0068] As an alternative implementation, as shown in Figure 4 a part of the positions in the set of target positions shown in Figure 4 are aggregated into the first movement trajectory shown in the figure, while positions A, B, and C are not on the first movement trajectory. In this embodiment, the first position subset includes the above-mentioned positions A, B, and C.
[0069] The essence of the multi-head attention mechanism is to store historical data as Key-Value. Among them, Key corresponds to the historical position, which can be the historical position of the target device or the historical position of other devices, and Value corresponds to the movement trajectory. Key-Value is used to represent the above-mentioned historical corresponding position information, and the historical position corresponding information is used to represent that in the historical driving trajectory of the device, the normal movement trajectory at the historical position Key is the corresponding Value.
[0070] Taking Figure 4 positions A, B, and C shown in Figure 4 as examples, when looking for the corresponding Value in the historical corresponding information with position A as the Key, it is movement trajectory 1. When looking for the corresponding Value in the historical corresponding information with position B as the Key, it is movement trajectory 1. When looking for the corresponding Value in the historical corresponding information with position C as the Key, it is movement trajectory 2. Then the above-mentioned first movement trajectory set includes movement trajectory 1 and movement trajectory 2 in this embodiment. As shown in Figure 4 Figure 4 , the first movement trajectory and movement trajectory 1 and movement trajectory 2 in the first movement trajectory set are the first target movement trajectories of the target device.
[0071] Optionally, the step of finding the movement trajectory corresponding to each position in the first position subset in the pre-recorded historical position corresponding information to obtain the first movement trajectory set includes: finding the movement trajectory corresponding to the current position in the first position subset in the historical position corresponding information through the following steps: determining a set of historical positions in the historical position corresponding information whose similarity to the current position is greater than or equal to a preset value, and determining the movement trajectories corresponding to each historical position in the set of historical positions to obtain a second movement trajectory set; determining the movement trajectory corresponding to the current position in the second movement trajectory set.
[0072] As an alternative embodiment, a large number of correspondences between historical positions and movement trajectories are recorded in the historical position correspondence information. Historical positions with a similarity greater than or equal to a preset value can be searched for in the historical position correspondence information. In this embodiment, the similarity can be determined by distance, the type of surrounding buildings, or the type of nearby streets. Taking the measurement of similarity by distance as an example in this embodiment, the closer the distance, the greater the similarity. The above preset value can be a distance threshold, such as 3 meters, 4 meters, 5 meters, etc., which can be determined according to the actual situation. Taking positions A, B, and C in the first position subset as an example. Assume that the current position is position A above. Search for positions in the historical position correspondence information that are less than or equal to the preset value (assuming the preset value is 3 meters) away from position A. Assume that position F in the historical position correspondence information is less than the above preset value away from position A. Then position F in the historical position correspondence information is the similar position of position A above, and the above historical position set only includes position F. The movement trajectory corresponding to position F is recorded in the historical position correspondence information, assumed to be the above movement trajectory 1. Then the above second movement trajectory set only includes movement trajectory 1. It can be determined through the historical position correspondence information that the movement trajectory corresponding to the current position A is movement trajectory 1.
[0073] Assume that positions F, T, and J in the historical position correspondence information are less than the above preset value away from position A. Then positions F, T, and J in the historical position correspondence information are the similar positions of position A above, and the above historical position set includes positions F, T, and J. The movement trajectories corresponding to positions F, T, and J are recorded in the historical position correspondence information. Assume that the movement trajectory corresponding to position F in the historical position correspondence information is movement trajectory 1, the movement trajectory corresponding to position T is movement trajectory 8, and the movement trajectory corresponding to position J is movement trajectory 16. Then the above second movement trajectory set includes movement trajectory 1, movement trajectory 8, and movement trajectory 16. The movement trajectory corresponding to the current position A can be determined among the above movement trajectory 1, movement trajectory 8, and movement trajectory 16 through multi-head attention.
[0074] Optionally, determining the movement trajectory corresponding to the current position in the second movement trajectory set includes: determining the weight of each movement trajectory in the second movement trajectory set according to a multi-head attention mechanism model, where the multi-head attention mechanism model is a model obtained through self-learning using the historical position correspondence information; determining the movement trajectory with the largest weight in the second movement trajectory set as the movement trajectory corresponding to the current position.
[0075] As an alternative embodiment, the multi-head attention mechanism is a model obtained through self-learning using the historical position correspondence information. The specific implementation of the multi-head attention mechanism model is as follows:
[0076]
[0077] In the above formula, W are all parameters obtained through self-learning training of the multi-head attention mechanism. The essence of multi-head attention is to store historical data as Key-Value. Among them, Key corresponds to the historical position, which can be the historical position of the target device or the historical position of other devices, and Value corresponds to the movement trajectory. Key-Value is used to represent the above-mentioned historical corresponding position information, and the historical position corresponding information is used to represent that in the historical driving trajectory of the device, the usual movement trajectory at the historical position Key is the corresponding Value.
[0078] For the above embodiment, assume that the second movement trajectory set only includes movement trajectory 1, movement trajectory 8, and movement trajectory 16. The weights of movement trajectory 1, movement trajectory 8, and movement trajectory 16 can be determined through multi-head attention. Assume that the weight of movement trajectory 2 obtained through self-learning by the multi-head attention mechanism is 0.8, the weight of movement trajectory 8 is 0.4, and the weight of movement trajectory 16 is 0.2. Then it is determined that movement trajectory 1 is the movement trajectory corresponding to the current position A.
[0079] As an alternative implementation, the weights of movement trajectory 1, movement trajectory 8, and movement trajectory 16 can also be determined through historical experience, and the historical experience is obtained according to the above-mentioned historical position corresponding information. The historical corresponding record information records the corresponding relationship between the position and the movement trajectory. The higher the frequency of occurrence of a movement trajectory in the historical corresponding information, it indicates that the target device usually moves on this movement trajectory, and the greater the weight of this movement trajectory. Assume that the second movement trajectory set only includes movement trajectory 1, movement trajectory 8, and movement trajectory 16. The weights of each movement trajectory can be determined by the frequencies of occurrence of movement trajectory 1, movement trajectory 8, and movement trajectory 16 recorded in the historical position corresponding information. Assume that the frequency of occurrence of movement trajectory 1 is the highest in the historical position corresponding information, then the weight of movement trajectory 1 is the largest among movement trajectory 1, movement trajectory 8, and movement trajectory 16. Then it is determined that movement trajectory 1 is the movement trajectory corresponding to the current position A.
[0080] Optionally, the adsorbing the positions in the target position set to multiple roads in the target road network information to obtain the second target movement trajectory of the target device includes: when the positions in the target position set are all located on the multiple roads, determining the trajectory formed by the roads where the positions in the target position set are located as the second target movement trajectory.
[0081] As an alternative implementation, the movement trajectory of the target device can be obtained by combining road network information matching. The road network includes multiple roads, such as Figure 5The black solid lines shown in [figure] are multiple roads in the road network information. The position of the target device is located to obtain the position shown in the figure. Combine the multiple roads in the road network information and adsorb the position according to the shortest distance, adsorb the located position to the nearest road, as Figure 5 shown in [figure], adsorb the located position to the road, and obtain the second target movement trajectory of the target device according to the roads in the road network information.
[0082] As an alternative implementation, use the road network information to restore the trajectory of the positions in the target position set, adsorb the positions near the road to the road, and use the road network information to supplement the missing part of the target movement trajectory. As Figure 6 shown in [figure], the triangles, rectangles, and circles represent the positions in the located target position set, and the black lines shown in the figure are the roads in the road network information. As shown in the figure, if the positions in the target position set are all located on the roads in the road network information, then the trajectory formed on the road where the positions are located is used as the second target movement trajectory of the target device.
[0083] Optionally, adsorbing the positions in the target position set to the multiple roads included in the target road network information to obtain the second target movement trajectory of the target device further includes: when some positions in the target position set are located on the multiple roads, determining the trajectory formed by the roads where the some positions are located as the second movement trajectory; determining the second movement trajectory set according to each position in the second position subset and the adjacent positions of each position in the second position subset, where the second position subset includes the positions in the target position set except the some positions, and the adjacent position of each position in the second position subset is the position adjacent to each position in the target position set after sorting according to the positioning time sequence; determining the second movement trajectory and the second movement trajectory set as the second target movement trajectory.
[0084] As an alternative implementation, as Figure 7 shown in [figure], in the road network information, some of the located positions are on the road, and position B is not on the road in the road network information, that is, position B in this embodiment is included in the above-mentioned second position subset. When each position is located, the positioning time of each position is also recorded, that is to say, the target position set can also include the positioning time corresponding to each position. As Figure 7 shown in [figure], assuming that the positioning time of position A is 13:01 on January 1, 2021, the positioning time of position B is 13:10 on January 1, 2021, and the positioning time of position C is 13:15 on January 1, 2021, then the adjacent positions of position B in the target position set include the above-mentioned position A and position C. Adsorb the road according to the principle of distance priority, and Figure 7The position B shown in is adsorbed onto the road in the road network information. The road can also be scored based on any one or more influencing factors such as positioning accuracy, distance deviation, deviation angle, speed, road type, etc. The above score calculation may involve the distance between adjacent positions, the moving speed determined based on adjacent positions, the turning cost with adjacent positions, the score of the adjacent position matching road, the deviation stability with the matching road, etc., and the road with the highest score is determined as the matching road.
[0085] Optionally, determining the second movement trajectory set according to each position in the second position subset and the adjacent position of each position in the second position subset includes: performing the following steps for each position in the second position subset, when performing the following steps, each position in the second position subset is the current position: determining a first road set from the multiple roads whose distance to the current position is less than or equal to a first distance threshold; determining a second road set from the multiple roads whose distance to the adjacent position of the current position is less than or equal to a second distance threshold; determining the movement trajectory corresponding to the current position according to the first road set and the second road set, wherein the second movement trajectory set includes the movement trajectory corresponding to the current position.
[0086] As an optional implementation, with the above Figure 7 For example, the second position subset shown in includes position B and position C, and it is assumed that the current position is position B. According to the road network information, a road whose distance from position B is less than or equal to the first distance threshold is determined in multiple road networks. The above-mentioned first distance threshold can be set according to actual conditions, such as 0.3 meters, 0.4 meters, 0.8 meters, 1 meter, etc. In this embodiment, it is assumed that Figure 7 Among the multiple roads shown in , the roads whose distances to position B are less than or equal to the first distance threshold are road 1 and road 2 shown in the figure, and the first road set includes road 1 and road 2. In combination with position B and its adjacent position (position A or position C), a road matching position B is determined among road 1 and road 2, and the index of the matching road is returned.
[0087] For example, a road matching position B is determined between road 1 and road 2 based on the previous position of position B (position A). Figure 7 The position A shown in is on the road in the road network information, that is, road 2, and the second position set only includes road 2. Position B is mapped to road 1 and road 2 respectively. As shown in the figure, position B is mapped to road 1 to obtain position B1, and position B is mapped to the road to obtain position B2. The road matching position B can be determined in road 1 and road 2 according to the distance between B1, B2 and position A respectively, or the turning cost between B1, B2 and position A respectively.
[0088] Taking the example of determining the road matching position B in Road 1 and Road 2 according to the subsequent position (position C) of position B. As shown in the figure, position C is not on the road. Determine the roads in the multiple road networks of the road network information whose distance from position C is less than or equal to the above first distance threshold, such as Road 2 and Road 3 shown in the figure. The above second road set includes Road 2 and Road 3. Map position C to Road 2 and Road 3 respectively. As shown in the figure, position C is mapped to Road 2 to get C2, and position C is mapped to Road 3 to get position C1. The second target movement trajectory can be determined among Road 1 and Road 2 in the first position set, and Road 2 and Road 3 in the second position set.
[0089] Optionally, determining the movement trajectory corresponding to the current position according to the first road set and the second road set includes: determining the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a first preset value; or, determining the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the number of turns from the current position along the movement trajectory corresponding to the current position to the connected position of the current position is less than or equal to a second preset value; or, determining the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the turning angle from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a third preset value; or, determining the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to the first preset value, and the number of turns is less than or equal to the second preset value, and the turning angle is less than or equal to the third preset value; or, determining the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the speed limit of the movement trajectory corresponding to the current position matches the speed of the target device moving from the current position to the adjacent position of the current position.
[0090] As an optional implementation manner, the movement trajectory of the target device can be determined among multiple roads according to the connected road length and the turning cost. Taking the connected road length as an example, such as Figure 8As shown in the figure, moving from position B to B1 and then along the road in the road network information to position A gives the movement trajectory 1 as shown in the figure, and moving from position B to B2 and then along the road in the road network information to position A gives the movement trajectory 2 as shown in the figure. By comparing the movement distances of movement trajectory 1 and movement trajectory 2, the movement trajectory with a movement distance less than the first preset value is determined as the movement trajectory corresponding to position B among movement trajectory 1 and movement trajectory 2. The first preset value can be determined according to the actual situation. For example, it can be 0.5 meters, 1 meter, etc. Or the movement trajectory with the shortest movement distance can be determined as the movement trajectory corresponding to position B. As can be seen from the figure, the distance of movement trajectory 2 is the shortest, so movement trajectory 2 is determined as the movement trajectory corresponding to position B.
[0091] As an alternative implementation, taking the determination of the movement trajectory corresponding to position B by the turning cost as an example, the above-mentioned turning cost can be the number of turns, and the second preset value can be determined according to the actual situation. For example, it can be 1, 2, 3, etc. As Figure 8 shown in the figure, moving from position B to B1 and then along the road in the road network information to position A gives the movement trajectory 1 as shown in the figure, and moving from position B to B2 and then along the road in the road network information to position A gives the movement trajectory 2 as shown in the figure. By comparing the number of turns of movement trajectory 1 and movement trajectory 2, as can be seen from the figure, the number of turns of movement trajectory 2 is the least, so movement trajectory 2 is determined as the movement trajectory corresponding to position B.
[0092] As an alternative implementation, since each position in the target position set has a corresponding positioning time, the movement trajectory corresponding to the current position can be determined among multiple roads according to the positioning time and the speed limits on each road in the road network information. As Figure 9 shown in the figure, assume that the current position is position B, and the adjacent position of position B is position A shown in the figure. Moving from position B along roads 1 and 2 in the road network information from the mapped position B1 to position A forms movement trajectory 1. And moving from position B along road 3 in the road network information from the mapped position B2 to position A forms movement trajectory 2. There are speed limits on each road in the road information. According to the movement distances of movement trajectory 1 and movement trajectory 2, the positioning times of position A and position B, and the speed limits of roads 1, 2, and 3, the road matching the position can be determined. From Figure 9It can be seen that the moving trajectory 2 is the most matching moving trajectory in terms of both the moving distance and the number of turns. However, according to the speed limit of the road, the moving trajectory 2 is not necessarily the moving trajectory corresponding to position B. Suppose the speed limit of road 3 is at most 30 kilometers per hour, the moving distance of the moving trajectory 2 is 60 kilometers, and the positioning time difference between position B and position A is half an hour. According to the speed limit of road 3, if the target device moves from position A to position B along the moving trajectory 2, it takes at least two hours, while the positioning time difference between position B and position A is half an hour, which is obviously inconsistent. If the speed limit on the moving trajectory 1 is consistent with the positioning time difference between position B and position A, then it is determined that the moving trajectory 1 is the moving trajectory corresponding to position B. The road network information and road speed limits involved in the above embodiments are only examples to illustrate the present application, and specific ones are determined according to the actual situation.
[0093] Optionally, determining the target moving trajectory according to the first target moving trajectory and the second target moving trajectory includes: determining, as the target moving trajectory, the moving trajectory with the largest number of positions in the target position set among the first target moving trajectory and the second target moving trajectory; or, determining the weights of the first target moving trajectory and the second target moving trajectory according to an attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical moving trajectories, and the historical moving trajectories include the historical moving trajectories of the target device, or include the historical moving trajectories of multiple devices; determining, as the target moving trajectory, the moving trajectory with the largest weight among the first target moving trajectory and the second target moving trajectory; or, determining the weights of the first target moving trajectory and the second target moving trajectory according to an attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical moving trajectories, and the historical moving trajectories include the historical moving trajectories of the target device, or include the historical moving trajectories of multiple devices; performing weighted fusion on the first target moving trajectory and the second target moving trajectory according to the weight of the first target moving trajectory and the weight of the second target moving trajectory to obtain the target moving trajectory.
[0094] As an alternative implementation, such as Figure 10As shown, the first target movement trajectory can be obtained through trajectory aggregation, and the second target movement trajectory can be obtained through road network matching. The target movement trajectory of the target device is obtained by combining the first target movement trajectory and the second target movement trajectory. In this embodiment, the target movement trajectory can be determined from the first target movement trajectory and the second target movement trajectory. Specifically, the target movement trajectory can be determined according to the number of positions included in the first target movement trajectory and the second target movement trajectory, and the movement trajectory with the largest number of included positions is determined as the target movement trajectory. For example, if the target position set includes 100 positions, the first target movement trajectory obtained through trajectory aggregation includes 900 positions, and the second target movement trajectory obtained through road network matching includes 800 positions, then the first target movement trajectory is determined as the target movement trajectory of the target device.
[0095] As another alternative implementation, the weights of the first target movement trajectory and the second target movement trajectory can also be determined through an attention mechanism, and the movement trajectory with the largest weight is determined as the target movement trajectory of the target device. The attention mechanism is a model obtained by self-learning using historical movement trajectories. The historical movement trajectories can include the movement trajectories of the target device or the movement trajectories of other devices. The essence of the attention mechanism is to obtain the weight of each movement trajectory through historical movement trajectories. For movement trajectories frequently selected by a large number of target devices, the weight is greater.
[0096] As another alternative implementation, the weights of the first target movement trajectory and the second target movement trajectory can also be determined through an attention mechanism, and the target movement trajectory is obtained by fusing the first target movement trajectory according to the weights of the first target movement trajectory and the second target movement trajectory. As Figure 11 shown, the first target movement trajectory and the second target movement trajectory are fused to obtain the target movement trajectory.
[0097] Assume the first target movement trajectory is The second target movement trajectory is Trajectory fusion is performed to obtain the target movement trajectory
[0098]
[0099] The most likely positions on the first target movement trajectory and the second target movement trajectory are extracted through weighted fusion as the enhanced preset trajectory The Hidden Markov Model (HMM) can be used to ensure that all predicted points are located on real roads with actual physical significance, and the prediction result τ is obtained U , during the HMM training process, cross-entropy and regularization are used as the loss function:
[0100]
[0101] is the predicted position and any position e l The probability between them. The position with the highest probability is taken as the predicted position. The parameter set θ in the loss function includes the input, the mapping matrix of Key-Value, and the mapping matrix of locations is the one-hot encoded vector of the position of the target device u at day n and time period t. The Adam optimizer can be used in the training process, and the possible values of u, n, and t are looped through in sequence
[0102] As an optional implementation, for the located positions, positions with poor accuracy can be filtered out, and positions with repeated positioning times can be ignored. And if there are errors in the time sequence of the located positions, they can be automatically reordered. If the distance between the current position and the adjacent position is less than a preset value (such as 1 meter, 2 meters, etc.), the information of the adjacent position can be directly assigned to the current position to speed up the calculation
[0103] Among them, the above preset range can be set according to the actual situation. For example, 3 meters, 2 meters, 1 meter, etc. from the target movement trajectory. The above offline media information can be advertisements, images, videos, etc. Taking advertisements as an example, if advertisements A, B, C, and D are within the preset range of the target movement trajectory, then the target device is the exposure device of advertisements A, B, C, and D. Taking advertisement A as an example, if the number of exposure devices is used as the exposure volume of the advertisement, then if there are 10,000 devices that are the exposure devices of advertisement A, the exposure volume of advertisement A is 10,000
[0104] As an optional implementation, as Figure 12 shown in the system framework diagram, it includes a positioning log module. The positioning log includes the positions obtained by positioning the target device and the corresponding positioning times. A path restoration module for restoring the target movement trajectory of the target device based on the positions in the target position set, and a commuting path module for determining the daily commuting routes of each device. The offline media information point is used to obtain the positions of offline media information, such as advertisement points. The exposure statistics module is used to count the exposure times of offline media information and the number of exposure devices, and the offline media information exposure module is used to output the exposure situation of offline media information. In this embodiment, the path restoration module with the longest time consumption is extracted and calculated at the idle moment of the computing cluster, and the result is stored in the commuting path module. When calculating the exposure degree of specific offline media information, only the position of the offline media information, the positioning log, and the pre-calculated commuting path need to be used as inputs to quickly obtain the exposure result of the offline media information
[0105] Optionally, after determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory, the method further includes: when the target offline media information is within a preset range of the target movement trajectory, determining the target device as the exposure object of the target offline media information.
[0106] As an alternative implementation, the above preset range can be set according to the actual situation. For example, it can be 3 meters, 2 meters, 1 meter, etc. away from the target movement trajectory. The above target offline media information can be advertisements, images, videos, etc. Taking advertisements as an example, if advertisements A, B, C, and D are within the preset range of the target movement trajectory, then the target device is the exposure object of advertisements A, B, C, and D. Taking advertisement A as an example, if the number of exposure objects is used as the exposure volume of the advertisement, then if there are 10,000 devices that are the exposure objects of advertisement A, the exposure volume of advertisement A is 10,000.
[0107] As an alternative implementation, the exposure volume of the offline media information is statistically analyzed. A commonly used statistical method is to use a video probe for statistics. For example, a camera is installed near the offline advertisement, and the exposure volume of the advertisement is statistically analyzed through the video collected by the camera. However, the video collection range of the video probe is limited, and there is a certain error between the exposure volume of the advertisement statistically analyzed through the video collected by the video probe and the actual exposure volume of the advertisement. In addition, the installation cost of the video probe is relatively high. In the embodiments of the present invention, by positioning the use of the target device, a set of target positions of the target device is obtained. The movement trajectory of the target device is obtained by performing trajectory restoration processing on the obtained set of target positions. If the target offline media information is within the movement trajectory range of the target device, then the target device is the exposure object of the target offline media information. The exposure volume of the offline media information can be statistically analyzed through the movement trajectory of the target device without using a video probe. This avoids the technical problem of low trajectory restoration accuracy caused by the limited coverage range of the video probe in the prior art, and the exposure of the offline media information can be statistically analyzed without using a video probe in this application, saving costs.
[0108] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0109] According to another aspect of the embodiments of the present invention, there is also provided a trajectory restoration device for implementing the above trajectory restoration method. As Figure 13As shown in the figure, the device includes: an acquisition module 1302, configured to acquire a set of target positions of a target device; an aggregation module 1304, configured to aggregate the positions in the set of target positions and obtain a first target movement trajectory of the target device through a multi-head attention mechanism; an adsorption module 1306, configured to aggregate the positions in the set of target positions and obtain a second target movement trajectory of the target device through a multi-head attention mechanism; a determination module 1308, configured to determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0110] Optionally, the above device is further configured to aggregate the positions in the set of target positions to obtain a first movement trajectory, where the first movement trajectory includes some positions in the set of target positions; search for the movement trajectories corresponding to each position in the first position subset in the pre-recorded historical position correspondence information to obtain a first movement trajectory set, where the first position subset includes the positions in the set of target positions except for the some positions, and the historical position correspondence information records multiple groups of historical positions and movement trajectories with corresponding relationships, and the positions in the historical position correspondence information include the historical positions of the target device, or include the historical positions of multiple devices; determine the first movement trajectory and the first movement trajectory set as the first target movement trajectory.
[0111] Optionally, the above device is further configured to search for the movement trajectory corresponding to the current position in the first position subset in the historical position correspondence information through the following steps: determine a set of historical positions in the historical position correspondence information whose similarity to the current position is greater than or equal to a preset value, and determine the movement trajectories corresponding to each historical position in the set of historical positions to obtain a second movement trajectory set; determine the movement trajectory corresponding to the current position in the second movement trajectory set.
[0112] Optionally, the above device is further configured to determine the weight of each movement trajectory in the second movement trajectory set according to a multi-head attention mechanism model, where the multi-head attention mechanism model is a model obtained through self-learning using the historical position correspondence information; determine the movement trajectory with the largest weight in the second movement trajectory set as the movement trajectory corresponding to the current position.
[0113] Optionally, the above device is further configured to, when all the positions in the set of target positions are located on the multiple roads, determine the trajectory formed by the roads where the positions in the set of target positions are located as the second target movement trajectory.
[0114] Optionally, when some of the positions in the set of target positions are located on the plurality of roads, the above device is further configured to determine a trajectory formed by the roads where the some positions are located as a second movement trajectory; determine a set of second movement trajectories according to each position in the second position subset and the adjacent positions of each position in the second position subset, where the second position subset includes the positions in the set of target positions except the some positions, and the adjacent position of each position in the second position subset is the position adjacent to each position after sorting in the order of positioning time in the set of target positions; and determine the second movement trajectory and the set of second movement trajectories as the second target movement trajectory.
[0115] Optionally, the above device is further configured to perform the following steps for each position in the second position subset. When performing the following steps, each position in the second position subset is the current position: determine a first set of roads in the plurality of roads that are less than or equal to a first distance threshold from the current position; determine a second set of roads in the plurality of roads that are less than or equal to a second distance threshold from the adjacent position of the current position; and determine a movement trajectory corresponding to the current position according to the first set of roads and the second set of roads, where the movement trajectory corresponding to the current position is included in the set of second movement trajectories.
[0116] Optionally, the above-mentioned device is further configured to determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a first preset value; determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the number of turns from the current position along the movement trajectory corresponding to the current position to the connected position of the current position is less than or equal to a second preset value; determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the turning angle from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to a third preset value; determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to the first preset value, and the number of turns is less than or equal to the second preset value, and the turning angle is less than or equal to the third preset value; determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the speed limit of the movement trajectory corresponding to the current position matches the speed of the target device moving from the current position to the adjacent position of the current position.
[0117] Optionally, the above-mentioned device is further configured to determine, as the target movement trajectory, the movement trajectory with the largest number of positions in the first target movement trajectory and the second target movement trajectory that include the positions in the target position set; determine the weights of the first target movement trajectory and the second target movement trajectory according to the attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include the historical movement trajectories of the target device, or include the historical movement trajectories of multiple devices; determine, as the target movement trajectory, the movement trajectory with the largest weight among the first target movement trajectory and the second target movement trajectory; determine the weights of the first target movement trajectory and the second target movement trajectory according to the attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include the historical movement trajectories of the target device, or include the historical movement trajectories of multiple devices; perform weighted fusion on the first target movement trajectory and the second target movement trajectory according to the weights of the first target movement trajectory and the second target movement trajectory to obtain the target movement trajectory.
[0118] Optionally, after determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory, the above-mentioned device is further configured to determine the target device as the exposure object of the target offline media information when the target offline media information is within the preset range of the target movement trajectory.
[0119] According to another aspect of the embodiments of the present invention, there is also provided a trajectory restoration system for implementing the above-mentioned trajectory restoration method, as Figure 12 shown, including: a preprocessing unit, which includes a path restoration module and a commuting path module. Among them, the path restoration module is connected to the positioning log module and is used to obtain the target position set of the target device, where the position of the target device is recorded in the positioning log module; the path restoration module is further used to aggregate the positions in the target position set and obtain the first target movement trajectory of the target device through a multi-head attention mechanism; obtain the target road network information, and adsorb the positions in the target position set onto multiple roads included in the target road network information to obtain the second target movement trajectory of the target device; determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory; the commuting path module is connected to the path restoration module and is used to store the target movement trajectory of the target device.
[0120] Optionally, the system further includes: an exposure statistics module, which is connected to the offline media information point module and the commuting path module. Among them, the exposure statistics module is used to determine the target device as the exposure object of the target offline media information when it is determined that the target offline media information is within the preset range of the target movement trajectory, where the position of the target offline media information is recorded in the offline media information point module.
[0121] Optionally, the system further includes: an offline media information point module, which stores the positions of media information in this module. For example, the position of an advertisement. The system further includes: offline media information exposure, which is used to count the exposure volume of media information, such as the exposure volume of an advertisement.
[0122] According to another aspect of the embodiments of the present invention, there is also provided an electronic device for implementing the above-mentioned trajectory restoration method. This electronic device can be Figure 1 the terminal device or server shown. In this embodiment, the electronic device is taken as an example of a server for illustration. As Figure 14 shown, the electronic device includes a memory 1402 and a processor 1404. A computer program is stored in the memory 1402, and the processor 1404 is configured to execute the steps in any of the above method embodiments through the computer program.
[0123] Optionally, in this embodiment, the above-mentioned electronic device may be at least one network device among multiple network devices of a computer network.
[0124] Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:
[0125] S1. Obtain the target location set of the target device;
[0126] S2. Aggregate the locations in the target location set and obtain the first target movement trajectory of the target device through a multi-head attention mechanism model;
[0127] S3. Obtain the target road network information and adsorb the locations in the target location set onto multiple roads in the target road network information to obtain the second target movement trajectory of the target device;
[0128] S4. Determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0129] Optionally, those of ordinary skill in the art can understand that Figure 14 the structure shown is only schematic, and the electronic device can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 14 It does not limit the structure of the above-mentioned electronic device. For example, the electronic device may further include more or fewer components (such as a network interface, etc.) than those shown Figure 14 in the figure, or have a different configuration from that shown Figure 14 in the figure.
[0130] Among them, the memory 1402 can be used to store software programs and modules, such as the program instructions / modules corresponding to the trajectory restoration method and device in the embodiments of the present invention. The processor 1404 executes various functional applications and data processing by running the software programs and modules stored in the memory 1402, that is, implements the above-mentioned trajectory restoration method. The memory 1402 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 1402 may further include a memory remotely set relative to the processor 1404, and these remote memories can be connected to the terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. Among them, the memory 1402 can specifically but not limitedly be used to store information such as sample features of items and target virtual resource accounts. As an example, such asFigure 14 As shown, the above-mentioned memory 1402 may but is not limited to include the acquisition module 1302, aggregation module 1304, adsorption module 1306, and determination module 1308 in the above-mentioned trajectory restoration device. In addition, it may also include but is not limited to other module units in the above-mentioned trajectory restoration device, which will not be elaborated in this example.
[0131] Optionally, the above-mentioned transmission device 1406 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1406 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1406 is a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0132] In addition, the above-mentioned electronic device further includes: a display 1408 for displaying the position of the target device; and a connection bus 1410 for connecting each module component in the above-mentioned electronic device.
[0133] In other embodiments, the above-mentioned terminal device or server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication.
[0134] According to one aspect of the present application, a computer program product is provided. The computer program product includes computer programs / instructions, and the computer programs / instructions contain program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1509, and / or installed from the removable medium 1511. When the computer program is executed by the central processing unit 1501, various functions provided by the embodiments of the present application are executed.
[0135] The serial numbers of the above-mentioned embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0136] Figure 15 Schematically shows a block diagram of a computer system of an electronic device for implementing the embodiments of the present application.
[0137] It should be noted that Figure 15 The computer system 1500 of the electronic device shown is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present application.
[0138] As Figure 15As shown, computer system 1500 includes a central processing unit 1501 (CPU), which can perform various appropriate actions and processes according to programs stored in read-only memory 1502 (ROM) or programs loaded from storage section 1508 into random access memory 1503 (RAM). In random access memory 1503, various programs and data required for system operation are also stored. The central processing unit 1501, read-only memory 1502, and random access memory 1503 are connected to each other via bus 1504. Input / output interface 1505 (Input / Output interface, i.e., I / O interface) is also connected to bus 1504.
[0139] The following components are connected to input / output interface 1505: input section 1506 including a keyboard, mouse, etc.; output section 1507 including, for example, a cathode ray tube (CRT), liquid crystal display (LCD), etc. and speakers, etc.; storage section 1508 including a hard disk, etc.; and communication section 1509 including a network interface card such as a local area network card, modem, etc. Communication section 1509 performs communication processing via a network such as the Internet. Drive 1510 is also connected to input / output interface 1505 as needed. Removable medium 1511, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 1510 as needed so that a computer program read from it can be installed into storage section 1508 as needed.
[0140] Specifically, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network via communication section 1509, and / or installed from removable medium 1511. When the computer program is executed by central processing unit 1501, various functions defined in the system of the present application are executed.
[0141] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above various optional implementation manners.
[0142] Optionally, in this embodiment, the above computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0143] S1. Obtain a set of target positions of the target device;
[0144] S2. Aggregate the positions in the set of target positions, and obtain a first target movement trajectory of the target device through a multi-head attention mechanism model;
[0145] S3. Obtain target road network information, and adsorb the positions in the set of target positions onto multiple roads in the target road network information to obtain a second target movement trajectory of the target device;
[0146] S4. Determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
[0147] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program. This program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0148] If the integrated unit in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0149] In the above embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0150] In several embodiments provided by the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the described device embodiments are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in electrical or other forms.
[0151] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0152] In addition, in each embodiment of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0153] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A trajectory restoration method, characterized in that, Including: Obtain a set of target positions of a target device; Aggregate the positions in the set of target positions to obtain a first movement trajectory, where the first movement trajectory includes some of the positions in the set of target positions; based on multiple movement trajectories obtained from historical corresponding position information, determine a set of first movement trajectories through a multi-head attention mechanism model, where the multiple movement trajectories include movement trajectories corresponding to positions in the set of target positions other than the some positions; determine a first target movement trajectory of the target device according to the first movement trajectory and the set of first movement trajectories; Obtain target road network information, and adsorb the positions in the set of target positions onto multiple roads in the target road network information to obtain the adsorbed multiple roads, and determine a second target movement trajectory of the target device according to the adsorbed multiple roads; Determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
2. The method according to claim 1, wherein The determining, through a multi-head attention mechanism model, a set of first movement trajectories based on multiple movement trajectories obtained from historical position information includes: Search for movement trajectories corresponding to each position in a first position subset in the pre-recorded historical position corresponding information to obtain a set of first movement trajectories, where the first position subset includes positions in the set of target positions other than the some positions, and the historical position corresponding information records multiple groups of historical positions and movement trajectories with corresponding relationships, and the positions in the historical position corresponding information include historical positions of the target device, or include historical positions of multiple devices.
3. The method according to claim 2, wherein The searching for movement trajectories corresponding to each position in a first position subset in the pre-recorded historical position corresponding information to obtain a set of first movement trajectories includes: Search for a movement trajectory corresponding to the current position in the first position subset in the historical position corresponding information through the following steps: Determine a set of historical positions in the historical position corresponding information whose similarity to the current position is greater than or equal to a preset value, and determine movement trajectories corresponding to each historical position in the set of historical positions to obtain a set of second movement trajectories; Determine a movement trajectory corresponding to the current position in the set of second movement trajectories.
4. The method according to claim 3, wherein The determining a movement trajectory corresponding to the current position in the set of second movement trajectories includes: Determine the weight of each movement trajectory in the set of second movement trajectories according to a multi-head attention mechanism model, where the multi-head attention mechanism model is a model obtained through self-learning using the historical position corresponding information; Determine the movement trajectory with the largest weight in the set of second movement trajectories as the movement trajectory corresponding to the current position.
5. The method according to claim 2, wherein The adsorbing the positions in the set of target positions onto multiple roads in the target road network information to obtain the adsorbed multiple roads, and determining a second target movement trajectory of the target device according to the adsorbed multiple roads includes: When all the positions in the target position set are located on the multiple roads, the trajectory formed by the roads where the positions in the target position set are located is determined as the second target movement trajectory.
6. The method according to claim 1, wherein The step of adsorbing the positions in the target position set onto the multiple roads in the target road network information to obtain the adsorbed multiple roads, and determining the second target movement trajectory of the target device according to the adsorbed multiple roads further includes: When some of the positions in the target position set are located on the multiple roads, the trajectory formed by the roads where the some positions are located is determined as the second movement trajectory; Determine the second movement trajectory set according to each position in the second position subset and the adjacent positions of each position in the second position subset, where the second position subset includes the positions in the target position set except the some positions, and the adjacent position of each position in the second position subset is the position adjacent to each position in the target position set after sorting according to the positioning time sequence; Determine the second movement trajectory and the second movement trajectory set as the second target movement trajectory.
7. The method according to claim 6, characterized in that, The determining the second movement trajectory set according to each position in the second position subset and the adjacent positions of each position in the second position subset includes: Execute the following steps for each position in the second position subset. When executing the following steps, each position in the second position subset is the current position: Determine a first road set in the multiple roads whose distance from the current position is less than or equal to the first distance threshold; Determine a second road set in the multiple roads whose distance from the adjacent position of the current position is less than or equal to the second distance threshold; Determine the movement trajectory corresponding to the current position according to the first road set and the second road set, where the movement trajectory corresponding to the current position is included in the second movement trajectory set.
8. The method according to claim 7, wherein The determining the movement trajectory corresponding to the current position according to the first road set and the second road set includes: Determine the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to the first preset value; or, Determine the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the number of turns from the current position along the movement trajectory corresponding to the current position to the connected position of the current position is less than or equal to the second preset value; or, Determine the movement trajectory corresponding to the current position in the movement trajectory set formed by the first road set and the second road set, where the turning angle from the current position along the movement trajectory corresponding to the current position to the adjacent position of the current position is less than or equal to the third preset value; or, Determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the movement distance from the current position along the movement trajectory corresponding to the current position to an adjacent position of the current position is less than or equal to the first preset value, the number of turns is less than or equal to the second preset value, and the turning angle is less than or equal to the third preset value; or, Determine the movement trajectory corresponding to the current position in the set of movement trajectories formed by the first road set and the second road set, where the speed limit of the movement trajectory corresponding to the current position matches the speed of the target device moving from the current position to an adjacent position of the current position.
9. The method according to claim 1, characterized in that, The determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory includes: Determine the movement trajectory with the largest number of positions in the target position set among the first target movement trajectory and the second target movement trajectory as the target movement trajectory; or, Determine the weights of the first target movement trajectory and the second target movement trajectory according to the attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include the historical movement trajectories of the target device, or include the historical movement trajectories of multiple devices; determine the movement trajectory with the largest weight among the first target movement trajectory and the second target movement trajectory as the target movement trajectory; or, Determine the weights of the first target movement trajectory and the second target movement trajectory according to the attention mechanism model, where the attention mechanism model is a model obtained through self-learning using historical movement trajectories, and the historical movement trajectories include the historical movement trajectories of the target device, or include the historical movement trajectories of multiple devices; perform weighted fusion on the first target movement trajectory and the second target movement trajectory according to the weights of the first target movement trajectory and the second target movement trajectory to obtain the target movement trajectory.
10. The method according to any one of claims 1 to 9, characterized in that After determining the target movement trajectory according to the first target movement trajectory and the second target movement trajectory, the method further includes: When the target offline media information is within the preset range of the target movement trajectory, determine the target device as the exposure object of the target offline media information.
11. A trajectory restoration device, characterized in that, Includes: An acquisition module, configured to acquire a target position set of a target device; An aggregation module, configured to aggregate the positions in the target position set to obtain a first movement trajectory, where the first movement trajectory includes some positions in the target position set; determine a first movement trajectory set based on multiple movement trajectories obtained from historical position information through a multi-head attention mechanism model, where the multiple movement trajectories include the movement trajectories corresponding to the positions in the target position set except for the some positions; determine the first target movement trajectory of the target device according to the first movement trajectory and the first movement trajectory set; An adsorption module, configured to obtain target road network information, and adsorb the positions in the target position set to multiple roads in the target road network information to obtain the adsorbed multiple roads, and determine a second target movement trajectory of the target device according to the adsorbed multiple roads; A determination module, configured to determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory.
12. A trajectory restoration system, characterized in that, Applied to the trajectory restoration method according to any one of claims 1 to 10, including: A preprocessing unit, which includes a path restoration module and a commuting path module, wherein, The path restoration module is connected to a positioning log module, and is configured to obtain a target position set of a target device, wherein the positioning log module records the positions of the target device; The path restoration module is further configured to aggregate the positions in the target position set, and obtain a first target movement trajectory of the target device through a multi-head attention mechanism; obtain target road network information, and adsorb the positions in the target position set to multiple roads included in the target road network information to obtain a second target movement trajectory of the target device; determine the target movement trajectory according to the first target movement trajectory and the second target movement trajectory; The commuting path module is connected to the path restoration module, and is configured to store the target movement trajectory of the target device.
13. The system according to claim 12, wherein, The system further includes: An exposure statistics module, connected to an offline media information point module and the commuting path module, wherein, The exposure statistics module is configured to determine the target device as an exposure object of the target offline media information when it is determined that the target offline media information is within a preset range of the target movement trajectory, wherein the offline media information point module records the position of the target offline media information.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when running, executes the method according to any one of claims 1 to 10.
15. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 10.
16. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.
Citation Information
Patent Citations
Vehicle trajectory determination method and device, electronic equipment and computer storage medium
CN112665590A