A method and apparatus for near neighbor circuit determination

By combining the feature matrix and weight matrix with the target route information, the nearest routes of the logistics trunk line are determined, which solves the problem of long time for drivers to select suitable routes and achieves efficient and accurate route selection.

CN116011913BActive Publication Date: 2026-03-31JIANGSU ZHIJIAN LOGISTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In the process of freight transport on logistics trunk lines, it is difficult for drivers or carriers to quickly and accurately select the most suitable nearby routes. Existing technologies are time-consuming and have low processing efficiency.

Method used

By acquiring target route information, using feature matrix and weight matrix, and combining the latitude and longitude of the origin and destination of the target route, the nearest routes are determined. The feature matrix is ​​related to the great circle distance and transportation price, and the weight matrix is ​​related to the transportation price. The approximation degree is calculated using a metric formula, and the route with the highest approximation degree is selected as the nearest route.

Benefits of technology

It enables accurate determination of neighboring lines, improves processing efficiency, and reduces the time spent selecting suitable lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116011913B_ABST
    Figure CN116011913B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method and device of adjacent line determination, to improve the efficiency of adjacent line determination.The method comprises: obtaining the information of target line, the information of target line includes the origin of target line and the destination of target line;According to feature matrix, weight matrix and target line, determine the adjacent line corresponding to target line, wherein, feature matrix is related to the great circle distance of destination matrix, origin matrix and multiple reference lines respectively, weight matrix is related to the transport price of destination matrix, origin matrix and multiple reference lines respectively, destination matrix includes the longitude and latitude of the destination of multiple reference lines, origin matrix includes the longitude and latitude of the origin of multiple reference lines, the destination of adjacent line is the same as the destination of target line.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of logistics technology, and in particular to a method and apparatus for determining nearby routes. Background Technology

[0002] In the freight transport process along logistics trunk lines, due to the complex transportation networks between regions, there are multiple transport routes between the origin and destination of freight demand. Drivers (or carriers) need to spend a lot of time choosing the most suitable route from these multiple transport routes. For example, to get from point A to point Z, there are multiple routes to choose from: point A-B-E-Z, point A-E-Z... point A-X-Z, and point A-Y-Z, etc. It is very difficult for drivers (or carriers) to find suitable nearby routes among these multiple routes, making it inconvenient to choose the most suitable route from nearby routes.

[0003] In existing technologies, platforms can only provide information on multiple routes capable of fulfilling freight tasks. This information is vast and complex, forcing drivers (or carriers) to rely on experience to select routes. This necessitates repeatedly browsing and filtering through numerous routes to choose one that closely matches the target route. Therefore, the aforementioned method of determining nearest-neighbor routes not only fails to guarantee the optimal route but also is time-consuming and inefficient. Summary of the Invention

[0004] This invention provides a method and apparatus for determining neighboring lines, thereby achieving accurate determination of neighboring lines and improving processing efficiency.

[0005] In a first aspect, the present invention provides a method for determining neighboring routes, the method comprising: acquiring information about a target route, the information of which includes the origin and destination of the target route; determining neighboring routes corresponding to the target route based on a feature matrix, a weight matrix, and the target route, wherein the feature matrix is ​​related to a destination matrix, an origin matrix, and the great circle distances of multiple reference routes respectively, the weight matrix is ​​related to the transportation prices of the destination matrix, the origin matrix, and the multiple reference routes respectively, the destination matrix includes the latitude and longitude of the destinations of the multiple reference routes, the origin matrix includes the latitude and longitude of the origins of the multiple reference routes, and the destinations of the neighboring routes are the same as the destinations of the target route.

[0006] In one possible design, the method further includes: determining a feature matrix based on a destination matrix, a origin matrix, the longitude and latitude of a first reference area within the target area, the longitude and latitude of a second reference area within the target area, and the great circle distances of the multiple reference routes, wherein the target area includes the destinations of the multiple reference routes and the origins of the multiple reference routes.

[0007] In one possible design, the method further includes: determining a feature matrix based on the differences between the longitudes of the destinations of the multiple reference routes included in the destination matrix and the longitudes of the first reference area, the differences between the latitudes of the destinations of the multiple reference routes included in the destination matrix and the latitudes of the first reference area, the differences between the longitudes of the origins of the multiple reference routes included in the origin matrix and the longitudes of the second reference area, the differences between the latitudes of the origins of the multiple reference routes included in the origin matrix and the latitudes of the second reference area, and the great circle distances of the multiple reference routes respectively.

[0008] In one possible design, the method further includes: the first element in the feature matrix. row elements according to Sure; include , , , , , , , , , and d in the middle , The number of reference lines; among which, , Indicates the distance between great circles. It is Euler's constant;

