Method and system for matching nearest warehouse and most economical express company based on receiving place
By building a tree-shaped structured data model of provinces, cities and districts, matching the receiving address with warehouses and express companies, the problems of low delivery efficiency and high cost in the existing technology are solved, and the optimal matching of warehouses and express companies is achieved, improving the efficiency and economicality of logistics distribution.
Patent Information
- Application Number
- CN202411994646.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
The existing technology has problems such as low efficiency, inconsistent scope, high cost and rough matching methods when selecting the fastest warehouse delivery and the most economical express delivery company, which cannot meet the optimal delivery needs.
By summarizing domestic provinces, cities and district information and storing it in a tree structure, collecting and specifying the delivery scope of warehouses and express companies, building a data model to match the receiving address and warehouses and express companies, selecting the closest warehouse and selecting the express company with the lowest cost.
It has achieved efficient matching of order receiving addresses and warehouses and express delivery companies, shortened delivery paths, improved delivery efficiency, reduced freight costs, and adapted to changes in complex logistics scenarios.
Smart Images

Figure CN119904164A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of e-commerce logistics, and in particular to a method and system for matching the nearest warehouse and the most economical express company based on a delivery address. Background Art
[0002] With the rapid development of e-commerce, the improvement of e-commerce trading platforms, and the rapid development of technologies such as mobile communications, more and more people are buying goods online. The variety of goods on the Internet is dazzling, almost covering people's daily needs. Buyers place orders through the website of the e-commerce platform or the mobile terminal APP. After receiving the order information, the seller can carry out the delivery, packaging, and courier company delivery. In a short time, the buyer can receive the purchased goods at home.
[0003] The delivery efficiency of ordered goods directly affects the user experience. Remote areas and other reasons will also lead to different delivery ranges of different express companies. The delivery cost also affects the seller's operating costs. How to choose the fastest warehouse to ship and choose the express company that can deliver with the lowest freight has become a business problem for e-commerce sellers.
[0004] Some e-commerce order management systems have also tried to solve this problem with system or manual methods. For example, fixed warehouses and express companies are bound to fixed products; for another example, the delivery costs of different express companies are manually judged to select express companies, or some remote areas are fixed to exclude express companies. These solutions are relatively rough and the effect is not satisfactory. Because the express delivery costs in various regions are complicated, the delivery range of express companies changes frequently, which cannot meet the optimal delivery method. This restricts the delivery speed of merchants, wastes social resources to a certain extent, and prolongs the time it takes for users to receive the goods.
[0005] Therefore, the present invention proposes a method and system for matching the nearest warehouse and the most economical courier company based on the destination to solve the deficiencies of the prior art. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a method and system for matching the nearest warehouse and the most economical express company based on the recipient address, which solves the problems of low logistics delivery efficiency, inconsistent delivery ranges of express companies, high delivery costs, and rough matching methods that fail to meet optimal delivery requirements.
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for matching the nearest warehouse and the most economical express company based on the destination includes the following steps: Step 1: Summarize the information of provinces, cities and districts in China and store it in a database table in a tree structure as basic data; Step 2: Collect and specify the delivery range supported by any warehouse and courier company; Step 3: Based on the basic data in step 1 and the delivery range data in step 2, a data model is constructed, wherein the data model includes a set of provinces, cities and districts that each warehouse and courier company supports delivery; Step 4: Bind each warehouse with the courier information it supports for delivery; Step 5: Based on the data models of steps 3 and 4, a complete path model based on structured address data of provinces, cities and districts is formed; Step 6: Get the delivery address of the order, obtain the GPS coordinates of the delivery address and warehouse through reverse address resolution, calculate the distance between the delivery address and the warehouse using the coordinate distance calculation service, and select the nearest warehouse; Step 7: Based on the selected warehouse information, the route model is combined to calculate the courier companies that support delivery, and the courier company with the lowest cost is selected; Step 8: Output the matching nearest warehouse and the most economical courier company.
[0008] Preferably, in step one, the province, city, and district information is derived from the administrative division statistics table of the national administrative division information query platform, and the basic data includes four-level addresses and administrative division codes of province, city, district, and street.
[0009] Preferably, the step three further comprises: Configure the detailed address information of each warehouse and the scope of delivery it supports; Configure the delivery range supported by each courier and its transportation fee; Configure the freight data of each express company in each warehouse in different regions across the country.
[0010] Preferably, the step six comprises: By recursively traversing the path model, the order delivery address is matched with the warehouse information in the path model; Call the address resolution function of the map service to resolve the warehouse address and delivery address into GPS coordinates; Calculate the distance between the delivery address and multiple warehouses, and select the warehouse closest to it.
[0011] Preferably, if a plurality of the warehouses meet the delivery conditions at the same time, the courier company with the lowest freight is further selected as the matching result according to preset rules.
[0012] Preferably, the step 7 further comprises: Get the courier company information that the warehouse supports delivery; Calculate the courier's transportation costs at the order delivery address based on the path model; Compare shipping costs and output the courier with the lowest cost.
[0013] Preferably, the routing model supports dynamic updates, including adjustments based on the delivery range, changes in freight data, and the addition of new areas.
[0014] Preferably, the reverse address resolution and coordinate distance calculation are implemented by calling Baidu map service, or by other map services that provide address resolution and distance calculation.
[0015] The present invention also provides a system for matching the nearest warehouse and the most economical express company based on the destination of the delivery, comprising: The data storage module is used to store tree-structured data of provinces, cities and districts, warehouse and express delivery company delivery range data and path models; the address parsing module is used to parse the order delivery address and warehouse address into GPS coordinates; Distance calculation module, used to calculate the distance between the delivery address and the warehouse; The freight calculation module is used to calculate the courier company's transportation costs at the order delivery address; A matching module, which is used to output the nearest warehouse and the most economical courier company based on the route model and freight information; The output module is used to output the matching results.
[0016] The present invention provides a method and system for matching the nearest warehouse and the most economical express company based on the destination of the package. Beneficial effects: 1. The present invention adopts dynamic matching technology based on path model, and achieves the technical effect of efficiently matching order delivery address with warehouse and courier company information through accurate storage and dynamic update of tree-structured data of provinces, cities and districts. Compared with the solutions based on fixed binding or manual matching in the prior art, it solves the problem of low matching efficiency caused by administrative division adjustment and changes in express delivery range.
[0017] 2. The present invention introduces reverse address resolution and distance calculation technology, accurately locates the geographical location of the receiving address and the warehouse as GPS coordinates, and selects the nearest warehouse through efficient calculation, thereby shortening the delivery path and improving delivery efficiency. Compared with the existing technology of simply comparing text addresses, it solves the defects of insufficient address matching accuracy and non-optimal delivery path.
[0018] 3. The present invention adopts dynamic freight calculation and multi-dimensional priority evaluation technology, comprehensively considers the freight, delivery time and load conditions of the express company, and selects the most economical and demand-compliant express company. Compared with the existing technology of selecting express companies based on a single freight rule, it solves the problem of not being able to balance cost and service quality.
[0019] 4. The present invention achieves the effect of flexible adaptation to complex logistics scenarios through modular design, combined with the collaborative work of data storage, path model, dynamic calculation and result output. Compared with the static system in the prior art that lacks dynamic adjustment capabilities, it solves the problem of inaccurate matching results caused by regional changes, traffic conditions or order demand fluctuations. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is a system architecture diagram of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions 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. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] See also Figure 1 The embodiment of the present invention provides a method for matching the nearest warehouse and the most economical express company based on the destination, including the following steps: Step 1: Summarize the information of provinces, cities and districts in China and store it in a database table in a tree structure as basic data; Step 2: Collect and specify the delivery range supported by any warehouse and courier company; Step 3: Based on the basic data in step 1 and the delivery range data in step 2, build a data model. The data model includes the set of provinces, cities and districts that each warehouse and courier company supports delivery. Step 4: Bind each warehouse with the courier information it supports for delivery; Step 5: Based on the data models of steps 3 and 4, a complete path model based on structured address data of provinces, cities and districts is formed; Step 6: Get the delivery address of the order, obtain the GPS coordinates of the delivery address and warehouse through reverse address resolution, calculate the distance between the delivery address and the warehouse using the coordinate distance calculation service, and select the nearest warehouse; Step 7: Based on the selected warehouse information, the route model is combined to calculate the courier companies that support delivery, and the courier company with the lowest cost is selected; Step 8: Output the matching nearest warehouse and the most economical courier company.
[0023] For step one, the preparation of basic data is the core starting point for the operation of the entire system, and its quality directly affects the accuracy and efficiency of the subsequent matching process. In order to ensure that the system can efficiently and accurately process the order delivery address, the present invention first summarizes the address information of the province, city, district, and street in China, constructs a tree structure, and stores it in the database. This step is closely connected with the subsequent steps, providing basic support for the construction of the path model.
[0024] Specifically, the structured storage of provincial, municipal and district information enables the path model to have a clear hierarchical relationship and lays a technical foundation for subsequent recursive traversal, address resolution and path calculation. In this process, the administrative levels and geographical scopes of different regions are mapped one by one to the hierarchical structure of the database, thereby achieving efficient data storage and query.
[0025] The province, city and district information comes from the national administrative division statistics table. The statistics table provides administrative division codes and corresponding address information across the country, including four levels: province, city, district and street. In order to achieve structured storage, the present invention uses a tree structure to organize this information, which specifically includes the following steps: First, the provincial administrative division code is used as the root node of the tree. For example, the administrative division code corresponding to "Beijing" is 110000. The root node information includes the name and code of the province. Each provincial node is connected to the city-level administrative regions under it. For example, the child nodes of "Beijing" include "Beijing Municipal District" (code 110100).
[0026] Next, the administrative division code of each city is used as the child node of its parent node. For example, the district-level nodes under "Beijing Municipal Districts" include "Dongcheng District" (code 110101), "Xicheng District" (code 110102), etc.
[0027] Finally, for the district-level node, its child nodes are further expanded to the street level. For example, the street nodes under "Dongcheng District" include "Donghuamen Street" (code 110101001). The storage of street information adopts the most detailed address representation.
[0028] In general, in order to optimize query efficiency and data storage capacity, the present invention adopts an adjacency list (AdjacencyList) in the implementation of the tree structure. Specifically, each record in the database table not only stores the information of the current node, but also contains the parent node identifier of the node. This structure enables each node to be quickly located in the tree through its parent node.
[0029] In a possible implementation, the fields of the adjacency list structure include: Node ID: uniquely identifies the node of each administrative area; Parent node ID: identifies the immediate superior administrative region of the current node; Node name: record the name of the current node, such as "Dongcheng District"; Administrative division code: record the administrative division code of the current node, such as 110101; Level: Indicates the level to which the node belongs, for example, 1 represents the provincial level, 2 represents the municipal level, 3 represents the district level, and 4 represents the street level.
[0030] In addition, as an option, an auxiliary field can be added to the tree structure to represent the coordinate information of the geographic center point of the region. For example, the coordinates of the center point of Dongcheng District, Beijing can be defined as the longitude and latitude values (116.42189, 39.93857). In some embodiments, the system will also standardize the administrative division information, such as unifying the address naming rules, removing redundant spaces, and checking the legality of the administrative division code.
[0031] In order to support efficient query, the present invention optimizes the index of the database table, especially separately indexing the node ID, parent node ID and administrative division code fields. Specifically, the B+ tree index structure can greatly improve the query speed when recursively traversing in the path model.
[0032] In order to facilitate subsequent path matching and calculation, the present invention adds the coordinate information of the geographical location to each node. i represents the i-th administrative region, and the longitude and latitude coordinates of its center point are (x i ,y i ), where: x i Represents node N i Longitude; y i Represents node N i For any two nodes N i and N j , its geographical distance can be calculated by the following formula: d ij = R arccos(sin(y i )·sin(y j )+cos(y i )·cos(y j )·cos(x i -x j )) Among them, d ij is the geographical distance between two points, R is the radius of the earth, which is about 6371 kilometers, and x i ,y i ,x j ,y jIt needs to be expressed in radians. As an option, the system can calculate and store the distance matrix between commonly used areas in advance to avoid repeated distance calculation each time it is queried. For example, for the various districts in Beijing, the distance data table between them can be stored in advance.
[0033] In some embodiments, the preparation of basic data also includes special processing of fuzzy boundary areas. For example, a "cross-district street" may belong to multiple districts at the same time. The system will create virtual nodes for these special nodes and identify the priority of their affiliation through weight parameters.
[0034] In another implementation, the present invention can dynamically update administrative division information in combination with public API interfaces such as Amap and Google Maps, etc. By regularly synchronizing the latest change data of administrative divisions across the country, the timeliness and accuracy of basic data can be ensured.
[0035] For step two, the input signal is further processed, with a focus on improving accuracy and optimizing the results of the previous step. The core goal of this step is to make more refined adjustments to the signal to ensure the effectiveness of subsequent operations. To achieve this goal, a multi-dimensional signal processing method is used to maximize the responsiveness of the entire system.
[0036] In this embodiment, the input signal is first processed in segments. Specifically, the input signal is first preliminarily screened by the filtering module to remove high-frequency noise. By setting a predetermined frequency range, only the valid signal part is retained. This processing step ensures the quality of the signal and avoids the influence of noise interference on subsequent steps. Then, the filtered signal will be sent to an adaptive gain control module, which adjusts the gain value according to real-time feedback to maintain a smooth output of the signal.
[0037] In some embodiments, the gain control module can also be combined with multi-channel input signals for joint adjustment. This can further enhance the system's ability to adapt to complex environmental changes, especially when the signal quality is unstable. For the specific adjustment of the gain, the following formula can be used for calculation: Where G is the gain, α is the gain coefficient, V in is the input signal voltage, V ref In practical applications, the selection of α will be dynamically adjusted according to system requirements and signal quality to ensure the adaptability of the gain value.
[0038] As an option, a sliding window algorithm can be introduced into the gain adjustment process, which dynamically predicts the gain value that best suits the current environment by analyzing historical data. Specifically, the algorithm compares the change trend of historical signals with the current signal, predicts the signal change in the future, and adjusts the gain control parameters accordingly.
[0039] In another possible implementation, a machine learning method can be used to optimize the gain control strategy. By training on a large amount of historical data, the system can continuously learn and improve the gain adjustment strategy, so that it always maintains a high accuracy under various complex conditions.
[0040] In addition, this step also involves real-time monitoring and feedback adjustment of the signal. The signal processing module will adjust the processing parameters in real time according to the feedback information to ensure that the signal is not distorted during the processing process. For example, the system can adjust the frequency response of the filter in real time according to the amplitude, frequency and other characteristics of the current signal to maintain the integrity of the signal.
[0041] For step three, the core task of the signal analysis and evaluation stage is to conduct in-depth analysis of the signal characteristics to provide an accurate basis for subsequent decision-making and processing. This stage is different from the signal processing in the previous steps. It focuses on mathematical modeling and feature extraction of the signal to ensure that various key indicators are effectively extracted and provide valuable information for subsequent links.
[0042] First, the signal processed in step 2 will be sent to the multidimensional analysis module. The goal of this module is to provide more detailed signal characteristics by breaking down the signal's frequency, amplitude, phase and other dimensions. This step mainly relies on Fourier transform to perform frequency domain analysis to extract the frequency components of the signal. The standard formula for Fourier transform is as follows: Among them, X(f) represents the representation of the signal in the frequency domain, f is the frequency variable, x(t) represents the representation of the original signal in the time domain, x(t) is the signal that changes with time, and its domain is all real time t, e -j2πft It is a complex exponential function, used to express the frequency component, where j is an imaginary unit f is frequency, t is time, and the complex exponential function weights the signal by different frequency components. f represents the frequency variable in Hertz (Hz), corresponding to the frequency component of the signal. Represents the integration of the signal x(t) from time t = -∞ to t = +∞. Through this transformation, the system converts the time domain signal into a frequency domain signal, so that the distribution of each frequency component in the signal can be analyzed.
[0043] For non-stationary signals, Fourier transform may not be able to fully capture the instantaneous changes of the signal. In order to deal with this situation, the system can use wavelet transform (WaveletTransform) to perform time-frequency analysis on the signal. Wavelet transform can provide higher time resolution and is particularly suitable for analyzing irregular or large instantaneous changes in signals. The formula for wavelet transform is: Among them, W ψ (a,b) represents the result of wavelet transform, which is the transform coefficient of the signal under the wavelet basis ψ. a and b are scale and position parameters, respectively, representing the local characteristics of the signal at different scales and positions. x(t) is the time domain representation of the original signal, which changes with time t. is the functional form of the mother wavelet, ψ is the mother wavelet, It is the translation and scaling form of the wavelet function. Specifically, b is the translation parameter, which indicates the translation position of the wavelet function on the time axis, and a is the scale parameter, which indicates the compression (a<1) or stretching (a>1) of the wavelet function. is a normalization factor used to ensure that the wavelet transform remains consistent during the scale transformation process, even if the scale is changed, the total energy of the wavelet remains unchanged. is the integral symbol, which means integrating the product of the signal x(t) and the wavelet function ψ over the entire time domain. Through this formula, the system can effectively extract time-frequency information from the signal and further improve the accuracy of the analysis.
[0044] Furthermore, this step also includes feature extraction of the signal. Specifically, the system will extract key features of the signal such as amplitude, phase, frequency, and evaluate the overall characteristics of the signal through statistical analysis methods such as mean, variance, skewness and other parameters. These features provide an effective reference for subsequent steps.
[0045] In one possible implementation, the feature extraction module can also be combined with machine learning techniques to automatically identify and classify the features of the signal based on historical data. For example, the system can analyze the patterns in the signal and determine the category it belongs to through algorithms such as support vector machines (SVM) or neural networks. By training on large amounts of data, the system can continuously optimize its feature recognition capabilities to achieve more accurate signal evaluation.
[0046] In addition, signal quality assessment is also an important part of this step. The signal assessment module will judge the quality of the signal based on the extracted features through a series of predetermined rules and algorithms. For example, if the signal has a lot of noise interference, the system may judge its effectiveness by evaluating the signal-to-noise ratio (SNR). The calculation formula for the signal-to-noise ratio is: Among them, Psignal and P noise Represents the power of signal and noise respectively. The system uses this evaluation index to decide whether the signal needs to be further processed or adjusted.
[0047] As an option, signal quality assessment can also be combined with the time domain characteristics of the signal, by performing autocorrelation analysis on the signal time series or dynamic estimation based on Kalman Filtering to further optimize the signal evaluation process. These methods can help the system track changes in signal quality in real time and ensure that the signal processing process always remains efficient and accurate.
[0048] For step 4, it is to establish a binding relationship between the warehouse and the courier company. The core of this step is to combine the aforementioned path model with logistics resources to ensure that the data of the warehouse and its optional courier companies can be dynamically associated, thereby providing input support for path optimization and cost evaluation. By clarifying the binding relationship, the system can quickly lock in the delivery options that meet the conditions in actual operation, laying the foundation for subsequent cost calculation and matching.
[0049] In this embodiment, the binding relationship between the warehouse and the courier company is realized through the structured storage of the data table. In general, the system uses the warehouse as the main unit of binding, each warehouse can be associated with multiple courier companies, and the delivery range of each courier company is represented by its corresponding area set. As an option, the binding information can be recorded in the database in the form of a key-value pair, for example, the unique identifier (ID) of the warehouse is used as the key, and the courier company's identifier and its delivery range are used as the value.
[0050] Specifically, the system first preliminarily selects the express companies that can provide services for the warehouse based on its geographical location and operating scope. The service scope of an express company is usually defined as a set of regions, recorded as: R k ={A1,A2,…,A n} Among them, R k A represents the delivery range of courier company k, i In order to match warehouses and express companies, the system needs to determine whether the warehouse area W belongs to the express company's delivery range R k This judgment can be achieved through set operations, for example: If the intersection is not empty, it means that the courier company can serve the warehouse. The system records this relationship in the binding table. For example: If the intersection is not empty, it means that the courier company can serve the warehouse. The system records this relationship in the binding table. For example, the following information is recorded in the binding table: Express company ID: uniquely identifies a courier company; Service area: the collection of delivery areas of the courier company; Freight rate: the courier company's charges in different areas.
[0051] In a possible implementation, the system can also dynamically adjust the binding relationship. Specifically, when the service scope of the express company changes, the system can automatically update the binding table through the background interface. For example, when the express company adds a new service scope A in a certain area n+1 , the system can directly convert A n+1 to the service territory collection of the corresponding record without manually modifying the data.
[0052] In some embodiments, the establishment of the binding relationship can also be combined with the setting of freight rules. Specifically, each courier company may set different freight rates for different regions. For example, for a courier company k, its i The freight rate can be expressed as: C ki =P0+d·P1 Among them, C k,i Indicates area A i P0 represents the fixed starting price, d represents the transportation distance, and P1 represents the additional freight per kilometer.
[0053] In another implementation, the binding relationship can support multi-dimensional associations. For example, the system can associate each warehouse with the courier company's transportation capacity, delivery time and other data to facilitate more refined decision-making. For example, a courier company may provide next-day delivery service in a specific area, while another courier company only provides ordinary delivery service. The system will record this additional information in the binding table to support subsequent priority evaluation.
[0054] Specifically, the system stores this information by building multi-table associations. For example, the warehouse table, courier table, and binding table are associated with each other through primary key-foreign key relationships, allowing the system to quickly retrieve all binding relationships for any warehouse. At the same time, the system creates indexes for the binding table to improve query efficiency. For example, when you need to find all available courier companies in a certain area, the system can quickly locate relevant records through indexes to reduce retrieval time.
[0055] By establishing the above binding relationship, step 4 not only realizes the dynamic association between the warehouse and the express company, but also provides a solid data foundation for subsequent route selection, cost calculation, etc. This design can adapt to the changing needs in logistics scenarios while ensuring efficient storage and fast query of data.
[0056] For step five, the focus is to form complete structured path data based on the previously constructed path model, so as to efficiently complete the matching of warehouses and express companies and the subsequent delivery path selection. The key to this step is to further integrate the hierarchical address data of provinces, cities and districts with the information bound to warehouses and express companies, and establish a logically clear and easy-to-query delivery path model, thereby improving the dynamic response capability of the system.
[0057] In this embodiment, the construction of the path model is based on a tree structure, and combined with the binding relationship generated in the previous steps, the adaptation is carried out layer by layer. In general, each node in the path model corresponds to an administrative unit, and the superior-subordinate relationship of the node is recursively established layer by layer according to the province, city, district, and street. k Supported delivery areas R k It will be nested into the path model level by level, and the warehouse step four warehouse W i Service scope i Dynamic matching is performed. Step 4 As an option, the information of each node in the path model not only includes its administrative division identification, but also other important delivery information. Step 4 Specifically, each node will contain the following: Node ID: uniquely identifies the node; Parent node ID: the ID pointing to the parent node; Warehouse information: Warehouse W that matches this node i ; Courier company information: the courier company set E that supports delivery at this node k ; Freight rules: specific freight information for this node area; Geographic coordinates: The coordinates of the center point of the node, used for subsequent distance calculations.
[0058] In this embodiment, in order to further improve the matching efficiency of the path model, the system divides the construction process of the path model into two steps: regional division and data association. In the regional division stage, the system recursively traverses the basic address tree structure according to the hierarchical relationship of the administrative division data, and initializes all administrative area nodes into the path model. Subsequently, in the data association stage, the system associates the service scope information of the warehouse and the express company with the path nodes one by one through the binding table.
[0059] In a possible implementation, the service courier company E at each node in the path modelk Its delivery priority is calculated using the following formula: Among them, P k Indicates courier company E k The priority of C k,i For express company E k At Node A i Freight, T k For express company E k Delivery time limit.
[0060] The system sorts the courier company set E according to the calculation results. k Specifically, suppose that a node A in the path model i The service express companies are {E1,E2,E3}, where: Freight C from courier E1 1,i =10, time limit T1 = 2; E2's freight rate C 2,i =8, aging time T2 = 3; E3's freight rate C 3,i =12, time limit T3=1.
[0061] Calculated by the formula: Among them, P k represents the delivery priority of courier company k at node i, C k,i represents the freight (cost) of courier company k at node i, in currency (such as yuan), T k It represents the delivery time of courier company k, and the unit is time (such as hours or days). k is the courier company number, which is used to distinguish different courier companies. i is the node number in the path model, which represents a specific administrative area (such as a province, city, district, street, etc.).
[0062] In some embodiments, the construction of the path model is also combined with a dynamic update mechanism. For example, when the service scope of a warehouse or the delivery rules of a courier company change, the system can ensure the accuracy and timeliness of the model by updating the node information of the path model in real time. As an option, the system will periodically scan the service scope change records in the binding table and synchronize the newly added or removed area information to the path model.
[0063] In another implementation, the path model can be integrated with the map service platform to dynamically adjust the node connections of the model through real-time geographic coordinate analysis. For example, when a certain area is blocked due to an emergency, the system can temporarily shut down the service of the node and readjust the connection relationship between its upper and lower nodes to avoid affecting the global path matching efficiency.
[0064] In the query process of the path model, the system can use the depth-first search (DFS) or breadth-first search (BFS) algorithm to achieve fast traversal. For example, for a specific address, the system will start from the root node and recursively search down along the hierarchical structure of the path model until the target node is located. Assume that the target node is A i , whose path is expressed as: Among them, R represents the root node, P represents the provincial node, C represents the city node, and A i Represents the target node.
[0065] Through the hierarchical representation of the path model, the system can quickly locate any administrative area and its associated warehouse and courier company information.
[0066] For step six, the geographic location data of the delivery address and warehouse is used to select the nearest warehouse through reverse address resolution and distance calculation. Based on the aforementioned path model and binding relationship, this step combines the geographic information resolution function of the map service to provide accurate warehouse distance calculation support, thereby achieving efficient warehouse selection. Through this process, the system can dynamically match the candidate warehouses in the path model with the specific delivery address to ensure the rationality and economy of the delivery path.
[0067] In this embodiment, the delivery address in the order is first obtained, and the delivery address is resolved into geographic coordinates (longitude and latitude) by calling the reverse address resolution function of the map service (such as Baidu Maps, Google Maps, etc.). Generally, the resolution result of the map service will provide a variety of address information, including complete administrative division information and accurate geographic coordinates. In order to ensure the accuracy of the resolution result, the system will check whether the resolved address matches the node in the path model.
[0068] As an option, the parsed geographic coordinates of the delivery address can be expressed as: L r =(x r ,y r ) Where: L r is the geographic coordinates of the delivery address, x r is the longitude of the delivery address, y r The latitude of the delivery address.
[0069] Next, the system obtains the geographic coordinates of all candidate warehouses through the path model. Assume that a candidate warehouse W i The geographical coordinates are: Among them, L Wi For warehouse W i The geographical coordinates, x i For warehouse W i Longitude, y i For warehouse W i Latitude.
[0070] To calculate the straight-line distance between the delivery address and each candidate warehouse, the system uses the spherical distance formula (Haversine formula), which is applicable to the distance calculation between any two points on the earth's surface: Among them, d i For the delivery address and warehouse W i The spherical distance, R is the radius of the earth, which is about 6371 kilometers, x r ,y r is the longitude and latitude of the delivery address, x i ,y i For warehouse W i longitude and latitude.
[0071] Through the above formula, the system can calculate the spherical distance between the delivery address and all candidate warehouses. In one possible implementation, the system stores the distance calculation results of all candidate warehouses in a list form. For example, for three candidate warehouses W1, W2, and W3, the distance calculation results can be expressed as: D={d1,d2,d3} Among them, d1, d2, d3 are the distances between the delivery address and warehouses W1, W2, W3 respectively. The system will select the warehouse with the smallest distance from the above distance list as the best matching warehouse, that is: W nearest =argmin i (d i ) Among them, W nearest Indicates the nearest warehouse, argmin i (d i ) means that d i The smallest warehouse index i, the smallest warehouse, d i represents the distance between the delivery address and the i-th candidate warehouse, where i is the number of the candidate warehouse, which is used to identify the specific warehouse (e.g. W1, W2, ..., W n ).
[0072] In some embodiments, the distance calculation can also be adjusted in combination with actual traffic conditions. For example, when a warehouse is geographically closest in terms of straight-line distance, but the transportation time is extended due to traffic congestion or other reasons, the system will re-evaluate the priority of the warehouse. As an option, the system will combine real-time traffic data to calculate the actual transportation time T between the delivery address and each candidate warehouse. i , and warehouse priority is evaluated using the following formula: in, For warehouse W i The priority of i For warehouse W i The straight-line distance, T i For warehouse W i The actual shipping time.
[0073] Through this formula, the system can comprehensively consider distance and time factors and dynamically adjust the warehouse selection results.
[0074] In another possible implementation, the step can pre-cache the distance data between some commonly used addresses and warehouses. For example, for high-frequency delivery addresses, the system can directly retrieve the distance results from the cache without repeated calculations. This method can significantly improve the computing efficiency of the system.
[0075] For step 7, based on the nearest warehouse selected previously, combined with the service scope and freight rules of the express company in the path model, the most economical express company is further selected as the matching result. The core task of this step is to comprehensively analyze the delivery costs and service conditions of the express company to ensure that the delivery plan strikes a balance between economy and feasibility, while providing precise guidance for subsequent delivery operations.
[0076] In this embodiment, the system first obtains all express companies bound to the selected warehouse from the path model. Generally, each express company provides a specific delivery service area and corresponding fee rules. The system selects the delivery address based on the node A where the delivery address is located. i Match all available express delivery companies, recorded as: E={E1,E2,…,E k} Among them, E represents all nodes bound to the warehouse and covering node A i courier collection.
[0077] Specifically, the system will calculate the delivery fee of each courier company based on the courier company's fee model. j Cost of C j,i It can be expressed as: C ji =P0+d i P1 Among them, C j,i Indicates courier company E j At Node A i The delivery fee is P0, P0 is the fixed starting fee, d i is the distance from the warehouse to the delivery address (calculated in step 6), and P1 is the transportation cost per unit distance.
[0078] In some embodiments, the system may also consider the courier's service level or special additional charges. For example, some courier companies may charge additional fees for deliveries to remote areas. j,i In this case, the cost formula can be expanded to: C ji =P0+d i ·P1+F j,i As an option, additional fee F j,i According to node A i Dynamic adjustment of the attributes of the products, such as grading them according to the remoteness of the region or the delivery time requirements.
[0079] After calculating the fees of all express delivery companies, the system selects the express delivery company with the lowest fee as the matching result, that is: E min =argmin j (C j,i ) Among them, E min Indicates the courier with the lowest cost, argmin j Indicates to find the cost C among all couriers j,i The smallest express company E j .
[0080] In one possible implementation, the system not only focuses on the lowest freight rate, but also adjusts the priority of the courier companies based on other factors (such as delivery time, customer preferences, etc.). j Delivery time T j Compared with other express delivery companies, the system can recalculate the priority by the following formula: Among them, P j Indicates courier company E j The priority of C j,i For express company E j Delivery fee, T j For express company E jDelivery time (such as next day delivery, next day delivery, etc.).
[0081] After calculation, the system selects the courier with the highest priority as the final matching result. Generally speaking, this priority adjustment is suitable for scenarios where customers have high requirements for timeliness.
[0082] In another embodiment, the system also supports the selection of courier companies based on the user's historical preferences. For example, if a customer has selected a specific courier company multiple times in past orders, the system will set the courier company as the priority match, provided that its cost and timeliness meet the basic standards. This design can improve user satisfaction and experience.
[0083] In order to improve the efficiency of fee calculation, the fee rules of the express company at each node will be stored in the database in the form of a pre-calculated table. For example, for common nodes, the following data can be pre-stored: Node ID (A i ); Courier company ID (E j ); Initial fee (P0); Cost per unit distance (P1); Additional Fee (F j,i ).
[0084] When querying, you only need to search based on node A. i The distance between the warehouse and the delivery address d i , quickly complete the cost calculation and return the result.
[0085] Assume that the nearest warehouse selected by the system is bound to three express companies E1, E2, and E3, and the relevant parameters of their delivery fees are as follows: Express company E1: P0=10, P1=2, no additional charges; Express company E2: P0=8, P1=2.5, no additional charges; Express company E3: P0=12, P1=1.8, additional fee F 3,i =5.
[0086] Assume that the distance from the warehouse to the delivery address is d i = 5 km, the cost is calculated as follows: C 1,i =10+5·2=20 C 2,i =8+5·2.5=20.5 C 3,i =12+5·1.8+5=26 It can be seen that courier E1 has the lowest cost, and the system selects it as the final courier.
[0087] For step eight, the final delivery plan is generated based on the warehouses and express companies selected above. This step integrates all matching and calculation results into a complete set of delivery information for use by downstream systems or actual operations. This step is not only a summary and application of the above technical process, but also provides clear guidance data for the execution of orders to ensure the feasibility and efficiency of the plan.
[0088] In this embodiment, the system first selects the nearest warehouse W according to step 6. nearest and the most economical courier E selected in step 7 min , integrating the information of the two. In general, the generation of a delivery plan includes the following key contents: Delivery address details; The warehouse identification and geographic location of the delivery; Select the courier company's name, contact information and delivery area; Shipping cost and delivery time information; Actual delivery route suggestions.
[0089] Specifically, the system extracts detailed information of warehouses and express companies from the route model and generates a delivery solution data structure based on the selected results. As an option, the data structure can be represented as: S={A r ,W nearest ,E min ,C E,i ,T E,i ,P} Among them, A r For the detailed information of the delivery address, nearest is the identification and geographic location of the nearest warehouse, E min The logo of the selected courier company, C E,i is the delivery fee of the selected courier company, T E,i is the delivery time of the selected courier company, and P is the recommended delivery route.
[0090] In general, the system will also generate specific delivery route suggestions based on the route planning function provided by the map service and the geographic coordinates between the warehouse and the delivery address. The generation of the route usually depends on real-time traffic data, such as avoiding congested sections or choosing the shortest route. Assuming that the route planning result is a multi-segment route, the system can record the detailed information of each route segment as: P={R1,R2,…,R n} Among them, P is the delivery path, R k is the starting point and end point information of the kth path, as well as the corresponding distance and estimated travel time.
[0091] In one possible implementation, the generation of the delivery plan will also be dynamically optimized in combination with the actual delivery capacity of the courier company. For example, the system will determine whether the courier company has sufficient transportation capacity to complete the current order based on its current delivery task load. min If the load is too high, the system can add alternative couriers to the delivery plan to ensure timely processing of orders. As an option, the priority of the alternative couriers can be calculated using the following formula: Among them, P backup is the priority of the alternative express delivery companies, C j,i For express company E j The delivery cost, T j For express company E j Delivery time, L j For express company E j The current load.
[0092] Through calculation, the system can generate a list of alternative courier companies for the order, ensuring flexibility and reliability of delivery.
[0093] In order to support subsequent order execution and delivery monitoring, in this embodiment, the delivery plan will be stored in the database. Specifically, the system generates a unique delivery plan record for each order, and the record content includes: Order number; The time when the delivery plan was generated; Detailed information of selected warehouse and courier company; Shipping cost, timeliness and route suggestions.
[0094] As an extension, the delivery plan can also be output in the form of an API through the system interface for use by downstream systems or operators. For example, the system can send the delivery plan directly to the courier company to facilitate it to quickly receive the order and deliver it.
[0095] Assume that the delivery plan generated by the system includes the following information: Mailing address: Zhongguancun, Haidian District, Beijing; Nearest warehouse: Warehouse A, located in Fengtai District, Beijing, 10 kilometers away; Select the courier company: Courier Company X; Delivery fee: 20 yuan; Delivery time: 1 day; Recommended route: Pass through West Third Ring Road North and Zhichun Road.
[0096] The final delivery plan can be expressed as: S={A r ,W A ,E X ,C E,i ,T E,i ,P} A r , delivery address, for example "Zhongguancun, Haidian District, Beijing"; W A , the selected nearest warehouse, for example "Warehouse A"; E X , the selected courier company, for example "Courier Company X"; C Ei , delivery fee, for example "20 yuan"; T Ei , delivery time, for example "1 day"; P, delivery route, for example, {R1, R2} = {West Third Ring Road North, Zhichun Road}.
[0097] This plan will be stored in the database and pushed to relevant departments or express companies through the interface.
[0098] See also Figure 2 The present invention also provides a system for matching the nearest warehouse and the most economical express company based on the destination, including: The data storage module is used to store tree-structured data of provinces, cities and districts, warehouse and express delivery company delivery range data and path models; the address parsing module is used to parse the order delivery address and warehouse address into GPS coordinates; Distance calculation module, used to calculate the distance between the delivery address and the warehouse; The freight calculation module is used to calculate the courier company's transportation costs at the order delivery address; A matching module, which is used to output the nearest warehouse and the most economical courier company based on the route model and freight information; The output module is used to output the matching results.
[0099] For data storage modules This module is used to store all basic data related to system operation. Its functions include: Stores tree-structured data of provinces, cities, and districts across the country to support hierarchical address parsing and path model construction; Storage warehouse and courier service coverage data, including the area covered by the warehouse and the courier delivery range; Record the courier company’s freight rules, delivery time information, and its delivery capacity and load status; Save the path model data to define the hierarchical relationship of nodes at all levels of provinces, cities and districts and their dynamic binding with warehouses and express companies.
[0100] In general, the module supports real-time data updates to ensure consistency with the latest administrative divisions and courier service areas. As an option, caching technology can also be used to improve the efficiency of high-frequency data access.
[0101] For the address resolution module This module is used to convert the delivery address and warehouse address in the order into standardized geographic information data. Specific functions include: using the map service interface (such as Baidu Maps, Amap) to parse the text address into longitude and latitude coordinates; Combined with the path model, verify whether the address resolution result belongs to the service scope of the system; Correct or complete incomplete or abnormal address information, such as automatically completing missing province, city, and district information.
[0102] In some embodiments, the module can perform standardization processing on the input text address, such as removing redundant characters, unifying the address format, and improving the parsing accuracy.
[0103] For distance calculation module This module is used to calculate the distance between the order delivery address and the candidate warehouse. The core functions include: Calculate the distance between the delivery address and each warehouse based on the longitude and latitude coordinates generated by the address resolution module; Supports combining real-time traffic data to calculate the distance of the actual transportation route; Dynamically generate a distance list between warehouses and delivery addresses for subsequent warehouse matching.
[0104] As an option, this module supports storing calculation results in cache to avoid repeated calculation of distances to commonly used addresses and warehouses, thus improving the response efficiency of the system.
[0105] For freight calculation module This module is used to calculate the delivery fee of the courier company at the order delivery address. The core functions include: Generate order delivery fees based on the courier company's fee rules and the distance data provided by the distance calculation module; Based on the delivery policies of different express delivery companies, dynamic adjustments are made to additional charges for special areas (such as remote areas) or special needs (such as expedited delivery); Provide comprehensive cost data support for subsequent courier company matching.
[0106] In some embodiments, the module can dynamically update the fee rules, for example, based on the real-time quotes or preferential policies of the express company, to generate fee data that best meets current needs.
[0107] For matching modules This module is responsible for integrating the path model, distance calculation results and cost information to select the best warehouse and courier. The main functions include: Determine candidate warehouses that cover the delivery address based on the path model, and select the warehouse closest to it; Use the freight calculation results and the express company's service capabilities to select the most economical express company; Dynamically adjust matching rules, such as automatically switching to alternatives if the courier is overloaded.
[0108] In some embodiments, the module can combine the user's special preferences, such as giving priority to a certain brand of courier or a specific service level, to generate personalized matching results.
[0109] For output modules This module is used to integrate and output the matching results into actionable data, including: The output includes the delivery plan of the nearest warehouse and the most economical courier. The plan includes detailed information of the warehouse and courier, delivery fee, delivery time and delivery route. Store the matching results in the system database in the form of structured data for subsequent order execution and tracking; Provide a data interface to push matching solutions to relevant departments or express company systems for further processing.
[0110] As an extension, this module supports interaction with the user front end, directly feeding back the matching results to the customer, while providing detailed instructions on delivery time and costs.
[0111] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for matching the nearest warehouse and the most economical courier company based on the destination, characterized in that: The following steps are involved: Step 1: Summarize the information of provinces, cities and districts in China and store it in a database table in a tree structure as basic data; Step 2: Collect and specify the delivery range supported by any warehouse and courier company; Step 3: Based on the basic data in step 1 and the delivery range data in step 2, a data model is constructed, wherein the data model includes a set of provinces, cities and districts that each warehouse and courier company supports delivery; Step 4: Bind each warehouse with the courier information it supports for delivery; Step 5: Based on the data models of steps 3 and 4, a complete path model based on structured address data of provinces, cities and districts is formed; Step 6: Get the delivery address of the order, obtain the GPS coordinates of the delivery address and warehouse through reverse address resolution, calculate the distance between the delivery address and the warehouse using the coordinate distance calculation service, and select the nearest warehouse; Step 7: Based on the selected warehouse information, the route model is combined to calculate the courier companies that support delivery, and the courier company with the lowest cost is selected; Step 8: Output the matching nearest warehouse and the most economical courier company.
2. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: In the step 1, the province, city and district information comes from the administrative division statistics table of the national administrative division information query platform, and the basic data includes the four-level addresses and administrative division codes of province, city, district and street.
3. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: The step three further comprises: Configure the detailed address information of each warehouse and the scope of delivery it supports; Configure the delivery range supported by each courier and its transportation fee; Configure the freight data of each express company in each warehouse in different regions across the country.
4. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: The step six comprises: By recursively traversing the path model, the order delivery address is matched with the warehouse information in the path model; Call the address resolution function of the map service to resolve the warehouse address and delivery address into GPS coordinates; Calculate the distance between the delivery address and multiple warehouses, and select the warehouse closest to it.
5. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 4, characterized in that: If multiple warehouses meet the delivery conditions at the same time, the courier company with the lowest freight is further selected as the matching result according to the preset rules.
6. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: The step 7 further comprises: Get the courier company information that the warehouse supports delivery; Calculate the courier's transportation costs at the order delivery address based on the path model; Compare shipping costs and output the courier with the lowest cost.
7. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: The routing model supports dynamic updates, including adjustments based on the delivery range, changes in freight data, and the addition of new areas.
8. The method for matching the nearest warehouse and the most economical courier company based on the destination according to claim 1, characterized in that: The reverse address resolution and coordinate distance calculation are implemented by calling Baidu map service, or by other map services that provide address resolution and distance calculation.
9. A system for matching the nearest warehouse and the most economical courier company based on the destination, applied to the method for matching the nearest warehouse and the most economical courier company based on the destination as claimed in any one of claims 1 to 8, characterized in that: include: Data storage module, used to store tree-structured data of provinces, cities and districts, warehouse and express delivery company delivery range data and path models; Address parsing module, used to parse order delivery addresses and warehouse addresses into GPS coordinates; Distance calculation module, used to calculate the distance between the delivery address and the warehouse; The freight calculation module is used to calculate the courier company's transportation costs at the order delivery address; A matching module, which is used to output the nearest warehouse and the most economical courier company based on the route model and freight information; The output module is used to output the matching results.
Citation Information
Patent Citations
A method and device for outputting information
CN109902986A
E-commerce multi-warehouse delivery dispatching management system
CN114004679A
Multi-warehouse delivery intelligent matching method and system, and electronic equipment
CN117892891A
Computer processing method for order warehouse searching and related device
CN118941209A
Method and Apparatus for Operating Parcel Delivery Service, Combination System for Parcel Delivery Service
KR1020180124526A