User trajectory acquisition method, device, electronic device and readable storage medium
By identifying the stop points and moving points and projecting the road network of mobile phone signaling data, fitting the user's trajectory, the problem of not being able to obtain the user's actual trajectory in the prior art is solved, and the efficiency and accuracy of trajectory acquisition are improved.
Patent Information
- Application Number
- CN202111582531.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The prior art cannot effectively fit and obtain the actual movement trajectory of the user based on mobile phone signaling data, and lacks a solution to trajectory fitting for signaling data, resulting in the inability to accurately describe the user's spatial location and space-time laws.
By obtaining the signaling data of the user within the preset time period, determining the stop point and moving point, and projecting the moving point to the target road based on the grid division of the road network, performing trajectory fitting, and obtaining the actual trajectory of the user.
It improves the efficiency of mobile point road restoration, realizes the user's actual trajectory acquisition within the preset time period, and enhances the reflection of the space-time laws of people's aerial behavior.
Smart Images

Figure CN114615629B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology. Specifically, the present application relates to a method, device, electronic device and readable storage medium for acquiring user trajectory. Background Art
[0002] Mobile signaling data, that is, the spatial location of users is determined through the information exchange between mobile phone users and base stations, and can relatively accurately record the spatiotemporal trajectory of human flow. Mobile phone users will record signaling data whenever they turn on and off their phones, make calls, send text messages, update their locations, and switch base stations. Mobile signaling data has the following characteristics: First, it has a large sample size, wide coverage, and a high user ownership rate, which can better reflect the spatiotemporal laws of human flow behavior; second, it is anonymous data with good security, without any personal attribute information, and does not involve personal privacy; third, it is involuntary data, and users passively provide information and cannot interfere with the survey results; fourth, it has dynamic real-time and continuity, and can accurately reflect the spatial location of mobile phone users at different time points in a continuous time segment, providing the possibility of quantitatively describing the flow trajectory of people in the region.
[0003] At present, location applications based on signaling data all perform macro statistical analysis on the signaling data, such as residence analysis, work location analysis, cross-regional migration analysis, etc. There is no solution to fit the actual movement trajectory of the signaling data, and thus the actual trajectory of the user cannot be obtained. Summary of the invention
[0004] The purpose of this application is to solve at least one of the above technical defects. The technical solutions provided by the embodiments of this application are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for obtaining a user trajectory, including:
[0006] Based on the signaling data of the user within a preset time period, a corresponding plurality of first positioning points are acquired, and based on the signaling data, a stay point and a moving point among the plurality of first positioning points are determined;
[0007] The road network in the area where the user is located is divided into equal intervals in the longitude direction and the latitude direction to form multiple grids on the road network;
[0008] For each moving point, determine the grid where the moving point is located and at least one candidate grid from the multiple grids, determine the target road corresponding to the moving point from the grid where the moving point is located and the at least one candidate grid, and project the moving point onto the target road to obtain a corresponding second positioning point;
[0009] Trajectory fitting is performed on each stop point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated to obtain the trajectory of the user within a preset time period.
[0010] In an optional embodiment of the present application, determining a stay point and a moving point among a plurality of first positioning points based on signaling data includes:
[0011] Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated, and determine at least one starting first positioning point;
[0012] In order of precedence, based on the signaling data, the distances between each first positioning point after the starting first positioning point and the starting positioning point are determined in sequence, and a first positioning point before the first first positioning point whose distance is greater than the preset stay radius is determined as the ending first positioning point;
[0013] If the corresponding time difference between the starting first positioning point and the ending first positioning point is not less than the preset stay time, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as stay points; otherwise, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as moving points.
[0014] In an optional embodiment of the present application, the method further includes:
[0015] After forming multiple grids on the road network, the coordinates of the vertex at the lower left corner of each grid are used as its grid number, and the coordinates of the vertex at the lower left corner of each grid are determined as follows:
[0016] The vertex of the lower left corner of the grid at the lower left corner of the road network of the region is determined as the origin, and the lower left corner grid is used as the starting grid for sorting the grids in the longitude direction and in the latitude direction;
[0017] The serial number of each other grid relative to the grid at the lower left corner in the latitude direction is used as the abscissa of the vertex at the lower left corner of the grid, and the serial number of the grid relative to the grid at the lower left corner in the longitude direction is used as the ordinate of the vertex at the lower left corner of the grid;
[0018] Accordingly, for each moving point, determining the grid where the moving point is located and at least one candidate grid from multiple grids includes:
[0019] Get the longitude and latitude spacing when the road network of the region is divided into equal intervals;
[0020] Based on the longitude, latitude, longitude direction spacing and latitude direction spacing of each moving point, the number of the grid where the moving point is located is obtained, and at least one candidate grid for the moving point is determined based on the number of the grid where the moving point is located.
[0021] In an optional embodiment of the present application, determining at least one candidate grid for the moving point based on the number of the grid in which the moving point is located includes:
[0022] Taking the grid corresponding to the number of the grid where each moving point is located as the center, another eight grids are obtained from the grid of the road map to form a nine-square grid, and the other eight grids are the candidate grids of the moving point.
[0023] In an optional embodiment of the present application, determining a target road corresponding to the moving point from the grid in which the moving point is located and at least one candidate grid, and projecting the moving point to the target road to obtain a corresponding second positioning point includes:
[0024] For each moving point, if the grid in which the moving point is located contains at least one road, the moving point is projected onto each road in the grid in which the moving point is located, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; if the grid in which the moving point is located does not contain a road, the moving point is projected onto each road in at least one candidate grid, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point;
[0025] Each moving point is projected onto a corresponding target road, and a corresponding projection point on the target road is used as a second positioning point of the moving point.
[0026] In an optional embodiment of the present application, trajectory fitting is performed on each stop point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated to obtain the trajectory of the user within a preset time period, including:
[0027] Adjacent stop points and second positioning points are connected in order of precedence. For two adjacent second positioning points, if the two adjacent second positioning points are on the same road, they are connected in order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate node between them is obtained and connected in order of precedence, so as to obtain the user's trajectory within the preset time period.
[0028] In an optional embodiment of the present application, if two adjacent second positioning points are not on the same road, then the intermediate nodes between the two are obtained and connected in order, including:
[0029] Taking two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes;
[0030] In the process of obtaining the shortest path between two adjacent second positioning points using the breadth-first search algorithm, a path passing through a preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined;
[0031] The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
[0032] In a second aspect, an embodiment of the present application provides a user trajectory acquisition device, including:
[0033] A first positioning point acquisition module, used to acquire a plurality of corresponding first positioning points based on the signaling data of the user within a preset time period, and determine a stay point and a moving point among the plurality of first positioning points based on the signaling data;
[0034] The data network division module is used to divide the road network in the area where the user is located into equal intervals in the longitude direction and the latitude direction, forming multiple grids on the road network;
[0035] A second positioning point acquisition module is used to determine, for each moving point, a grid where the moving point is located and at least one candidate grid from a plurality of grids, determine a target road corresponding to the moving point from the grid where the moving point is located and the at least one candidate grid, and project the moving point onto the target road to obtain a corresponding second positioning point;
[0036] The trajectory fitting module is used to perform trajectory fitting on each stop point and the second positioning point corresponding to each moving point according to the order in which the corresponding signaling data is generated, so as to obtain the trajectory of the user within a preset time period.
[0037] In an optional embodiment of the present application, the first positioning point acquisition module is specifically used to:
[0038] Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated, and determine at least one starting first positioning point;
[0039] In order of precedence, based on the signaling data, the distances between each first positioning point after the starting first positioning point and the starting positioning point are determined in sequence, and a first positioning point before the first first positioning point whose distance is greater than the preset stay radius is determined as the ending first positioning point;
[0040] If the corresponding time difference between the starting first positioning point and the ending first positioning point is not less than the preset stay time, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as stay points; otherwise, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as moving points.
[0041] In an optional embodiment of the present application, the device further includes a grid number acquisition module, which is used to:
[0042] After forming multiple grids on the road network, the coordinates of the vertex at the lower left corner of each grid are used as its grid number, and the coordinates of the vertex at the lower left corner of each grid are determined as follows:
[0043] The vertex of the lower left corner of the grid at the lower left corner of the road network of the region is determined as the origin, and the lower left corner grid is used as the starting grid for sorting the grids in the longitude direction and in the latitude direction;
[0044] The serial number of each other grid relative to the grid at the lower left corner in the latitude direction is used as the abscissa of the vertex at the lower left corner of the grid, and the serial number of the grid relative to the grid at the lower left corner in the longitude direction is used as the ordinate of the vertex at the lower left corner of the grid;
[0045] Accordingly, the second positioning point acquisition module is specifically used for:
[0046] Get the longitude and latitude spacing when the road network of the region is divided into equal intervals;
[0047] Based on the longitude, latitude, longitude direction spacing and latitude direction spacing of each moving point, the number of the grid where the moving point is located is obtained, and at least one candidate grid for the moving point is determined based on the number of the grid where the moving point is located.
[0048] In an optional embodiment of the present application, the second positioning point acquisition module is further used to:
[0049] Taking the grid corresponding to the number of the grid where each moving point is located as the center, another eight grids are obtained from the grid of the road map to form a nine-square grid, and the other eight grids are the candidate grids of the moving point.
[0050] In an optional embodiment of the present application, the second positioning point acquisition module is further used to:
[0051] For each moving point, if the grid in which the moving point is located contains at least one road, the moving point is projected onto each road in the grid in which the moving point is located, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; if the grid in which the moving point is located does not contain a road, the moving point is projected onto each road in at least one candidate grid, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point;
[0052] Each moving point is projected onto a corresponding target road, and a corresponding projection point on the target road is used as a second positioning point of the moving point.
[0053] In an optional embodiment of the present application, the trajectory fitting module is specifically used for:
[0054] Adjacent stop points and second positioning points are connected in order of precedence. For two adjacent second positioning points, if the two adjacent second positioning points are on the same road, they are connected in order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate node between them is obtained and connected in order of precedence, so as to obtain the user's trajectory within the preset time period.
[0055] In an optional embodiment of the present application, the trajectory fitting module is further used to:
[0056] Taking two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes;
[0057] In the process of obtaining the shortest path between two adjacent second positioning points using the breadth-first search algorithm, a path passing through a preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined;
[0058] The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
[0059] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;
[0060] A computer program is stored in the memory;
[0061] A processor is used to execute a computer program to implement the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.
[0062] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect is implemented.
[0063] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. 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 when the computer device executes, the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect is implemented.
[0064] The beneficial effects of the technical solution provided by this application are:
[0065] First, the stay points and moving points in the user's first positioning point within the preset time period are determined. Then, based on the grid division of the road network in the area where the user is located, the grid and multiple candidate grids corresponding to each moving point are determined, and the target road is determined from these grids, and then the moving point is restored to the corresponding target road to obtain the corresponding second positioning point. Finally, the actual trajectory of the user in the preset time period is obtained by fitting the stay points in the first positioning point and the second positioning point corresponding to the moving point. This solution obtains the actual trajectory of the user in the preset time period by restoring the moving point to the road, and in the restoration process, the road network is gridded to improve the efficiency of restoring the moving point road, thereby improving the efficiency of obtaining the user's actual trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0067] Figure 1 A flowchart of a method for obtaining user trajectories provided in an embodiment of the present application;
[0068] Figure 2 A schematic diagram of a grid divided on a road network in an example of an embodiment of the present application;
[0069] Figure 3 A structural block diagram of a user trajectory acquisition device is provided for an embodiment of the present application;
[0070] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0072] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0073] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0074] Figure 1 A flowchart of a method for obtaining user trajectories provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method may include:
[0075] Step S101: based on the signaling data of the user within a preset time period, a corresponding plurality of first positioning points are acquired, and based on the signaling data, a stay point and a moving point among the plurality of first positioning points are determined.
[0076] The execution subject of the method may be a system that provides positioning services, such as a GIS (Geographic Information System), which can obtain signaling data generated by a terminal device used by a user.
[0077] The preset time period is the time period corresponding to the user's trajectory that needs to be obtained, and can be set according to needs, for example, it can be a certain day.
[0078] Specifically, if it is determined that the user's trajectory within a preset time period needs to be obtained, then first obtain multiple signaling data of the user within the preset time period. Then, arrange these signaling data in the order of generation. Based on these signaling data, multiple first positioning points corresponding to the user are obtained. It can be understood that these first positioning points are actually the locations of the base stations to which the user's terminal device is connected. In order to obtain the user's true trajectory, it is necessary to distinguish which are the staying points and which are the moving points for the determined first positioning points. For the staying points, the location of the base station can be determined as the user's location, that is, the first positioning point is determined as the user's location. For the moving points, the location of the base station needs to be restored to the road, that is, the first positioning point is determined as the corresponding point on the restored road (that is, the second positioning point in the following text).
[0079] Step S102, dividing the road network in the area where the user is located into equal intervals in the longitude direction and the latitude direction, forming a plurality of grids on the road network.
[0080] The area where the user is located may be the city where the user is located within a preset time period, and the road network is obtained based on the road data obtained from an open source database (Open Street Map). Specifically, the obtained road data may be structured preprocessed, and each line segment therein may be stored as a road, and the stored information includes the coordinates of the two endpoints of each road, and the distance between the two endpoints. Then, the obtained road network contains multiple determined roads.
[0081] Specifically, after obtaining the road network of the area where the user is located, the road network is divided into multiple grid areas by equidistant in the longitude direction and the latitude direction. Specifically, the interval distance when dividing in the longitude direction can be equal to the interval distance when dividing in the latitude direction, so that all the obtained grids are square grids. In terms of distance, it can be divided in the longitude direction and the latitude direction at intervals of 50 meters, so that multiple grids with a side length of 50 meters can be obtained.
[0082] It should be noted that the road network is divided into grids to facilitate the subsequent restoration of moving points to corresponding roads, which will be described in detail later.
[0083] Step S103, for each moving point, determine the grid where the moving point is located and at least one candidate grid from multiple grids, and determine the target road corresponding to the moving point from the grid where the moving point is located and at least one candidate grid, and project the moving point to the target road to obtain a corresponding second positioning point.
[0084] Specifically, for the mobile points, since they actually indicate the location of the base station to which the user is connected, in order to obtain the user's actual movement trajectory, it is necessary to obtain the user's actual location, that is, it is necessary to find the points on the road corresponding to these mobile points, that is, to restore the mobile points in the first positioning points to the corresponding roads, and obtain the second positioning points for obtaining the user's actual trajectory.
[0085] First, the grid where each moving point is located on the road network is obtained, and then multiple candidate grids are determined based on the grid, and these grids all contain road information. Then, according to the position of the moving point and the road information contained in these grids, the target road corresponding to the moving point is determined from the roads in these grids, that is, the target road to which the moving point needs to be restored. Finally, the moving point is projected to the corresponding target road, and the corresponding second positioning point is obtained.
[0086] Since multiple grids are pre-divided in the road network, in the process of determining the target road of the moving point, the grid where the moving point is located and multiple candidate grids are first determined, and then only the roads in these grids need to be traversed instead of all the roads in the entire road network, which greatly improves the efficiency of restoring the moving point to the road.
[0087] Step S104, performing trajectory fitting on each stop point and the second positioning point corresponding to each moving point according to the order in which the corresponding signaling data is generated, to obtain the trajectory of the user within a preset time period.
[0088] Specifically, the trajectory fitting is performed on the stay points in the first positioning point and the second positioning points corresponding to the moving points in a sequence, that is, the trajectory of the user in the preset time period is obtained. Specifically, the stay point indicates the place where the user stays, which is generally fixed, so it is only necessary to connect the stay point with the second positioning points corresponding to the moving points before and after it. As for the second positioning point, it is also necessary to connect them in sequence, and it is necessary to ensure that the obtained trajectory is on the road of the road network during the fitting process. Then, the trajectory of the user in the preset time period can reflect the place where the user stays in each time period and the road passed by during the movement.
[0089] The solution provided by the present application first determines the stay points and moving points in the user's first positioning point within a preset time period. Then, based on the grid division of the road network in the area where the user is located, the grid and multiple candidate grids corresponding to each moving point are determined, and the target road is determined from these grids, and then the moving point is restored to the corresponding target road to obtain the corresponding second positioning point. Finally, the actual trajectory of the user in the preset time period is obtained by fitting the stay points in the first positioning point and the second positioning point corresponding to the moving point. This solution obtains the actual trajectory of the user in the preset time period by restoring the moving point to the road, and in the restoration process, the method of gridding the road network is adopted to improve the efficiency of restoring the moving point road, thereby improving the efficiency of obtaining the actual trajectory of the user.
[0090] In an optional embodiment of the present application, the method may further include:
[0091] Based on the signaling data of the user within the preset time period, before acquiring the corresponding multiple first positioning points, the initial signaling data of the user within the preset time end is preprocessed to obtain the signaling data within the preset time period.
[0092] Specifically, the processing of the initial signaling data may include but is not limited to ping-pong point processing and drift point processing.
[0093] Specifically, the ping-pong point processing process may include:
[0094] (1) Initial signaling data of the same user within a preset time period are aggregated, and each initial signaling data in the aggregation is arranged in the order of generation.
[0095] (2) Sequentially select the i-th, i+1-th, and i+2-th initial signaling data from the initial signaling data. If the time difference between the i-th and i+1-th data is Δ t1 The time difference Δt2 of the i+1th and i+2th data is less than the time threshold t p , then jump to step (3), otherwise jump to step (4).
[0096] (3) Compare the lackel values of the i, i+1, and i+2 initial signaling data respectively. If the lackel values of the i+1 and i+2 initial signaling data are the same, but the lackel values of the i and i+1 initial signaling data are different, then the i+1 initial signaling data is determined to be ping-pong point data, then the i initial signaling data is deleted, or the i+2 initial signaling data is deleted.
[0097] Step 4: If i+2 is the total number of items in the aggregation, the traversal ends; otherwise, let i=i+1 and proceed to step (2) (i.e., select the three initial signaling data items i+1, i+2, and i+3 for the above processing).
[0098] The process of handling drift points can include:
[0099] (1) Aggregating the initial signaling data of the same user within a preset time period, and arranging the initial signaling data in the aggregation in the order of generation;
[0100] (2) Sequentially select the i, i+1, and i+2 initial signaling data. If the distance between the i-th item and the i+2-th item is greater than three times the distance between the i-th item and the i+1-th item (it can also be other multiples, which are set according to parameters such as the density of the base stations), the i+2-th initial signaling parameter is considered to be a drift point and is removed, and the process proceeds to step (3).
[0101] (3) If i+2 is the total number of items in the aggregation, the traversal ends; otherwise, let i=i+1 and proceed to step (2) (i.e., select the three initial signaling data items i+1, i+2, and i+3 for the above processing).
[0102] By preprocessing the initial signaling data within a preset time period, ping-pong points and drift points can be eliminated to obtain more accurate signaling data, thereby making the subsequent user trajectory based on the signaling data more accurate.
[0103] In an optional embodiment of the present application, determining a stay point and a moving point among a plurality of first positioning points based on signaling data includes:
[0104] Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated, and determine at least one starting first positioning point;
[0105] In order of precedence, based on the signaling data, the distances between each first positioning point after the starting first positioning point and the starting positioning point are determined in sequence, and a first positioning point before the first first positioning point whose distance is greater than the preset stay radius is determined as the ending first positioning point;
[0106] If the corresponding time difference between the starting first positioning point and the ending first positioning point is not less than the preset stay time, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as stay points; otherwise, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as moving points.
[0107] Specifically, the process of determining the stay point and the moving point in the first positioning point may include:
[0108] (1) Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated.
[0109] (2) Sequentially select two first positioning points M1 (the starting first positioning point) and M2, calculate the distance from M2 to M1, and if the distance from M2 to M1 is less than the preset stop radius d (which can be set according to the spacing between base stations), then it is considered that M1 and M2 may constitute a stop. Then, continuously select the third first positioning point M3, and if the distance from M3 to M1 is less than the preset stop radius d, then it is considered that M1, M2, and M3 may be in the same stop area, and so on. When the nth first positioning point Mn is selected, if the distance from Mn to M1 is greater than the preset stop radius d, then the loop is stopped, and the n-1th first positioning point M(n-1) is determined as the corresponding end first positioning point.
[0110] (3) Calculate the time difference Δt between M1 and M(n-1). If Δt is greater than the preset dwell time t z , it is considered that a stop is constituted, and M1…M_(n-1) are in the same circular stop area, that is, these first positioning points are all stop points. Therefore, the generation time of M1 is the start time of the stop, and the generation time of M(n-1) is the end time of the stop.
[0111] (4) If Δt is less than the preset residence time t z , then it is considered that M1…M(n-1) cannot constitute a stop, that is, these first positioning points are all moving points. Then select Mn and M(n+1) points in sequence, go to step (2), and continue to loop until all the first positioning points are judged and all the first positioning points are determined to be stop points or moving points.
[0112] In an optional embodiment of the present application, the method may further include:
[0113] After forming multiple grids on the road network, the coordinates of the vertex at the lower left corner of each grid are used as its grid number, and the coordinates of the vertex at the lower left corner of each grid are determined as follows:
[0114] The vertex of the lower left corner of the grid at the lower left corner of the road network of the region is determined as the origin, and the lower left corner grid is used as the starting grid for sorting the grids in the longitude direction and in the latitude direction;
[0115] The serial number of each other grid relative to the grid in the lower left corner in the latitude direction is used as the horizontal coordinate of the vertex in the lower left corner of the grid, and the serial number of the grid relative to the grid in the longitude direction is used as the vertical coordinate of the vertex in the lower left corner of the grid.
[0116] Specifically, after the road network is divided into multiple grids, each grid can be numbered so that when the moving point is subsequently restored to the corresponding target road, the grid where the moving point is located and the corresponding candidate grid can be found more quickly based on the number. Specifically, the coordinates of the vertex at the lower left corner of each grid are used as its grid number.
[0117] Specifically, if Figure 2 As shown, 9 grids are given, the X-axis direction is the latitude direction (along the latitude direction), the Y-axis is the longitude direction (along the longitude direction), and the A grid is the starting grid in the sorting order, and its lower left corner vertex is the origin (0,0). Then the numbers of the eight grids B, C, D, E, F, G, H, and I are (1,0), (2,0), (0,1), (1,1), (2,1), (0,2), (1,2), and (2,2) respectively.
[0118] Accordingly, for each moving point, determining the grid where the moving point is located and at least one candidate grid from multiple grids includes:
[0119] Get the longitude and latitude spacing when the road network of the region is divided into equal intervals;
[0120] Based on the longitude, latitude, longitude direction spacing and latitude direction spacing of each moving point, the number of the grid where the moving point is located is obtained, and at least one candidate grid for the moving point is determined based on the number of the grid where the moving point is located.
[0121] Specifically, for each moving point, obtain the longitude difference between it and the origin, and the latitude difference between it and the origin, and then obtain the spacing latitude difference corresponding to the spacing in the longitude direction when the grid is divided, and the spacing longitude difference in the latitude direction. Then, the horizontal coordinate of the number of the grid where the moving point is located can be obtained by dividing the longitude difference by the spacing longitude difference and rounding down, and the vertical coordinate of the number of the grid where the moving point is located can be obtained by dividing the latitude difference by the spacing latitude difference and rounding down, and then the number of the grid where the moving point is located can be obtained. For example, if the longitude difference divided by the spacing longitude difference is 1.2, and the latitude difference divided by the spacing latitude difference is 2.5, then the grid number of the grid where the moving point is located is (1, 2). Considering that there may be errors if the target road is determined only from the grid where the moving point is located, after determining the number of the grid where the moving point is located, that is, after determining the grid where it is located, the candidate grid of the moving point is further determined according to the position of the grid in the road map.
[0122] Further, determining at least one candidate grid for the moving point based on the number of the grid in which the moving point is located includes:
[0123] Taking the grid corresponding to the number of the grid where each moving point is located as the center, another eight grids are obtained from the grid of the road map to form a nine-square grid, and the other eight grids are the candidate grids of the moving point.
[0124] For example, refer again to Figure 2 If the grid number of the grid where the moving point is located is determined to be (1, 1) (i.e., grid E), then the eight grids A, B, C, D, F, G, H, and I surrounding it are all determined as candidate grids.
[0125] In an optional embodiment of the present application, determining a target road corresponding to the moving point from the grid in which the moving point is located and at least one candidate grid, and projecting the moving point to the target road to obtain a corresponding second positioning point includes:
[0126] For each moving point, if the grid in which the moving point is located contains at least one road, the moving point is projected onto each road in the grid in which the moving point is located, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; if the grid in which the moving point is located does not contain a road, the moving point is projected onto each road in at least one candidate grid, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point;
[0127] Each moving point is projected onto a corresponding target road, and a corresponding projection point on the target road is used as a second positioning point of the moving point.
[0128] Specifically, each grid contains road information, including two end points of the road and the distance between the two end points. After determining the grid where the moving point is located and multiple candidate grids, if the grid where the moving point is located contains a road, the moving point is preferentially projected onto the road in the grid where the moving point is located, and the lengths of the projection lines formed by each projection are compared, and the road corresponding to the shortest projection line is determined as the target road. If the grid where the moving point is located does not contain a road, the moving point is projected onto the road of the candidate grid, and the lengths of the projection lines formed by each projection are compared, and the road corresponding to the shortest projection line is determined as the target road. It can be understood that the target road can be located in any of the grids determined above. In the process of confirming the target road, the grid where the moving point is located is first searched, and if it cannot be obtained, it is searched from the candidate grid. Furthermore, the priority order in the search process can also be set for the candidate grids, and the cycle is performed according to the priority order, with one candidate grid cycled each time. Specifically, if the target road is not found from a candidate grid, the target road is continued to be searched from the next candidate grid; if the target road is found from a candidate grid first, the cycle of the next candidate grid is not performed.
[0129] Then, the projection point of the moving point on the target road is used as the second positioning point of the moving point. The second positioning point can be considered as the actual position of the user during the movement process, and will be used to subsequently obtain the actual trajectory of the user.
[0130] In an optional embodiment of the present application, trajectory fitting is performed on each stop point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated to obtain the trajectory of the user within a preset time period, including:
[0131] For adjacent stop points and second positioning points, they are connected in order of precedence. For two adjacent second positioning points, if the two adjacent moving points are on the same road, they are connected in order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate node between them is obtained and connected in order of precedence, so as to obtain the user's trajectory within the preset time period.
[0132] Specifically, since the stop point generally corresponds to a fixed place such as the user's residence or company, it is reflected as a corresponding point in the trajectory. Therefore, the fitting process only needs to connect it with the second positioning points before and after it. For the second positioning point, if two adjacent second positioning points are on the same road, they can be directly connected in order. If the two adjacent second positioning points are not on the same road, it is necessary to further obtain the intermediate nodes between the two second positioning points and connect them to obtain the shortest path (or motion trajectory) from one second positioning point to another second positioning point.
[0133] In an optional embodiment of the present application, if two adjacent second positioning points are not on the same road, then the intermediate nodes between the two are obtained and connected in order, including:
[0134] Taking two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes;
[0135] In the process of obtaining the shortest path between two adjacent second positioning points using the breadth-first search algorithm, a path passing through a preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined;
[0136] The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
[0137] Specifically, the prior art directly uses the breadth first search (BFS) algorithm to obtain the shortest path between two points, which has the problems of large search volume and low efficiency. In the solution of the embodiment of the present application, before executing the BFS algorithm, an elliptical area is first determined according to the two second positioning points, and a higher search weight is set for the endpoints of each road in the elliptical area, that is, these endpoints are used as preferred intermediate nodes in the BFS algorithm.
[0138] Specifically, first, the first of the two second positioning points is used as the starting point, and the second positioning point is used as the ending point. The starting point and the ending point are used as the focus and the elliptical area is constructed with the preset eccentricity. The sum of the Euclidean distances from the end point of the road to the starting point and the ending point is compared with the major axis length of the elliptical area. If the sum of the Euclidean distances is less than the major axis length, the end point falls within this range and is determined as the preferred intermediate node. Then the BFS algorithm is used to obtain the shortest path between the starting point and the ending point, and in this process, the path passing through the preferred intermediate node is preferentially transferred to obtain multiple alternative paths, and the lengths of the alternative paths are compared to obtain the shortest path, and finally the shortest path is used as the trajectory from the starting point to the ending point.
[0139] It should be noted that the BFS algorithm may adopt the Dijkstra algorithm. The fitting algorithm of the embodiment of the present application performs spatial constraint optimization on Dijkstra, thereby greatly improving the fitting efficiency.
[0140] In summary, after the above trajectory is determined, the complete trajectory of the user in the preset time period is obtained, from which the places where the user has stayed and the roads along which the user has moved can be known.
[0141] Figure 3 A structural block diagram of a user trajectory acquisition device provided in an embodiment of the present application, such as Figure 3 As shown, the device 300 may include: a first positioning point acquisition module 301, a data network division module 302, a second positioning point acquisition module 303 and a trajectory fitting module 304, wherein:
[0142] The first positioning point acquisition module 301 is used to acquire a plurality of corresponding first positioning points based on the signaling data of the user within a preset time period, and determine the stay points and the moving points among the plurality of first positioning points based on the signaling data;
[0143] The data network division module 302 is used to divide the road network in the area where the user is located into equal intervals in the longitude direction and the latitude direction, and form a plurality of grids on the road network;
[0144] The second positioning point acquisition module 303 is used to determine, for each moving point, a grid where the moving point is located and at least one candidate grid from multiple grids, and determine a target road corresponding to the moving point from the grid where the moving point is located and the at least one candidate grid, and project the moving point onto the target road to obtain a corresponding second positioning point;
[0145] The trajectory fitting module 304 is used to perform trajectory fitting on each stop point and the second positioning point corresponding to each moving point according to the order in which the corresponding signaling data is generated, so as to obtain the trajectory of the user within a preset time period.
[0146] The solution provided by the present application first determines the stay points and moving points in the user's first positioning point within a preset time period. Then, based on the grid division of the road network in the area where the user is located, the grid and multiple candidate grids corresponding to each moving point are determined, and the target road is determined from these grids, and then the moving point is restored to the corresponding target road to obtain the corresponding second positioning point. Finally, the actual trajectory of the user in the preset time period is obtained by fitting the stay points in the first positioning point and the second positioning point corresponding to the moving point. This solution obtains the actual trajectory of the user in the preset time period by restoring the moving point to the road, and in the restoration process, the method of gridding the road network is adopted to improve the efficiency of restoring the moving point road, thereby improving the efficiency of obtaining the actual trajectory of the user.
[0147] In an optional embodiment of the present application, the first positioning point acquisition module is specifically used to:
[0148] Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated, and determine at least one starting first positioning point;
[0149] In order of precedence, based on the signaling data, the distances between each first positioning point after the starting first positioning point and the starting positioning point are determined in sequence, and a first positioning point before the first first positioning point whose distance is greater than the preset stay radius is determined as the ending first positioning point;
[0150] If the corresponding time difference between the starting first positioning point and the ending first positioning point is not less than the preset stay time, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as stay points; otherwise, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as moving points.
[0151] In an optional embodiment of the present application, the device further includes a grid number acquisition module, which is used to:
[0152] After forming multiple grids on the road network, the coordinates of the vertex at the lower left corner of each grid are used as its grid number, and the coordinates of the vertex at the lower left corner of each grid are determined as follows:
[0153] The vertex of the lower left corner of the grid at the lower left corner of the road network of the region is determined as the origin, and the lower left corner grid is used as the starting grid for sorting the grids in the longitude direction and in the latitude direction;
[0154] The serial number of each other grid relative to the grid at the lower left corner in the latitude direction is used as the abscissa of the vertex at the lower left corner of the grid, and the serial number of the grid relative to the grid at the lower left corner in the longitude direction is used as the ordinate of the vertex at the lower left corner of the grid;
[0155] Accordingly, the second positioning point acquisition module is specifically used for:
[0156] Get the longitude and latitude spacing when the road network of the region is divided into equal intervals;
[0157] Based on the longitude, latitude, longitude direction spacing and latitude direction spacing of each moving point, the number of the grid where the moving point is located is obtained, and at least one candidate grid for the moving point is determined based on the number of the grid where the moving point is located.
[0158] In an optional embodiment of the present application, the second positioning point acquisition module is further used to:
[0159] Taking the grid corresponding to the number of the grid where each moving point is located as the center, another eight grids are obtained from the grid of the road map to form a nine-square grid, and the other eight grids are the candidate grids of the moving point.
[0160] In an optional embodiment of the present application, the second positioning point acquisition module is further used to:
[0161] For each moving point, if the grid in which the moving point is located contains at least one road, the moving point is projected onto each road in the grid in which the moving point is located, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; if the grid in which the moving point is located does not contain a road, the moving point is projected onto each road in at least one candidate grid, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point;
[0162] Each moving point is projected onto a corresponding target road, and a corresponding projection point on the target road is used as a second positioning point of the moving point.
[0163] In an optional embodiment of the present application, the trajectory fitting module is specifically used for:
[0164] Adjacent stop points and second positioning points are connected in order of precedence. For two adjacent second positioning points, if the two adjacent second positioning points are on the same road, they are connected in order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate node between them is obtained and connected in order of precedence, so as to obtain the user's trajectory within the preset time period.
[0165] In an optional embodiment of the present application, the trajectory fitting module is further used to:
[0166] Taking two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes;
[0167] In the process of obtaining the shortest path between two adjacent second positioning points using the breadth-first search algorithm, a path passing through a preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined;
[0168] The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
[0169] Reference below Figure 4 , which shows an electronic device suitable for implementing the embodiments of the present application (for example, executing Figure 1 The electronic device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0170] The electronic device includes: a memory and a processor, the memory is used to store a program for executing the method described in each of the above method embodiments; the processor is configured to execute the program stored in the memory. The processor here can be referred to as the processing device 401 described below, and the memory can include at least one of the read-only memory (ROM) 402, the random access memory (RAM) 403, and the storage device 408 described below, as shown below:
[0171] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0172] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0173] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present application are executed.
[0174] It should be noted that the computer-readable storage medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0175] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0176] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0177] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0178] Based on the signaling data of the user within a preset time period, a corresponding plurality of first positioning points are obtained, and the stay points and moving points among the plurality of first positioning points are determined based on the signaling data; the road network of the area where the user is located is divided into equal intervals in the longitude direction and the latitude direction, respectively, to form a plurality of grids on the road network; for each moving point, a grid where the moving point is located and at least one candidate grid are determined from the plurality of grids, and a target road corresponding to the moving point is determined from the grid where the moving point is located and the at least one candidate grid, and the moving point is projected onto the target road to obtain a corresponding second positioning point; trajectory fitting is performed on each stay point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated, to obtain the trajectory of the user within the preset time period.
[0179] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0180] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0181] The modules or units involved in the embodiments of the present application may be implemented by software or hardware. The name of a module or unit does not limit the unit itself in some cases. For example, a proxy link acquisition module may also be described as a "module for acquiring proxy links".
[0182] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0183] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0184] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific method implemented when the above-described computer-readable medium is executed by an electronic device can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0185] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. 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 when the computer device executes the computer instructions, the following conditions are achieved:
[0186] Based on the signaling data of the user within a preset time period, a corresponding plurality of first positioning points are obtained, and the stay points and moving points among the plurality of first positioning points are determined based on the signaling data; the road network of the area where the user is located is divided into equal intervals in the longitude direction and the latitude direction, respectively, to form a plurality of grids on the road network; for each moving point, a grid where the moving point is located and at least one candidate grid are determined from the plurality of grids, and a target road corresponding to the moving point is determined from the grid where the moving point is located and the at least one candidate grid, and the moving point is projected onto the target road to obtain a corresponding second positioning point; trajectory fitting is performed on each stay point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated, to obtain the trajectory of the user within the preset time period.
[0187] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0188] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for obtaining user trajectory, characterized in that: include: Based on the signaling data of the user within a preset time period, a corresponding plurality of first positioning points are acquired, and based on the signaling data, a stay point and a moving point among the plurality of first positioning points are determined; Dividing the road network in the area where the user is located at equal intervals in the longitude direction and the latitude direction to form a plurality of grids on the road network; For each moving point, determine a grid where the moving point is located and at least one candidate grid from the multiple grids, determine a target road corresponding to the moving point from the grid where the moving point is located and the at least one candidate grid, and project the moving point onto the target road to obtain a corresponding second positioning point; Performing trajectory fitting on each stop point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated, to obtain the trajectory of the user within the preset time period; The step of performing trajectory fitting on each stop point and the second positioning point corresponding to each moving point in the order in which the corresponding signaling data is generated to obtain the trajectory of the user within the preset time period specifically includes: For adjacent stop points and second positioning points, they are connected in the order of precedence. For two adjacent second positioning points, if the two adjacent second positioning points are on the same road, they are connected in the order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate nodes between them are obtained and connected in the order of precedence, so as to obtain the trajectory of the user in the preset time period; If the two adjacent second positioning points are not on the same road, then obtaining the intermediate nodes between the two and connecting them in the order of precedence specifically includes: Taking the two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes; In the process of obtaining the shortest path between the two adjacent second positioning points by using the breadth-first search algorithm, the path passing through the preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined; The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
2. The method according to claim 1, characterized in that The determining, based on the signaling data, the stay points and the moving points among the plurality of first positioning points comprises: Arrange the multiple first positioning points in the order in which the corresponding signaling data are generated, and determine at least one starting first positioning point; In the sequence, based on the signaling data, the distances between each first positioning point after the starting first positioning point and the starting positioning point are determined in sequence, and a first positioning point before the first positioning point whose distance is greater than the preset stay radius is determined as the ending first positioning point; If the corresponding time difference between the starting first positioning point and the ending first positioning point is not less than the preset stay time, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as stay points; otherwise, the starting first positioning point, the ending first positioning point and each first positioning point between the two are determined as moving points.
3. The method according to claim 1, characterized in that The method further comprises: After a plurality of grids are formed on the road network, the coordinates of the vertex at the lower left corner of each grid are used as its grid number, and the coordinates of the vertex at the lower left corner of each grid are determined as follows: Determine the vertex of the lower left corner of the grid at the lower left corner of the road network in the area as the origin, and use the lower left corner grid as the starting grid for sorting the grids in the longitude direction and in the latitude direction; The serial number of each other grid relative to the grid at the lower left corner in the latitude direction is used as the abscissa of the vertex at the lower left corner of the grid, and the serial number of the grid relative to the grid at the lower left corner in the longitude direction is used as the ordinate of the vertex at the lower left corner of the grid; Accordingly, for each moving point, determining the grid where the moving point is located and at least one candidate grid from the multiple grids includes: Obtaining the spacing in the longitude direction and the spacing in the latitude direction when the road network of the area is divided into equal intervals; Based on the longitude, latitude, longitude direction spacing and latitude direction spacing of each moving point, the number of the grid where the moving point is located is obtained, and the at least one candidate grid of the moving point is determined based on the number of the grid where the moving point is located.
4. The method according to claim 3, characterized in that The determining the at least one candidate grid of the moving point based on the number of the grid in which the moving point is located comprises: Taking the grid corresponding to the number of the grid where each moving point is located as the center, another eight grids are obtained from the grids of the road map to form a nine-square grid, and the other eight grids are candidate grids for the moving point.
5. The method according to claim 1, characterized in that The step of determining a target road corresponding to the moving point from the grid and the at least one candidate grid, and projecting the moving point onto the target road to obtain a corresponding second positioning point includes: For each moving point, if the grid in which the moving point is located contains at least one road, the moving point is projected onto each road in the grid in which the moving point is located, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; if the grid in which the moving point is located does not contain a road, the moving point is projected onto each road in the at least one candidate grid, and the road corresponding to the shortest projection line is determined as the target road corresponding to the moving point; Each moving point is projected onto a corresponding target road, and a corresponding projection point on the target road is used as a second positioning point of the moving point.
6. A user trajectory acquisition device, characterized in that: include: A first positioning point acquisition module, configured to acquire a plurality of corresponding first positioning points based on signaling data of the user within a preset time period, and determine a stay point and a moving point among the plurality of first positioning points based on the signaling data; A data network division module, used for dividing the road network of the area where the user is located into equal intervals in the longitude direction and the latitude direction, and forming a plurality of grids on the road network; A second positioning point acquisition module is used to determine, for each moving point, a grid where the moving point is located and at least one candidate grid from the multiple grids, determine a target road corresponding to the moving point from the grid where the moving point is located and the at least one candidate grid, and project the moving point onto the target road to obtain a corresponding second positioning point; A trajectory fitting module, used to perform trajectory fitting on each stop point and the second positioning point corresponding to each moving point according to the order in which the corresponding signaling data is generated, to obtain the trajectory of the user within the preset time period; Wherein, the trajectory fitting module is specifically used for: For adjacent stop points and second positioning points, they are connected in the order of precedence. For two adjacent second positioning points, if the two adjacent second positioning points are on the same road, they are connected in the order of precedence. If the two adjacent second positioning points are not on the same road, the intermediate nodes between them are obtained and connected in the order of precedence, so as to obtain the trajectory of the user in the preset time period; The trajectory fitting module is further used for: Taking the two adjacent second positioning points as foci and constructing an elliptical area with a preset eccentricity, and obtaining the endpoints of each road in the elliptical area as preferred intermediate nodes; In the process of obtaining the shortest path between the two adjacent second positioning points by using a breadth-first search algorithm, a path passing through the preferred intermediate node is preferentially searched, and then the corresponding intermediate node is determined; The two adjacent second positioning points and the intermediate node are connected according to the shortest path obtained by using a breadth-first search algorithm.
7. An electronic device, characterized in that: including memory and processor; The memory stores a computer program; The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Road network matching method and system
CN108955693A
Travel track generation method and device, electronic equipment and storage medium
CN111405483A