[0009] , Represents the destination matrix. Represents the origin matrix;

[0010] , A matrix representing the longitude and latitude of the first reference region;

[0011] ;

[0012] , A matrix representing the longitude and latitude of the second reference area;

[0013] ;

[0014] ;

[0015] ;

[0016] ;

[0017] ;

[0018] Represents the vector cosine radian function; Represents the vector magnitude function; This represents the transpose of a matrix.

[0019] In one possible design, determining the nearest neighbor lines corresponding to the target line based on the feature matrix, weight matrix, and target line includes: determining the approximation degree between the target line and a reference line based on the metric formula, feature matrix, and weight matrix; determining at least one line with the highest approximation degree as the nearest neighbor line; the metric formula satisfies:

[0020] ;

[0021] in, Indicates the degree of similarity between the target route and the comparison route. , The first in the weight matrix One element, It is the first feature in the feature matrix corresponding to the target line. One characteristic, It is the first feature in the feature matrix corresponding to the feature of the comparison line. One characteristic, .

[0022] In one possible design, the method further includes: determining a price matrix based on the transportation prices of multiple reference routes, wherein the price matrix contains the first... The row element is the first The transportation price of the reference route; determine the intermediate feature matrix based on the feature matrix, the number of rows in the intermediate feature matrix is ​​the same as the number of rows in the price matrix, and the digit of the intermediate feature matrix is... The row element is the element corresponding to the first row in the characteristic matrix. Elements of a reference line, 1≤ ≤ , The number of reference routes with valid transportation prices among multiple reference routes; the weight matrix is ​​determined based on the price matrix and the intermediate feature matrix.

[0023] In one possible design, the method further includes: determining the weight matrix based on the price matrix and the intermediate feature matrix, comprising: constructing a linear model between the price matrix, the intermediate feature matrix, and the linear weight matrix.

[0024]

[0025] in, Representing the price matrix, Represents the intermediate feature matrix. Represents a linear weight matrix;

[0026] The weight matrix is ​​based on Sure, satisfy:

[0027] .

[0028] Secondly, the present invention also provides an apparatus for determining neighboring routes, the apparatus including an acquisition module and a processing module. The acquisition module is used to acquire information about a target route, including the origin and destination of the target route. The processing module is used to determine the neighboring routes corresponding to the target route based on a feature matrix, a weight matrix, and the target route. The feature matrix is ​​related to the destination matrix, the origin matrix, and the great circle distances of multiple reference routes; the weight matrix is ​​related to the transportation prices of the destination matrix, the origin matrix, and the multiple reference routes; the destination matrix includes the latitude and longitude of the destinations of the multiple reference routes; the origin matrix includes the latitude and longitude of the origins of the multiple reference routes; and the destinations of the neighboring routes are the same as the destination of the target route.

[0029] Thirdly, the present invention also provides an electronic device comprising a processor, the processor being configured to execute a computer program stored in a memory to implement the steps of the method for determining nearest neighbor lines as described above.

[0030] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for determining nearest neighbor lines as described above.

[0031] In this application, information about a target route is obtained, including the origin region and destination region of the target route. Based on the feature matrix, weight matrix, and the information about the target route, information about at least one nearest neighbor route is determined. By determining the nearest neighbor route based on the information about the nearest neighbor route, accurate and efficient determination of the nearest neighbor route can be achieved. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 A flowchart illustrating a method for determining nearest-neighbor lines provided in an embodiment of the present invention;

[0034] Figure 2 A flowchart illustrating another method for determining nearest-neighbor lines provided in an embodiment of the present invention;

[0035] Figure 3 A flowchart illustrating another method for determining nearest-neighbor lines provided in an embodiment of the present invention;

[0036] Figure 4 A flowchart illustrating another method for determining nearest-neighbor lines provided in an embodiment of the present invention;

[0037] Figure 5 A schematic diagram of a device for determining neighboring lines provided in an embodiment of the present invention;

[0038] Figure 6 A schematic diagram of another device for determining neighboring lines provided in an embodiment of the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0040] To accurately determine neighboring routes, embodiments of the present invention provide a method and apparatus for determining neighboring routes. This method can be executed by a driver's (or carrier's) client. This client can be a driver's (or carrier's) mobile phone, personal computer (PC), wearable device, or other electronic device, without specific limitations.

[0041] Figure 1 This is a schematic diagram of a method for determining neighboring lines according to an embodiment of the present invention. The process includes the following steps:

[0042] S101: Obtain information about the target route, including the origin and destination of the target route.

[0043] Specifically, the system obtains the route search request sent by the user to the platform. This route search request may include information needed for route search, such as the desired origin, desired destination, and vehicle type. Based on the origin and destination, the system determines the origin region and destination region, and then identifies a known route between the origin region and destination region as the target route.

