Transportation route generation method and device, electronic equipment and storage medium
By calculating the similarity and classification of trajectory data, recommended transportation routes are generated, which solves the problem of inability to effectively utilize trajectory data in the existing technology, realizes the extraction of valuable transportation route information from a large amount of trajectory data, and supports traffic analysis and urban planning. .
Patent Information
- Application Number
- CN202310154506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2024-08-23
AI Technical Summary
Existing technologies cannot effectively generate recommended transportation routes from a large amount of trajectory data, and fail to fully mine and analyze trajectory data to support traffic flow analysis and urban planning.
By obtaining multiple sets of trajectory data at preset start and end positions, the similarity between any two sets of trajectory data is calculated, classified according to the similarity, and a recommended transportation route is generated, including determining the center trajectory data and calculating the heat value.
It realizes the generation of multiple recommended transportation routes from the starting position to the ending position, supports upper-layer data analysis and lower-layer applications, and improves the utilization efficiency of trajectory data.
Smart Images

Figure CN118535924A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for generating a transportation route. Background Art
[0002] In the era of big data, massive amounts of trajectory data are increasing with the demand for vehicle supervision and safety management.
[0003] Trajectory data can incubate and support a variety of downstream applications, such as traffic flow analysis and prediction to support municipal planning; of course, it can also identify stop points and discover special areas.
[0004] However, in the existing technology, there is no mining and analysis of a large amount of trajectory data to generate a recommended transportation route solution from the large amount of trajectory data. Summary of the invention
[0005] The purpose of the present invention is to provide a transportation route generation method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to mine recommended transportation routes from a large amount of trajectory data.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for generating a transport route, the method comprising:
[0008] Obtain multiple sets of trajectory data at preset start and end positions;
[0009] Determine the similarity between any two sets of trajectory data;
[0010] Classifying the arbitrary two sets of trajectory data according to the similarity between the arbitrary two sets of trajectory data to obtain at least one type of trajectory data set;
[0011] At least one transportation route is generated according to the at least one type of trajectory data set.
[0012] Optionally, generating at least one transportation route according to the at least one type of trajectory data set includes:
[0013] According to the central trajectory data in each type of trajectory data set, the transportation route of each type of trajectory data set is determined.
[0014] Optionally, the method further includes:
[0015] According to the number of groups of trajectory data in each type of trajectory data set, the heat value of each transportation route is calculated.
[0016] Optionally, determining the similarity between any two sets of trajectory data includes:
[0017] According to the position coordinates of the plurality of trajectory points in each set of trajectory data, address encoding is performed on the plurality of trajectory points;
[0018] The similarity between the two sets of trajectory data is calculated according to the address codes of the plurality of trajectory points in the two sets of trajectory data.
[0019] Optionally, after address encoding the plurality of trajectory points according to the position coordinates of the plurality of trajectory points in each set of trajectory data, the method further comprises:
[0020] Calculating neighborhood address codes of the plurality of trajectory points according to the address codes of the plurality of trajectory points;
[0021] The calculating the similarity between the two sets of trajectory data according to the address codes of the plurality of trajectory points in the two sets of trajectory data comprises:
[0022] The similarity between the two sets of trajectory data is calculated according to the address codes of the plurality of trajectory points in the two sets of trajectory data and the neighborhood address codes.
[0023] Optionally, calculating the similarity of the arbitrary two sets of trajectory data according to the address codes of the plurality of trajectory points in the arbitrary two sets of trajectory data and the neighborhood address codes includes:
[0024] Calculating a first similarity between the first set of trajectory data and the second set of trajectory data according to the address codes of the plurality of trajectory points in the first set of trajectory data and the neighborhood address codes, and the address codes of the plurality of trajectory points in the second set of trajectory data;
[0025] Calculating a second similarity between the first set of trajectory data and the second set of trajectory data according to address codes of multiple trajectory points in the first set of trajectory data, and address codes of multiple trajectory points in the second set of trajectory data and the neighborhood address codes;
[0026] The similarity between the first set of trajectory data and the second set of trajectory data is calculated according to the first similarity and the second similarity.
[0027] Optionally, after acquiring multiple sets of trajectory data of preset start and end positions, the method further includes:
[0028] According to the distance between each trajectory point and an adjacent trajectory point in each set of trajectory data, multiple trajectory points in each set of trajectory data are filtered and interpolated.
[0029] In a second aspect, an embodiment of the present application further provides a transport route generation device, the device comprising:
[0030] A trajectory data acquisition module, used to acquire multiple sets of trajectory data at preset start and end positions;
[0031] A similarity calculation module is used to determine the similarity between any two sets of trajectory data;
[0032] A trajectory data classification module, used for classifying the arbitrary two sets of trajectory data according to the similarity between the arbitrary two sets of trajectory data to obtain at least one type of trajectory data;
[0033] The transport route generation module is used to generate at least one transport route according to the at least one type of trajectory data.
[0034] Optionally, the transportation route generating module is specifically configured to determine the transportation route of each type of trajectory data set according to the central trajectory data in each type of trajectory data set.
[0035] Optionally, the device further comprises:
[0036] The heat value calculation module is used to calculate the heat value of each transportation route according to the number of groups of trajectory data in each type of trajectory data set.
[0037] Optionally, the similarity calculation module includes:
[0038] An address encoding unit, used for performing address encoding on the plurality of trajectory points according to the position coordinates of the plurality of trajectory points in each set of trajectory data;
[0039] The similarity calculation unit is used to calculate the similarity of the arbitrary two sets of trajectory data according to the address codes of multiple trajectory points in the arbitrary two sets of trajectory data.
[0040] Optionally, after the address encoding unit, the device further includes:
[0041] A neighborhood coding unit, configured to calculate neighborhood address codes of the plurality of trajectory points according to the address codes of the plurality of trajectory points;
[0042] The similarity calculation unit is specifically configured to calculate the similarity of the arbitrary two sets of trajectory data according to the address codes of the plurality of trajectory points in the arbitrary two sets of trajectory data and the neighborhood address codes.
[0043] Optionally, the similarity calculation unit includes:
[0044] A first similarity calculation subunit is used to calculate a first similarity between the first group of trajectory data and the second group of trajectory data according to the address codes of the plurality of trajectory points in the first group of trajectory data and the neighborhood address code, and the address codes of the plurality of trajectory points in the second group of trajectory data;
[0045] A second similarity calculation subunit is used to calculate a second similarity between the first group of trajectory data and the second group of trajectory data according to the address codes of the plurality of trajectory points in the first group of trajectory data, the address codes of the plurality of trajectory points in the second group of trajectory data and the neighborhood address codes;
[0046] The similarity calculation subunit is used to calculate the similarity between the first group of trajectory data and the second group of trajectory data according to the first similarity and the second similarity.
[0047] Optionally, after the trajectory data acquisition module, the device further includes:
[0048] The trajectory point output module is used to filter and interpolate multiple trajectory points in each set of trajectory data according to the distance between each trajectory point and an adjacent trajectory point in each set of trajectory data.
[0049] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the transport route generation method as described in any one of the first aspects.
[0050] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the transportation route generation method as described in any one of the first aspects are executed.
[0051] The beneficial effects of this application are:
[0052] The present application provides a method, device, electronic device and storage medium for generating a transport route. The method calculates the similarity of multiple sets of trajectory data at preset start and end positions, classifies the multiple sets of trajectory data, determines the transport route corresponding to each set of trajectory data, and obtains multiple recommended transport routes from the start position to the end position, so that upper-level data analysis can be implemented and lower-level applications can be supported according to the transport routes. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 Generate a system architecture diagram for the transport route;
[0055] Figure 2 Schematic diagram of the process of generating a transport route provided in the embodiment of the present application Figure 1 ;
[0056] Figure 3 Schematic diagram of the process of generating a transport route provided in the embodiment of the present application Figure 2 ;
[0057] Figure 4 Schematic diagram of the process of generating a transport route provided in the embodiment of the present application Figure 3 ;
[0058] Figure 5 A schematic diagram of the structure of a transport route generation device provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0061] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0062] In addition, 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 are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0063] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0064] Before introducing the transportation route generation method, device, electronic device and storage medium provided in the embodiments of the present application, the transportation route generation system used in the present application is first introduced.
[0065] Please refer to Figure 1 , generate a system architecture diagram for the transport route, such as Figure 1 As shown, the transport route generation system includes: an electronic device 100 and multiple terminal devices 200, wherein the electronic device 100 is communicatively connected with the multiple terminal devices 200, the multiple terminal devices 200 are respectively arranged on multiple vehicles, the multiple terminal devices 200 have a positioning function, the electronic device 100 is used to send order data to the terminal device 200, the user drives the vehicle to complete the order through the order data obtained by the terminal device 200, and continuously obtains the location information of the vehicle during the driving process of the vehicle. After the order is completed, a set of trajectory data consisting of all the location information is sent to the electronic device 100, and the electronic device 100 executes the transport route generation method of the embodiment of the present application according to the multiple sets of trajectory data of the multiple terminal devices 200 to generate at least one transport route and the heat value of each transport route.
[0066] The electronic device 100 also has an upper-level analysis function. Specifically, it can perform freight index analysis, road portrait analysis, optimal navigation recommendation, mileage cost analysis, time estimation, road network supplementation, etc. based on at least one transportation route and the popularity value of each transportation route.
[0067] Based on the above-mentioned transport route generation system, the embodiment of the present application provides a transport route generation method, which is applied to the electronic device in the above-mentioned transport route generation system. Figure 2 , which is a schematic diagram of the process of the transportation route generation method provided in the embodiment of the present application Figure 1 ,like Figure 2 As shown, the method may include:
[0068] S10: Acquire multiple sets of trajectory data of preset start and end positions.
[0069] In this embodiment, the multiple sets of trajectory data are trajectory data with the same starting position and ending position, each set of trajectory data includes multiple trajectory points, a large amount of trajectory data is pre-stored in the storage unit of the electronic device, each set of trajectory data has a corresponding starting position and ending position, and by inputting the preset starting position and ending position, the multiple sets of trajectory data are screened from the large amount of trajectory data.
[0070] In one possible implementation, an electronic device sends multiple order data to multiple terminal devices respectively, where the order data include a starting position and an ending position. After the user drives a vehicle to complete the order according to the order data, the trajectory data is sent to the electronic device. The electronic device establishes a correspondence between the order data of each terminal device and a corresponding set of trajectory data. When trajectory data analysis is required, multiple sets of trajectory data with the same starting and ending positions are filtered out according to the starting position and terminal position in the order data.
[0071] In some embodiments, after the user drives the vehicle to start executing an order, the user does not start directly from the starting location, but arrives at the starting location from other locations, resulting in redundant trajectory data in the trajectory data. Therefore, it is necessary to eliminate the redundant trajectory data before the time when the user arrives at the starting location to obtain the trajectory data.
[0072] Similarly, after the user drives the vehicle to the end location, the order is not completed, and the user drives a certain distance, resulting in redundant trajectory data in the trajectory data. Therefore, it is necessary to eliminate the redundant trajectory data after the end location according to the time when the user reaches the end location to obtain the trajectory data.
[0073] In some embodiments, if the vehicle driven by the user is a freight vehicle, the redundant trajectory data before the loading time and after the unloading time can be eliminated according to the loading and unloading time. If the vehicle driven by the user is a passenger vehicle, the redundant trajectory data before the boarding time and after the alighting time can be eliminated according to the boarding and alighting time of the passengers.
[0074] For example, please refer to Table 1, which is a set of trajectory data. As shown in Table 1, each set of trajectory data includes multiple trajectory points, and each trajectory point includes: location acquisition time, longitude and latitude.
[0075] Table 1 A set of trajectory data
[0076] time longitude latitude 0 2022-09-10 09:51:12.0 111.350239 39.926534 1 2022-09-10 09:51:20.0 111.350100 39.926404 2 2022-09-10 09:51:30.0 111.349919 39.926275 3 2022-09-10 09:51:43.0 111.349581 39.926064 4 2022-09-10 09:51:51.0 111.349410 39.925927 … 683 2022-09-10 10:40:44.0 111.303625 39.834926 684 2022-09-10 10:40:46.0 111.303517 39.835430 685 2022-09-10 10:40:52.0 111.303444 39.835606 686 2022-09-10 10:40:54.0 111.303426 39.835629 687 2022-09-10 10:40:56.0 111.303388 39.835669
[0077] In a possible implementation, after acquiring multiple sets of trajectory data of preset start and end positions in S10, the method may further include:
[0078] According to the distance between each trajectory point and the adjacent trajectory points in each set of trajectory data, multiple trajectory points in each set of trajectory data are filtered and interpolated.
[0079] In this embodiment, in order to improve the accuracy of calculating the similarity of trajectory data, it is necessary to filter and interpolate the trajectory points, wherein filtering is to delete the deviated trajectory points, and interpolation is to insert trajectory points between trajectory points with too large intervals to increase the density of trajectory points.
[0080] Specifically, the filtering process includes: for each track point in each set of track data, if the distance between the track point and the two adjacent track points before and after is greater than a first preset distance, then delete the track point; if the distance between the track point and the two adjacent track points before and after is greater than a second preset distance, but the interval time is less than the first preset time, then delete the track point. For example, the first preset distance may be 2 kilometers, the second preset distance may be 1 kilometer, and the first preset time may be 30 seconds.
[0081] The interpolation process is as follows: for each track point in each set of track data, if the distance between the track point and the two adjacent track points is greater than the third preset distance, a new track point is interpolated between the track point and the two adjacent track points, so that the distance between each track point is less than or equal to the third preset distance. For example, the third preset distance can be 50 meters.
[0082] In a possible implementation, after obtaining multiple sets of trajectory data at preset start and end positions, it is also necessary to filter the trajectory data caused by abnormal orders. Specifically, according to the order data corresponding to each set of trajectory data, if the order execution time is less than the second preset time or greater than the third preset time, the trajectory data corresponding to the order data is filtered. For example, the second preset time can be 20 minutes, and the third preset time can be 3 days.
[0083] In some embodiments, according to the number of track points in each set of track data, if the number of track points is greater than a first preset number or less than a second preset number, the corresponding track data is deleted. For example, the first preset number may be 20,000, and the second preset number may be 100.
[0084] S20: Determine the similarity between any two sets of trajectory data.
[0085] In this embodiment, each set of trajectory data includes a plurality of trajectory points. According to the positions of the plurality of trajectory points of any two sets of trajectory data, the similarity between the two sets of trajectory points is calculated to determine the similarity between the two sets of trajectory data.
[0086] S30: Classifying any two sets of trajectory data according to the similarity between the two sets of trajectory data to obtain at least one type of trajectory data set.
[0087] In this embodiment, according to the similarity between the two sets of trajectory data, it is determined whether the two sets of trajectory data are one type of trajectory data, wherein if the similarity between the two sets of trajectory data is greater than a preset similarity threshold, the two sets of trajectory data are determined to be one type of trajectory data, and the two sets of trajectory data are divided into one type of trajectory data set; if the similarity between the two sets of trajectory data is less than or equal to the preset similarity threshold, the two sets of trajectory data are determined to be two types of trajectory data, and the two sets of trajectory data are divided into two types of trajectory data sets.
[0088] S40: Generate at least one transportation route according to at least one type of trajectory data set.
[0089] In this embodiment, after classifying multiple sets of trajectory data, at least one type of trajectory data set is obtained, each type of trajectory data set includes at least one set of trajectory data, and according to the at least one set of trajectory data in each type of trajectory data set, a transportation route corresponding to each type of trajectory data set is generated.
[0090] In a possible implementation, the process of generating at least one transport route according to at least one type of trajectory data set in S40 may include:
[0091] The transportation route of each type of trajectory data set is determined according to the central trajectory data in each type of trajectory data set.
[0092] In this embodiment, for multiple groups of trajectory data in each type of trajectory data set, one group of trajectory data is determined as central trajectory data, and a transportation route is generated according to multiple trajectory points of the central trajectory data, and the transportation route is determined to be the transportation route of the type of trajectory data set.
[0093] In a possible implementation, the central trajectory data may be any set of trajectory data in each type of trajectory data set, a set of trajectory data with the shortest distance from the starting position to the ending position in each type of trajectory data set, a set of trajectory data with the shortest time from the starting position to the ending position in each type of trajectory data set, or a set of trajectory data in at least two sets of trajectory data in each type of trajectory data set where all trajectory points completely overlap. If all trajectory points of three sets of trajectory data in one type of trajectory data set completely overlap, and all trajectory points of the other two sets of trajectory data completely overlap, the central trajectory data is determined from the three sets of trajectory data.
[0094] In another possible implementation, the center trajectory data may be determined by:
[0095] A first group of trajectory data is arbitrarily selected from multiple groups of trajectory data as the central trajectory data of the first type of trajectory data set, and the similarity between the second group of trajectory data and the first group of trajectory data is calculated. If the similarity is greater than a preset similarity threshold, it is determined that the second group of trajectory data and the first group of trajectory data are the same type of trajectory data, and the second group of trajectory data is written into the first type of trajectory data set where the first group of trajectory data is located, and the similarity between the third group of trajectory data and the first group of trajectory data is continuously determined; if the similarity is less than or equal to the preset similarity threshold, it is determined that the second group of trajectory data and the first group of trajectory data are different types of trajectory data, and the second group of trajectory data is used as the central trajectory data of the second type of trajectory data set, and the similarity between the third group of trajectory data and the first group of trajectory data and the second group of trajectory data is continuously determined.
[0096] If the similarity between the third group of trajectory data and the first group of trajectory data is greater than a preset similarity threshold, and the similarity between the third group of trajectory data and the second group of trajectory data is less than or equal to the preset similarity threshold, it is determined that the third group of trajectory data and the first group of trajectory data are the same type of trajectory data, and the third group of trajectory data is written into the first type of trajectory data set where the first group of trajectory data is located.
[0097] If the similarity between the third group of trajectory data and the first group of trajectory data is less than or equal to the preset similarity threshold, and the similarity between the third group of trajectory data and the second group of trajectory data is greater than the preset similarity threshold, it is determined that the third group of trajectory data and the second group of trajectory data are the same type of trajectory data, and the third group of trajectory data is written into the second type of trajectory data set where the second group of trajectory data is located; if the similarity between the third group of trajectory data and the first group of trajectory data and the second group of trajectory data is greater than the preset similarity threshold, it is determined that a group of trajectory data with higher similarity to the third group of trajectory data is the same type of trajectory data.
[0098] The transport route generation method provided in the above embodiment calculates the similarity of multiple sets of trajectory data at preset starting and ending positions, classifies the multiple sets of trajectory data, determines the transport route corresponding to each type of trajectory data set, and obtains multiple recommended transport routes from the starting position to the ending position, so that upper-level data analysis can be implemented and lower-level applications can be supported based on the transport routes.
[0099] In a possible implementation, the method may further include:
[0100] According to the number of groups of trajectory data in each type of trajectory data set, the heat value of each transportation route is calculated.
[0101] In this embodiment, after classifying multiple groups of trajectory data to obtain at least one type of trajectory data set, the heat value of each transportation route can be determined according to the number of groups of trajectory data included in each type of trajectory data set, wherein the more the number of groups of trajectory data in each type of trajectory data set, the higher the heat value of the transportation route, and the fewer the number of groups of trajectory data in each type of trajectory data set, the lower the heat value of the transportation route. Specifically, the number of groups of trajectory data is the heat value of the transportation route.
[0102] For example, multiple transportation routes of different priorities may be recommended to the user based on the popularity values of the multiple transportation routes, wherein the higher the popularity value, the higher the recommended priority of the transportation route, and the lower the popularity value, the lower the recommended priority of the transportation route.
[0103] The transportation route generation method provided in the above embodiment calculates the popularity value of each transportation route according to the number of trajectory data sets in each type of trajectory data set, so as to recommend transportation routes and perform other data analysis based on the popularity value.
[0104] The following combination Figure 3 A possible implementation method for calculating the similarity between any two sets of trajectory data is described.
[0105] Please refer to Figure 3 , which is a schematic diagram of the process of generating a transport route for an embodiment of the present application Figure 2 ,like Figure 3 As shown, the step of determining the similarity between any two sets of trajectory data in the above S20 may include:
[0106] S21: performing address encoding on the multiple track points according to the position coordinates of the multiple track points in each set of track data.
[0107] In this embodiment, the location coordinates of the trajectory point include the longitude and latitude of the trajectory point. The longitude and latitude of the trajectory point are respectively address-encoded according to a preset encoding method to obtain a binary longitude address code and a binary latitude address code. The address code of the trajectory point is determined based on the longitude address code and the latitude address code.
[0108] In a possible implementation, the preset encoding method can be geohash encoding, and the encoding rule of geohash encoding is: first divide the latitude range (-90,90) into two intervals (-90,0) and (0,90). If the target dimension is in the former interval (-90,0), it is encoded as 0. If the target dimension is in the latter interval (0,90), it is encoded as 1. Then, according to the interval in which the target latitude falls, it is evenly divided into two intervals for encoding, and so on, until the accuracy meets the requirements, and the latitude address code is obtained; the longitude also uses the same algorithm to subdivide (-180,180) in turn to obtain the longitude address code.
[0109] Then the longitude address code and the latitude address code are merged by placing the latitude address code in the odd position and the longitude address code in the even position to form a new binary code. The new binary code is evenly divided into several groups. The corresponding decimal number is calculated according to the binary code in each group. The Base32 code corresponding to the decimal number is determined according to the Base32 code table, and the Base32 code is used as the address code of the trajectory point.
[0110] S22: Calculate the similarity between any two sets of trajectory data according to the address codes of multiple trajectory points in any two sets of trajectory data.
[0111] In this embodiment, for multiple trajectory points in any two sets of trajectory data, after encoding them in the above encoding method to obtain multiple address codes, the multiple address codes of the two sets of trajectory data are intersected and calculated to determine the number of trajectory points with the same address codes in the two sets of trajectory data. Based on the data of the trajectory points with the same address codes in the two sets of trajectory data, the similarity of the two sets of trajectory data is calculated.
[0112] The transport route generation method provided in the above embodiment can reduce the complexity of calculating the similarity of the trajectory data and improve the calculation efficiency by address encoding the position coordinates of the trajectory points and determining the number of trajectory points with the same address codes in the two sets of trajectory data according to the address codes to determine the similarity of the two sets of trajectory data.
[0113] In a possible implementation, after performing address encoding on the multiple trajectory points according to the position coordinates of the multiple trajectory points in each set of trajectory data in the above S21, the method may further include:
[0114] According to the address codes of the plurality of trajectory points, the neighborhood address codes of the plurality of trajectory points are calculated.
[0115] The above S21 performs address coding on the multiple track points according to the position coordinates of the multiple track points in each set of track data, which may include:
[0116] The similarity between any two sets of trajectory data is calculated based on the address codes of multiple trajectory points and the neighborhood address codes in any two sets of trajectory data.
[0117] In this embodiment, the neighborhood address coding of the trajectory point may be four neighborhood address coding or eight neighborhood address coding of the trajectory point, wherein the four neighborhoods include the top, bottom, left, and right of the trajectory point, and the eight neighborhoods include the top, bottom, left, right, top left, bottom left, top right, and bottom right of the trajectory point.
[0118] The address code of the trajectory point is decoded to determine the binary longitude address code and the binary latitude address code of the trajectory point. The binary longitude address code is added by 1 and subtracted by 1 to obtain the longitude address codes of the left and right neighbors. The latitude address codes of the left and right neighbors are the same as the latitude address code of the trajectory point. The binary latitude address code is added by 1 and subtracted by 1 to obtain the latitude address codes of the upper and lower neighbors. The longitude address codes of the upper and lower neighbors are the same as the longitude address code of the trajectory point.
[0119] The longitude address code of the left neighbor is combined with the latitude address codes of the upper and lower neighbors respectively to obtain the longitude address code and latitude address code of the upper left neighbor, as well as the longitude address code and latitude address code of the lower left neighbor; the longitude address code of the right neighbor is combined with the latitude address codes of the upper and lower neighbors respectively to obtain the longitude address code and latitude address code of the upper right neighbor, as well as the longitude address code and latitude address code of the lower right neighbor.
[0120] According to the longitude address codes and latitude address codes of four or eight neighborhoods, the longitude address codes and latitude address codes of each neighborhood are merged. The merging method is to put the latitude address code in the odd position and the longitude address code in the even position to form a new string of binary codes. The new binary codes are evenly divided into several groups. The corresponding decimal number is calculated according to the binary code in each group. The Base32 code corresponding to the decimal number is determined according to the Base32 code table, and the Base32 code is used as the neighborhood address code of each neighborhood.
[0121] After determining the neighborhood address code of each trajectory point in each set of trajectory data, the number of identical address codes is calculated according to the address code of each trajectory point in the two sets of trajectory data and the neighborhood address code, and the similarity of the two sets of trajectory data is calculated according to the number of identical address codes.
[0122] The following combination Figure 4 A possible implementation method for calculating similarity based on the address coding of the trajectory point and the neighborhood address coding is described.
[0123] Please refer to Figure 4 , which is a schematic diagram of the process of the transportation route generation method provided in the embodiment of the present application Figure 3 ,like Figure 4 As shown, the above calculation of the similarity between any two sets of trajectory data based on the address codes and neighborhood address codes of multiple trajectory points in any two sets of trajectory data may include:
[0124] S23: Calculate a first similarity between the first set of trajectory data and the second set of trajectory data according to the address codes and neighborhood address codes of the plurality of trajectory points in the first set of trajectory data and the address codes of the plurality of trajectory points in the second set of trajectory data.
[0125] In this embodiment, the first similarity is the similarity of the first set of trajectory data relative to the second set of trajectory data. The number of identical address codes is determined by performing intersection calculation on address codes and neighborhood address codes of multiple trajectory points in the first set of trajectory data and address codes of multiple trajectory points in the second set of trajectory data. The first similarity of the two sets of trajectory data is determined according to the number of identical address codes and the number of trajectory points in the second set of trajectory data.
[0126] S24: Calculate a second similarity between the first set of trajectory data and the second set of trajectory data according to the address codes of the plurality of trajectory points in the first set of trajectory data and the address codes and neighborhood address codes of the plurality of trajectory points in the second set of trajectory data.
[0127] In this embodiment, the second similarity is the similarity of the second group of trajectory data relative to the first group of trajectory data. The number of identical address codes is determined by performing intersection calculation on the address codes and neighborhood address codes of multiple trajectory points in the second group of trajectory data and the address codes of multiple trajectory points in the first group of trajectory data. The second similarity of the two groups of trajectory data is determined according to the number of identical address codes and the number of trajectory points in the first group of trajectory data.
[0128] S25: Calculate the similarity between the first set of trajectory data and the second set of trajectory data according to the first similarity and the second similarity.
[0129] In this embodiment, the maximum similarity is determined from the first similarity and the second similarity, and the maximum similarity is used as the similarity between the first set of trajectory data and the second set of trajectory data.
[0130] In a possible implementation, before calculating the similarity, according to the address codes and neighborhood address codes of the multiple trajectory points in the first set of trajectory data, and the address codes and neighborhood address codes of the multiple trajectory points in the second set of trajectory data, repeated codes in the address codes and neighborhood address codes of the multiple trajectory points in the first set of trajectory data are eliminated to obtain a unique code; and repeated codes in the address codes and neighborhood address codes of the multiple trajectory points in the second set of trajectory data are eliminated to obtain a unique code.
[0131] For example, the calculation formulas of the first similarity R1 and the second similarity R2 can be expressed as:
[0132]
[0133]
[0134] Wherein, g(x) is the neighborhood address code calculated for the trajectory point x, v1(lambdax:g(x)) is the coding set of the address codes and neighborhood address codes of multiple trajectory points in the first set of trajectory data, v2 is the coding set of the address codes of multiple trajectory points in the second set of trajectory data, v1 is the coding set of the address codes of multiple trajectory points in the first set of trajectory data, v2(lambdax:g(x)) is the coding set of the address codes and neighborhood address codes of multiple trajectory points in the second set of trajectory data, set() means to remove duplicates from the address codes in the set and obtain a unique address code set, ∩ is the intersection operator, and length is the number of identical address codes after calculating the intersection operation.
[0135] The transport route generation method provided in the above embodiment calculates the neighborhood address code according to the address code of the trajectory point, and uses the address code and the neighborhood address code to jointly participate in the calculation of similarity. Compared with calculating the similarity only according to the address code, the trajectory expansion is performed through the neighborhood address code, which can solve the problem of mutation of the address code, avoid the problem that two trajectories of the same route repeatedly jump on the boundary of the address code, resulting in a large difference between the two similar trajectory code sets, and improve the accuracy of calculating the similarity of the two sets of trajectory data.
[0136] Based on the above embodiments, the present application also provides a transport route generation device. Figure 5 , is a schematic diagram of the structure of the transport route generation device provided in an embodiment of the present application, such as Figure 5 As shown, the device may include:
[0137] A trajectory data acquisition module 10, used to acquire multiple sets of trajectory data of preset start and end positions;
[0138] A similarity calculation module 20, used to determine the similarity between any two sets of trajectory data;
[0139] A trajectory data classification module 30, used to classify any two sets of trajectory data according to the similarity between any two sets of trajectory data to obtain at least one type of trajectory data;
[0140] The transport route generating module 40 is used to generate at least one transport route according to at least one type of trajectory data.
[0141] Optionally, the transportation route generating module 40 is specifically configured to determine the transportation route of each type of trajectory data set according to the central trajectory data in each type of trajectory data set.
[0142] Optionally, the device further comprises:
[0143] The heat value calculation module is used to calculate the heat value of each transportation route according to the number of groups of trajectory data in each type of trajectory data set.
[0144] Optionally, the similarity calculation module 20 includes:
[0145] An address encoding unit, used for performing address encoding on a plurality of trajectory points according to the position coordinates of the plurality of trajectory points in each set of trajectory data;
[0146] The similarity calculation unit is used to calculate the similarity between any two sets of trajectory data according to the address codes of multiple trajectory points in any two sets of trajectory data.
[0147] Optionally, after the address encoding unit, the device further includes:
[0148] A neighborhood coding unit, used for calculating neighborhood address codes of the plurality of trajectory points according to the address codes of the plurality of trajectory points;
[0149] The similarity calculation unit is specifically used to calculate the similarity of any two sets of trajectory data according to the address codes and neighborhood address codes of multiple trajectory points in any two sets of trajectory data.
[0150] Optionally, a similarity calculation unit includes:
[0151] A first similarity calculation subunit is used to calculate a first similarity between the first group of trajectory data and the second group of trajectory data according to address codes and neighborhood address codes of multiple trajectory points in the first group of trajectory data and address codes of multiple trajectory points in the second group of trajectory data;
[0152] A second similarity calculation subunit is used to calculate a second similarity between the first group of trajectory data and the second group of trajectory data according to the address codes of the plurality of trajectory points in the first group of trajectory data and the address codes and neighborhood address codes of the plurality of trajectory points in the second group of trajectory data;
[0153] The similarity calculation subunit is used to calculate the similarity between the first group of trajectory data and the second group of trajectory data according to the first similarity and the second similarity.
[0154] Optionally, after the trajectory data acquisition module 10, the device further includes:
[0155] The trajectory point output module is used to filter and interpolate multiple trajectory points in each set of trajectory data according to the distance between each trajectory point and the adjacent trajectory points in each set of trajectory data.
[0156] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0157] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0158] Please refer to Figure 6 , is a schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device 100 includes: a processor 101, a storage medium 102 and a bus, the storage medium 102 stores program instructions executable by the processor 101, when the electronic device 100 is running, the processor 101 and the storage medium 102 communicate through the bus, and the processor 101 executes the program instructions to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0159] Optionally, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method embodiment is executed. The specific implementation method and technical effect are similar and will not be described in detail here.
[0160] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0161] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0163] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0164] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for generating a transport route, characterized in that: The method comprises: Obtain multiple sets of trajectory data at preset start and end positions; Determine the similarity between any two sets of trajectory data; Classifying the arbitrary two sets of trajectory data according to the similarity between the arbitrary two sets of trajectory data to obtain at least one type of trajectory data set; At least one transportation route is generated according to the at least one type of trajectory data set.
2. The method according to claim 1, characterized in that The step of generating at least one transport route according to the at least one type of trajectory data set comprises: According to the central trajectory data in each type of trajectory data set, the transportation route of each type of trajectory data set is determined.
3. The method according to claim 1, characterized in that: The method further comprises: According to the number of groups of trajectory data in each type of trajectory data set, the heat value of each transportation route is calculated.
4. The method according to claim 1, characterized in that Determining the similarity between any two sets of trajectory data includes: According to the position coordinates of the plurality of trajectory points in each set of trajectory data, address encoding is performed on the plurality of trajectory points; The similarity between the two sets of trajectory data is calculated according to the address codes of the plurality of trajectory points in the two sets of trajectory data.
5. The method according to claim 4, characterized in that After address encoding the plurality of trajectory points according to the position coordinates of the plurality of trajectory points in each set of trajectory data, the method further comprises: Calculating neighborhood address codes of the plurality of trajectory points according to the address codes of the plurality of trajectory points; The calculating the similarity between the two sets of trajectory data according to the address codes of the plurality of trajectory points in the two sets of trajectory data comprises: The similarity between the two sets of trajectory data is calculated according to the address codes of the plurality of trajectory points in the two sets of trajectory data and the neighborhood address codes.
6. The method according to claim 5, characterized in that The calculating the similarity of the arbitrary two sets of trajectory data according to the address codes of the plurality of trajectory points in the arbitrary two sets of trajectory data and the neighborhood address codes comprises: Calculating a first similarity between the first set of trajectory data and the second set of trajectory data according to the address codes of the plurality of trajectory points in the first set of trajectory data and the neighborhood address codes, and the address codes of the plurality of trajectory points in the second set of trajectory data; Calculating a second similarity between the first set of trajectory data and the second set of trajectory data according to address codes of multiple trajectory points in the first set of trajectory data, and address codes of multiple trajectory points in the second set of trajectory data and the neighborhood address codes; The similarity between the first set of trajectory data and the second set of trajectory data is calculated according to the first similarity and the second similarity.
7. The method according to claim 1, characterized in that After obtaining multiple sets of trajectory data of preset start and end positions, the method further includes: According to the distance between each trajectory point and an adjacent trajectory point in each set of trajectory data, multiple trajectory points in each set of trajectory data are filtered and interpolated.
8. A transport route generation device, characterized in that: The device comprises: A trajectory data acquisition module, used to acquire multiple sets of trajectory data at preset start and end positions; A similarity calculation module is used to determine the similarity between any two sets of trajectory data; A trajectory data classification module, used for classifying the arbitrary two sets of trajectory data according to the similarity between the arbitrary two sets of trajectory data to obtain at least one type of trajectory data; The transport route generation module is used to generate at least one transport route according to the at least one type of trajectory data.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to perform the steps of the transportation route generation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the transportation route generation method according to any one of claims 1 to 7 are executed.