[0044] For example, the platform may provide various regions as options to drivers (or carriers), allowing them to choose their desired origin and destination regions; or, the platform may determine the desired origin and destination regions based on the desired origin and destination addresses filled in by the drivers (or carriers), which is not limited in this application.

[0045] S102: Based on the feature matrix, weight matrix, and target route, determine the nearest neighbor routes corresponding to the target route. The feature matrix is ​​related to the destination matrix, origin matrix, and the great circle distances of multiple reference routes. The weight matrix is ​​related to the transportation prices of the destination matrix, origin matrix, and multiple reference routes. The destination matrix includes the latitude and longitude of the destinations of multiple reference routes, and the origin matrix includes the latitude and longitude of the origins of multiple reference routes. The destinations of the nearest neighbor routes are the same as the destinations of the target route.

[0046] For example, if the originating region is region A and the destination region is region Z, then region A-Z is the target route. There are n reference routes: region A-B-Z, region A-D-Z, ..., region A-X-Z and region A-Y-Z. The destinations of the reference routes and the target route are the same. The nearest neighbor routes are one or more of the reference routes; therefore, the destinations of the nearest neighbor routes are the same as the target route. Based on the feature matrix, weight matrix, and target route, the nearest neighbor routes corresponding to the target route are determined. Each nearest neighbor route is at least one of the multiple reference routes.

[0047] In one possible implementation of S102, a feature matrix can be determined based on the destination matrix, the origin matrix, the latitude and longitude of the first reference area, the latitude and longitude of the second reference area, and the great circle distances of the multiple reference routes. The first and second reference areas belong to the target area, which includes the destinations and origins of the multiple reference routes.

[0048] For example, The first reference matrix is ​​specifically represented as follows: ; The second reference matrix is ​​specifically represented as follows: ; The origin matrix is ​​specifically represented as follows: ; The destination matrix is ​​specifically represented as follows .in, and These represent the latitudes of the first reference region; and These represent the latitudes of the first reference region; and These represent the latitude of the origin; and These represent the latitude of the place of origin.

[0049] Optionally, the steps for determining the feature matrix can also be performed before S101.

[0050] Optional, can be based on Figure 2 The following steps are shown to determine the feature matrix:

[0051] S201: Divide the target area into regions and determine the latitude and longitude of each region.

[0052] Specifically, the target area can be determined in advance, such as using the administrative region of Hubei Province as the target area. The target area is then divided according to a preset regional division rule. This rule can be a national administrative division rule, a grid division, or other rules; this application does not impose any limitations. It should be noted that the regional division method referred to in step S101 should be consistent with this method, that is, the division method for the originating and destination areas in S101 should be consistent with the regional division method in this step, so that the same locations can be located within the same area. The corresponding latitude and longitude are determined for each area. This latitude and longitude can be the latitude and longitude of any point within the area, or the latitude and longitude of the center point of the area; this application does not impose any limitations. East and west longitudes can be distinguished using positive and negative relationships, as can south and north latitudes.

[0053] For example, in this application embodiment, the rules of national administrative regions are used to divide the target area, and the latitude and longitude of any point in each region are determined as the latitude and longitude of that region.

[0054] It's important to note that finer granularity in regional division leads to better identification of nearest-neighbor routes, but it also significantly increases the amount of data processed initially. For example, dividing by administrative districts results in finer granularity than dividing by city. Similarly, when using grid partitioning, smaller areas for each cell within the grid indicate finer granularity.

[0055] S202: Select two regions as the first reference region and the second reference region, respectively.

[0056] Specifically, in the multiple regions obtained in step S201, two regions with different latitudes and longitudes are selected as the first reference region and the second reference region, respectively. The selection method can be random or other methods, which are not limited in this application.

[0057] Optionally, the first reference matrix and the second reference matrix are determined based on the latitude and longitude of the first reference area and the second reference area.

[0058] Specifically, the first and second reference matrices are determined using the longitude and latitude corresponding to each reference region. The first reference matrix is ​​represented as follows: That is, [the longitude and latitude corresponding to the first reference area]; the second reference matrix is ​​represented as... That is, [the longitude corresponding to the second reference area, and the latitude corresponding to the second reference area].

[0059] For example, two reference areas are selected: Shijiazhuang and Changsha. Shijiazhuang is the first reference area, and Changsha is the second reference area. The longitude corresponding to Shijiazhuang is... Latitude is The longitude corresponding to Changsha is Latitude is Therefore, the first reference matrix at this point is [ , The second reference matrix is ​​[ , ].

[0060] S203: Determine multiple reference routes based on any two reference areas, with each reference route corresponding to a departure point and a destination. The same area can serve as both a departure point and a destination in different reference routes.

[0061] For example, there are three reference areas: Baoding, Xingtai, and Beijing. By determining reference routes based on any two different reference areas, six routes can be identified: Baoding-Xingtai, Baoding-Beijing, Xingtai-Beijing, Xingtai-Baoding, Beijing-Xingtai, and Beijing-Baoding.

[0062] Optionally, a origin matrix, destination matrix, and great circle distance can be determined for each reference route.

[0063] Specifically, the origin matrix is ​​represented as follows: That is, [the longitude and latitude of the originating region]. The destination matrix is ​​represented as follows: That is, [the longitude and latitude of the destination area]. The great circle distance of the reference route is:

[0064]

[0065] in, The longitude corresponding to the origin region. The latitude corresponding to the origin region. The longitude corresponding to the destination region. This refers to the latitude of the destination region. In this embodiment of the application, Right now The value, Right now The value, Right now The value, Right now The value of .

[0066] S204: Determine the feature matrix based on the latitude and longitude of the first reference area, the latitude and longitude of the second reference area, the origin matrix, the destination matrix, and the great circle distance.

[0067] Specifically, feature data is determined based on the latitude and longitude of the first reference area, the latitude and longitude of the second reference area, the origin matrix, the destination matrix, and the great circle distance, thereby further determining the feature matrix. The feature matrix may include feature data from multiple reference routes.

[0068] In one possible design, characteristic data is determined based on the difference between the longitude of the destination and the longitude of the first reference area, the difference between the latitude of the destination and the latitude of the first reference area, the difference between the longitude of the origin and the longitude of the second reference area, the difference between the latitude of the origin and the latitude of the second reference area, and the great circle distances of multiple reference routes.

[0069] Specifically, in the embodiments of this application, and These represent the latitudes of the first reference region, and These represent the latitudes of the first reference region, and These represent the latitudes of the originating points, and These represent the latitudes of the originating points, therefore, we can use... The difference between the longitude of the destination and the longitude of the first reference area can be expressed as... The difference between the latitude of the destination and the latitude of the first reference area can be represented by... The difference between the longitude of the origin and the longitude of the second reference area can be expressed as... This represents the difference between the latitude of the origin and the latitude of the second reference area. This feature matrix may include the following feature data: , , , , , , , , and The calculation formulas are as follows:

[0070] 1.

[0071] 2.

[0072] 3.

[0073] 4.

[0074] 5.

[0075] 6.

[0076] 7.

[0077] 8.

[0078] 9.

[0079] 10.

[0080] in, Represents the natural logarithm operation. Indicates the distance between great circles. It is Euler's constant; It is a vector magnitude function. It is a custom vector cosine radian function; This is a reference route origination matrix. This is the destination matrix for the reference route. It is the first reference matrix. It is the second reference matrix.

[0081] Optional, and The formulas are as follows:

[0082]

[0083]

[0084] in, It is a matrix norm, To represent the transpose of a matrix, for example, Representation matrix The transpose of . It is the arctangent function. It is a function that converts radians to angles. It is an angle-to-radian function. It is a remainder function.

[0085] It should be noted that, and In , and This is an example identifier; during the calculation process, it is necessary to match the corresponding matrix or value based on the actual situation. With the aforementioned matrix , , , , Correspondingly; similarly, and , , , or The differences correspond to each other; and and , , , or The differences correspond to each other. Represented as a matrix For example, then , ,Right now This represents the difference between the longitude corresponding to the second reference area and the longitude corresponding to the destination area. This represents the difference between the latitude of the second reference area and the latitude of the destination area.

[0086] Furthermore, a feature matrix is ​​determined based on the aforementioned feature data. Specifically, the feature matrix may include feature data from multiple reference lines, with each reference line corresponding to 10 of the aforementioned feature data, resulting in a 1×10 line matrix. Assuming there are a total of n reference lines, a [missing information - likely a specific matrix or matrix] can be obtained. A 10 × matrix .

[0087] For example, matrix It can be represented as:

[0088]

[0089] in, In other words, the matrix It is The matrix, This refers to the number of features corresponding to a reference line. In this embodiment of the application, , This refers to the number of reference lines.

[0090] Optionally, the matrix can be As a feature matrix Use it.

[0091] Optionally, the elements in the matrix can be standardized column-wise to obtain the feature matrix. .

[0092] For example, for a matrix Each element in Standardization The formula is:

[0093]

[0094] in, It is the row number in the matrix. , The number of reference lines; It is the column number in the matrix. , In this embodiment of the application, the number of features corresponding to a reference line is... ; It is a matrix The Middle The mean of the column; It is a matrix The Middle The standard deviation of the column. The resulting feature matrix. It is also a A 10 × 10 matrix.

[0095] For example, assuming there are a total of 8 reference lines, an 8×10 feature matrix is ​​determined according to the aforementioned steps. , where the characteristic matrix First action , It can be viewed as a 1×10 matrix, corresponding to reference line 1; characteristic matrix The second act , This can be viewed as a 1×10 matrix, corresponding to reference line 2; and so on. Corresponding to reference route 3, Corresponding to reference line 4, ... Corresponding reference line 8.

[0096] In one possible implementation of S102, the weight matrix can be determined based on the transportation price corresponding to the reference route.

[0097] Optionally, the steps for determining the weight matrix can also be performed before S101.

[0098] Optional, can be based on Figure 3The following steps are shown to determine the weight matrix:

[0099] S301: Determine the transportation price for each reference route. The transportation price may reflect the price of transporting goods on that reference route. There are many methods for determining transportation prices in the prior art, and this application is not limited to any particular method; the existing methods for determining transportation prices can be used here.

[0100] For example, since the origin and destination of the reference route are already determined, historical orders can be queried from the database. The transportation price of the reference route can be determined based on the transaction price, origin information, and destination information in the historical orders. For instance, historical orders where the loading point is within the origin region and the unloading point is within the destination region can be selected from the database, and the transaction prices of these historical orders can be averaged to obtain the average transaction price, which is then used as the transportation price for the reference route. If a reference route cannot be matched with historical orders, and therefore no usable transportation price can be obtained, or no transportation price can be obtained at all, the transportation price for that reference route can be recorded as empty before further processing.

[0101] S302: Determine the price matrix based on the transportation prices of multiple reference routes. The price matrix contains the... The row element is the first The transportation prices for the reference routes, where the price matrix uses... express, Let be the row number of the matrix. , yes The number of reference routes for transportation prices was obtained from the reference routes.

[0102] Optionally, an intermediate feature matrix is ​​determined based on the feature matrix. The intermediate feature matrix has the same number of rows as the price matrix, and the element in the i-th row of the intermediate feature matrix is ​​the element in the feature matrix corresponding to the i-th reference route, where 1≤ĩ≤ñ, and ñ is the number of reference routes with valid transportation prices among multiple reference routes.

[0103] Specifically, reference routes with empty transportation price records are included in the feature matrix. By deleting the corresponding rows, the intermediate feature matrix is ​​obtained. , characteristic matrix It can be the matrix obtained in step S204, and the price matrix is ​​determined based on the transportation price of each reference route. .

[0104] For example, the 8×10 feature matrix obtained in step S204 is still used. For example, if no transportation price is obtained for reference route 4, then the feature matrix will be... Delete line 4 in the text, that is... Deletion yields the intermediate feature matrix. , Given a 7×10 matrix, determine a 7×1 price matrix based on the transportation prices of these 7 reference routes. In this price matrix, each row contains elements corresponding to the transportation price of each reference route. sum matrix The reference line corresponding to each row should be consistent.

[0105] S303: Determine the weight matrix based on the price matrix and the intermediate feature matrix.

[0106] Optionally, it can be based on a price matrix. and intermediate feature matrix Define a linear model, which contains a linear weight matrix. Specifically, the linear model is as follows:

[0107]

[0108] in, , , , yes The number of reference routes for transportation prices was obtained from the reference routes. It is the number of features corresponding to a reference line, that is to say, It is The matrix, It is The matrix, It is A matrix. For example, in an embodiment of this application, =7, .

[0109] Optionally, the matrix is ​​determined based on the linear model. .

[0110] Specifically, the matrix can be determined based on the linear model and the least squares method. , Take the minimum sum of errors of all reference lines. Here, matrix It is A matrix of size 1, The value can be positive or negative; a negative number indicates an inverse relationship between the reorganization characteristics and the final result. The error of each reference line can be used... Sure, Let be the row number of the matrix. .

[0111] Alternatively, the formula for minimizing the sum of errors of all reference lines using the least squares method can be:

[0112]

[0113] in, Representation matrix 2-norm, This indicates the step to minimize the sum of errors of all reference lines. .

[0114] Optionally, the matrix obtained above can be... As a weight matrix.

[0115] Optionally, the matrix obtained above can be... The elements in the matrix are standardized, and the resulting matrix is ​​used as the weight matrix.

[0116] Specifically, for the matrix Scale all elements to obtain a matrix That is, compress all elements to 0. The interval is 1, to prevent negative numbers; for the matrix The matrix is ​​obtained by translation mapping. The matrix The elements in the equation are shifted to the right to a constant. To the right, increase data density to prevent weight values ​​from becoming too extreme; for the matrix Normalization yields the matrix Even if the matrix The sum of the elements in the matrix is ​​1. It can be used as a weight matrix.

[0117] For example, for a matrix The formula for scaling all elements in the array can be:

[0118]

[0119] in, In the embodiments of this application, ; It is a matrix The first in One element; It is a matrix The first in The elements after scaling are the matrix. The first in One element; It is a matrix The element with the smallest value in the middle; It is a matrix The element with the largest value in the middle.

[0120] For example, for a matrix The formula for translating all elements in can be:

[0121]

[0122] in, In the embodiments of this application, ; It is a matrix The first in One element; It is a matrix The first in The elements after the mapping adjustment are the matrix elements. The first in One element; It is a matrix The element with the smallest value in the middle. It is a matrix The absolute value of the smallest element in the set. This mapping formula also applies to normalized scaling.

[0123] For example, for a matrix The formula for normalizing all elements can be:

[0124]

[0125] in, In the embodiments of this application, ; It is a matrix The first in One element; It is a matrix The first in The elements that have undergone normalization adjustment are the matrix elements. The elements in.

[0126] For example, the matrix after the above processing As the weight matrix, the matrix at this time It could be:

[0127]

[0128] Similarly, the above can also be used as needed. or As a weight matrix.

[0129] In one possible implementation of S102, the nearest neighbor lines corresponding to the target line can be determined based on the feature matrix, weight matrix, and information of the target line.

[0130] Optional, can be based on Figure 4 The following steps are shown to determine the nearest line:

[0131] S401: Based on the metric formula, feature matrix, and weight matrix, determine the approximation between the target route and the comparison route. The comparison route represents the route used to compare the similarity with the target route. In other words, the comparison route is the possible nearest neighbor route.

[0132] Specifically, this has already been obtained. The weight matrix, a Feature matrix The 10 elements in the weight matrix correspond to the 10 features of the comparison line, and the feature matrix... It includes For each of the 10 features corresponding to a given route, the approximation between the target route and the comparison route is determined based on the aforementioned feature matrix, weight matrix, and metric formula. The approximation between the two routes is calculated using... This means that the smaller the value, the higher the similarity between the lines. Determining the similarity. The measurement formula is:

[0133]

[0134] in, The value can be set in advance by human intervention. In this embodiment of the application, it is preferred that... The value is 2. These are the indexes corresponding to the weights and features. , , It is the first in the weight matrix One element, It is the first element in the feature matrix corresponding to the target line. The value of each feature data, It is the first line in the feature matrix corresponding to the comparison line. The value of each feature data, yes and The absolute value of the difference.

[0135] Optionally, the comparison route can be one or more of the reference routes, and the comparison routes can be selected manually in advance. For example, you can choose routes from the reference routes that have corresponding historical orders as comparison routes, or you can use all the reference routes as comparison routes.

[0136] For example, the weight matrix is The matrix, where each row has one element, is the feature matrix. Each row in the matrix corresponds to a comparison line, as mentioned above, in the feature matrix. First action , This can be viewed as a 1×10 matrix, corresponding to comparison line 1. Similarly, the matrices corresponding to the other comparison lines can be obtained. The elements of each row in the weight matrix correspond to the matrix... Each column of the matrix corresponds one-to-one with its elements; that is, the elements in the first row of the weight matrix correspond to the elements in the matrix. The element in the first column corresponds to the index 1, which corresponds to the element in the formula above. The elements in the second row of the weight matrix correspond to the elements in the second column of the line matrix, denoted as index 2, which corresponds to the elements in the formula above. Similarly, the correspondence between other serial numbers can be obtained.

[0137] For example, substituting the above parameters into the measurement formula yields the approximation degree between the target route and the comparison route. For instance, taking the m-th row of the feature matrix corresponding to the target route and the n-th row of the matrix corresponding to the comparison route as an example, when... At that time, seek The value of , where, These are the elements in the first row of the weight matrix. Characteristic matrix The element in the m-th row and first column of the array. Characteristic matrix The element in the nth row and first column. Similarly, the element in the nth row and first column. Substitute respectively The results are summed to further determine the approximation degree. The value of .

[0138] S402: Determine at least one of the lines with the highest approximation as the nearest neighbor line.

[0139] Specifically, based on the aforementioned steps, the approximation of the target route and each comparison route has been obtained. Based on the approximation values, the comparison routes are sorted from smallest to largest, and then the top N comparison routes are selected as the nearest neighbor routes of the target route. The value of N can be set in advance.

[0140] use Figures 1 to 4 The method shown can accurately and efficiently determine the nearest line.

[0141] Based on the same concept as the method for determining neighboring lines described above, this application also provides an apparatus for determining neighboring lines to implement the above method.

[0142] Figure 5The diagram shows a modular structure of a device for determining neighboring lines according to an embodiment of this application. The acquisition module 501 can be used to perform communication actions, and the processing module 502 can be used to implement processing actions. For example, the acquisition module 501 can be used to perform the action of acquiring information about the target line in S101, and the processing module 502 can be used to perform the action of determining information about at least one neighboring line based on the feature matrix, weight matrix, and information about the target line in S102. The processing module 502 is also used to perform the action of determining the feature matrix in S201 to S204. The processing module 502 is also used to perform the action of determining the weight matrix in S301 to S303. The processing module 502 is also used to perform the action of determining the neighboring line in S401 to S402. The specific actions and functions performed are not detailed here, but can be referred to the description in the foregoing method embodiment section.

[0143] For example, the acquisition module 501 can be used to perform the action of acquiring information about the target route in S101. For instance, the acquisition module 501 can acquire information about the target route, including its origin and destination. The processing module 502 can be used to perform the action of determining neighboring routes in S102. For instance, the processing module 502 can determine the neighboring routes corresponding to the target route based on the feature matrix, weight matrix, and target route. The feature matrix is ​​related to the destination matrix, origin matrix, and the great circle distances of multiple reference routes. The weight matrix is ​​related to the transportation prices of the destination matrix, origin matrix, and multiple reference routes. The destination matrix includes the latitude and longitude of the destinations of multiple reference routes, the origin matrix includes the latitude and longitude of the origins of multiple reference routes, and the destinations of the neighboring routes are the same as the destination of the target route.

[0144] For example, the processing module 502 can also be used to perform all the actions in S201 to S204 to determine the feature matrix.

[0145] For example, the processing module 502 can also be used to perform all the actions in S301 to S303 to determine the weight matrix.

[0146] For example, the processing module 502 can also be used to perform all the actions in S401 to S402 to determine the nearest route.

[0147] Figure 6 A schematic diagram of a device structure for determining neighboring lines provided in an embodiment of this application is shown.

[0148] The electronic device in this embodiment may include a processor 601. The processor 601 is the control center of the device, and can connect to various parts of the device via various interfaces and lines, executing instructions stored in a memory 602 and accessing data stored in the memory 602. Optionally, the processor 601 may include one or more processing units. The processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip; in some embodiments, they may be implemented separately on independent chips.

[0149] The processor 601 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps performed by the switch disclosed in the embodiments of this application can be directly executed by the hardware processor, or executed by a combination of hardware and software modules within the processor.

[0150] In this embodiment of the application, the memory 602 stores instructions that can be executed by at least one processor 601. By executing the instructions stored in the memory 602, the at least one processor 601 can perform the aforementioned process of determining the nearest neighbor line.

[0151] Memory 602, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 602 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 602 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 602 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.

[0152] In this embodiment, the device may further include a communication interface 603 through which the electronic device can transmit data. For example, if the electronic device is a client, the communication interface 603 can be used to obtain information about the target line.

[0153] Optional, can be made by Figure 6 The processor 601 (or processor 601 and memory 602) shown implements Figure 5 The processing module 502 shown, and / or, is implemented by the communication interface 603. Figure 5 The acquisition module 501 is shown.

[0154] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium that can store instructions, which, when executed on a computer, cause the computer to perform the operation steps provided in the above-described method embodiments. This computer-readable storage medium may be... Figure 6 The memory 602 shown.

[0155] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0156] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0157] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0158] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0159] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method of near neighbor line determination, the method comprising: The method comprises: obtaining information of a target line, the information of the target line comprising a departure of the target line and a destination of the target line; determining an approximation degree between the target line and a comparison line according to a feature matrix, a weight matrix and a measurement formula, the comparison line being one or more of reference lines; wherein the feature matrix is related to great circle distances between the destination matrix, the departure matrix and the respective departure and destination of the plurality of reference lines, the weight matrix is related to transportation prices of the destination matrix, the departure matrix and the plurality of reference lines respectively, the destination matrix comprising longitude and latitude of the destination of the plurality of reference lines, and the departure matrix comprising longitude and latitude of the departure of the plurality of reference lines; determining at least one line with the highest approximation degree as a nearest neighbor line corresponding to the target line, the destination of the nearest neighbor line being the same as the destination of the target line; The metric formula satisfies: ; wherein, represents the degree of approximation between the target line and the comparison line, , is the element in the weight matrix, is the value of the d-th feature data in the d features in the feature matrix corresponding to the target line, is the value of the d-th feature data in the d features in the feature matrix corresponding to the comparison line, ; d = 10.​​​ 2. The method of claim 1, wherein, further comprising: determining the feature matrix according to the destination matrix, the departure matrix, longitude and latitude of a first reference area in a target area, longitude and latitude of a second reference area in the target area and the respective great circle distance of the plurality of reference lines, wherein the target area comprises the destination of the plurality of reference lines and the departure of the plurality of reference lines.

3. The method of claim 2, wherein, The determination of the feature matrix according to the destination matrix, the departure matrix, longitude and latitude of a first reference area in a target area, longitude and latitude of a second reference area in the target area and the respective great circle distance of the plurality of reference lines comprised in the target area comprises: determining the feature matrix according to the difference between longitude of the destination of the plurality of reference lines comprised in the destination matrix and longitude of the first reference area, the difference between latitude of the destination of the plurality of reference lines comprised in the destination matrix and latitude of the first reference area, the difference between longitude of the departure of the plurality of reference lines comprised in the departure matrix and longitude of the second reference area, the difference between latitude of the departure of the plurality of reference lines comprised in the departure matrix and latitude of the second reference area, and the respective great circle distance of the plurality of reference lines.

4. The method of claim 3, wherein, The first column element in the feature matrix is determined according to ; ; ; ; ; ; ; ; ; ; ; ; ; ; is the number of reference lines; d = 10; wherein , denotes the great circle distance, is the Euler constant; , denotes the destination matrix, denotes the origin matrix; , a matrix of longitudes and latitudes representing the first reference region; ; , a matrix of longitudes and latitudes representative of the second reference region; ; ; ; ; ; denotes the vector cosine radian function; denotes the vector norm function; denotes the transpose of a matrix.

5. The method of any one of claims 1-4, wherein, Further comprising: determining a price matrix according to the transportation prices of the plurality of reference routes respectively, wherein a first column element in the price matrix is a transportation price of a first reference route; a first row element in the price matrix is a transportation price of a second reference route.​ determining an intermediate feature matrix according to the feature matrix, the intermediate feature matrix having the same number of rows as the price matrix, and the first column element of the intermediate feature matrix being the element in the feature matrix corresponding to the first reference route, 1≤i≤m, where m is the number of reference routes in the plurality of reference routes. m is the number of reference routes in the plurality of reference routes;​​​​ determining the weight matrix according to the price matrix and the intermediate feature matrix.

6. The method of claim 5, wherein, The determination of the weight matrix according to the price matrix and the intermediate feature matrix comprises: constructing a linear model between the price matrix, the intermediate feature matrix, and a linear weight matrix; the linear model is used to approximate a relationship between and wherein, denotes the price matrix, denotes the intermediate feature matrix, denotes the linear weight matrix; The weight matrix is determined according to is determined, is a weight matrix obtained by minimizing the error two-norm, satisfies: 。 7. An apparatus for near neighbor circuit determination, the apparatus comprising: The apparatus comprises: an obtaining module configured to obtain information of a target line, the information of the target line comprising a departure of the target line and a destination of the target line; an obtaining module configured to obtain information of a target line, the information of the target line comprising a departure of the target line and a destination of the target line; The processing module is configured to determine the approximation degree between the target line and one or more reference lines according to a feature matrix, a weight matrix and a metric formula, wherein the feature matrix is related to great circle distances between a destination matrix, a departure matrix and respective departure and destination of the one or more reference lines, the weight matrix is related to transportation prices of the destination matrix, the departure matrix and the one or more reference lines, the destination matrix comprises longitude and latitude of destinations of the one or more reference lines, the departure matrix comprises longitude and latitude of departures of the one or more reference lines, and the destination of the near neighbor line is the same as the destination of the target line. The processing module is further configured to determine at least one line with the highest approximation degree as the near neighbor line corresponding to the target line. The metric formula satisfies: ; wherein, represents the degree of approximation between the target line and the comparison line, , is the dth element in the weight matrix, is the dth element in the weight matrix, is the value of the dth feature data in the d features corresponding to the target line in the feature matrix, is the value of the dth feature data in the d features corresponding to the comparison line in the feature matrix, is the value of the dth feature data in the d features corresponding to the comparison line in the feature matrix, is the value of the dth feature data in the d features corresponding to the comparison line in the feature matrix, ; d = 10.

8. An electronic device, comprising: The electronic device comprises a processor configured to implement the steps of the method according to any one of claims 1-6 when executing a computer program stored in a memory.

9. A computer-readable storage medium, characterized in that, The computer program stored in the memory is configured to implement the steps of the method according to any one of claims 1-6 when executed by the processor.

Citation Information

Patent Citations

  • Method of identifying hot tourist route based on mobile signaling

    CN105956951A

  • Line calculation method and device, electronic equipment and readable storage medium

    CN111325502A