Express waybill four-segment code sorting identification model construction method and system based on structure tree
By building a four-stage code sorting recognition model for express delivery based on structure trees, and using the four-stage code encoding model to realize one-time express sorting, the problems of inefficient and high error rates in the existing technology are solved, the sorting efficiency and accuracy are improved, and the transportation cost is reduced.
Patent Information
- Application Number
- CN202510177956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-06-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing express sorting technology is inefficient and prone to errors, resulting in extended transportation time and increased costs. Especially when facing complex logistics networks and diversified parcel types, it is difficult to achieve one-time sorting and direct destination.
A four-stage code sorting and identification model for express delivery singles is adopted based on structure trees. By obtaining administrative district databases, acquiring multiple administrative nodes and performing coding operations, a four-stage code encoding model is obtained, which realizes one-time sorting and reduces transportation costs.
It improves the efficiency and accuracy of express sorting, reduces transportation costs, and solves the problem of difficulty in realizing one-time sorting in the prior art.
Smart Images

Figure CN120106704A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics technology, and in particular to a method and system for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree. Background Art
[0002] With the rapid development of the e-commerce industry, the volume of express delivery business continues to rise, and the limitations of traditional express delivery sorting methods have become increasingly apparent.
[0003] At present, express delivery sorting in my country mainly relies on manual sorting and semi-automatic sorting equipment. These methods are not only inefficient, but also prone to errors, resulting in longer express delivery time and increased costs. For example, when handling a large number of parcels, manual sorting is not only slow, but also prone to misclassification of parcels due to fatigue or negligence. In addition, express parcels need to pass through transfer centers in multiple provinces and cities for multiple sorting and transfers during transportation. This process is not only time-consuming, but also increases logistics costs.
[0004] In order to meet these challenges, the express delivery industry has gradually introduced intelligent sorting technology. For example, automated sorting equipment can quickly identify package information through barcodes, QR codes or RFID technology, and realize automatic sorting. The sorting efficiency of these devices is several times that of manual sorting, and the accuracy is higher. However, the existing sorting technology still has shortcomings, especially when faced with complex logistics networks and diverse package types, it is difficult to achieve one-time sorting directly to the destination. Therefore, it is particularly important to develop an express sorting method and transportation system that can sort efficiently and accurately, and no longer requires transshipment after one-time sorting. Summary of the invention
[0005] The present invention provides a method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree and a computer-readable storage medium. The main purpose of the present invention is to use a sorting method and combined transportation to achieve one-time sorting without the need for transfer by using a four-segment code, thereby improving the efficiency and accuracy of express sorting and reducing transportation costs.
[0006] To achieve the above object, the present invention provides a method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree, comprising:
[0007] Obtain an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node, and a township node;
[0008] Based on the province-prefecture-county-township regional structure tree, multiple administrative nodes are obtained, administrative nodes are extracted from the multiple administrative nodes in sequence, and encoding operations are performed on the extracted administrative nodes to obtain multiple codes to be verified, and the multiple codes to be verified are summarized to obtain a code set to be verified corresponding to the province-prefecture-county-township regional structure tree;
[0009] After confirming that there is no duplicate code to be verified in the code set to be verified, a four-segment code coding model is obtained, wherein the four-segment code coding model includes a plurality of four-segment codes, and the four-segment codes include a first code segment, a second code segment, a third code segment, and a fourth code segment, and the first code segment, the second code segment, the third code segment, and the fourth code segment correspond to a provincial node, a prefecture node, a county node, and a township node, respectively;
[0010] The pre-built material set is delivered based on the four-segment code encoding model and the pre-built express sorting method, and the four-segment code sorting and recognition model of the express order based on the structure tree is completed based on the delivered material set.
[0011] Optionally, the construction of a province-prefecture-county-township regional structure tree based on the administrative region database includes:
[0012] Acquire a first-level data set based on an administrative region database, wherein the first-level data set includes a plurality of first-level data, and the plurality of first-level data are: a plurality of province data, a plurality of autonomous region data, a plurality of municipalities data, and a plurality of special administrative region data;
[0013] Extract first-level data from the first-level data set in sequence, and perform the following operations on the extracted first-level data:
[0014] Based on the first-level data, a first text name is obtained, and based on the first text name, a second-level data set is obtained, wherein the second-level data set includes a plurality of second-level data, and the plurality of second-level data are: a plurality of prefecture-level city data, a plurality of region data, a plurality of autonomous prefecture data, and a plurality of league data;
[0015] Extracting second-level data from the second-level data set in sequence, and constructing a province-region branch based on the extracted second-level data and the first-level data;
[0016] Based on the extracted second-level data, a third-level data set is obtained; based on the third-level data set and the extracted second-level data, a plurality of prefecture-county branches are constructed; a fourth-level data set corresponding to each of the plurality of prefecture-county branches is obtained; and a plurality of fourth-level data sets are obtained;
[0017] Based on multiple fourth-level data sets, multiple prefecture-county branches and province-prefecture branches corresponding to the multiple fourth-level data sets, multiple township-level branches are constructed, and based on the multiple township-level branches, a province-prefecture-county-township regional structure tree is obtained.
[0018] Optionally, the constructing of multiple township-level branches based on multiple fourth-level data sets and multiple prefecture-county branches and province-prefecture branches corresponding to the multiple fourth-level data sets includes:
[0019] Extract the fourth-level data sets from multiple fourth-level data sets in sequence, identify the prefecture-county branches corresponding to the fourth-level data sets, and perform the following operations on the prefecture-county branches:
[0020] Based on the prefecture-county branch and the fourth-level data set, multiple county-township branches are constructed, and the following operations are performed on multiple county-township branches:
[0021] Get the branch county node corresponding to the county-township branch, use the branch county node as the preset connection point, connect the county-township branch and the prefecture-county branch to obtain the prefecture-county-township branch, get the branch ground node in the prefecture-county-township branch, use the branch ground node as the connection point, connect the province-prefecture branch and the prefecture-county-township branch to obtain the township branch;
[0022] Aggregate the township-level branches to obtain multiple township-level branches.
[0023] Optionally, constructing a province-region branch based on the extracted second-level data and the first-level data includes:
[0024] Taking the extracted first-level data as the parent node and the extracted second-level data as the child node, and after identifying the parent node as the provincial node and the child node as the ground node, construct the optimized provincial-ground branches, use the provincial node and the ground node as the key, and the preset blank value as the value, construct the provincial code key-value pair and the ground code key-value pair, use the provincial code key-value pair and the ground code key-value pair to fill the optimized provincial-ground branches, and obtain the provincial-ground branches.
[0025] Optionally, the extracting administrative nodes from the plurality of administrative nodes in sequence, performing encoding operations on the extracted administrative nodes, obtaining a plurality of codes to be verified, summarizing the plurality of codes to be verified, and obtaining a set of codes to be verified corresponding to the province-prefecture-county-township regional structure tree, including:
[0026] Administrative nodes are extracted from multiple administrative nodes in sequence to obtain target nodes, and the following operations are performed on the extracted target nodes:
[0027] Acquire a target coding structure based on the target node, wherein the target coding structure includes one or more target coding types, and the target coding type is: digital coding, letter coding or text coding;
[0028] Extract the target encoding type from the target encoding structure in sequence, and perform encoding operation on the target node based on the target encoding type to obtain an encoding string, and fill the encoding string into the blank value of the encoding key-value pair corresponding to the target node to obtain the code to be verified;
[0029] Summarize the codes to be verified and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree.
[0030] Optionally, acquiring a target coding structure based on a target node includes:
[0031] Identify the node type of the target node, wherein the node type includes: provincial node, prefecture node, county node and township node;
[0032] If the node type is a provincial node, the target coding structure is confirmed as a preset first coding structure, wherein the first coding structure sequentially includes: first text data, first digital data and first letter data;
[0033] If the node type is a ground node, the target coding structure is confirmed as a preset second coding structure, wherein the second coding structure includes in sequence: the second coding structure includes: second digital data and second letter data;
[0034] If the node type is a county node, the target coding structure is confirmed as a preset third coding structure, wherein the third coding structure sequentially includes: third letter data and third numeric data;
[0035] If the node type is a township node, the target coding structure is confirmed as a preset fourth coding structure, wherein the fourth coding structure includes in sequence: fourth letter data, No. 1 fourth digital data, No. 2 fourth digital data and No. 3 fourth digital data.
[0036] Optionally, extracting target coding types from the target coding structure in sequence, and performing coding operations on target nodes based on the target coding types to obtain a coding string includes:
[0037] If the target coding structure is the first coding structure, extracting the first text data, the first digital data and the first letter data based on the first coding structure, and extracting the target data from the first text data, the first digital data and the first letter data in sequence;
[0038] If the extracted target data is first text data, the target encoding type is confirmed as a text code, and the text name corresponding to the first text data is retrieved from the administrative district database based on the text code to obtain the first text code;
[0039] If the extracted target data is the first digital data, the target code type is confirmed as a digital code, and a first code corresponding to the first digital data is retrieved from the administrative district database based on the digital code to obtain the first digital code;
[0040] If the extracted target data is the first letter data, the target code type is confirmed as the letter code, and the first letter code corresponding to the first letter data is calculated based on the letter code and the pre-constructed letter code calculation formula, wherein the letter code calculation formula is as follows:
[0041] C 1 =SM 3 ([A 1 ]‖B 1 ,len)
[0042] Among them, C 1 Indicates the first letter code, SM 3 (*) indicates a commercial cryptographic hash function, [A 1 ] represents the binary code corresponding to the first character code, A 1 Indicates the first character code, B 1 represents the first numeric code, len represents the limited length of the first letter code, and ‖ represents the concatenation operator;
[0043] A code string is obtained based on the first text code, the first digital code and the first letter code, wherein the code string is calculated as follows:
[0044] Cod 1 =A 1 ‖B 1 ‖C 1
[0045] Among them, Cod 1 Represents an encoded string.
[0046] Optionally, the step of extracting target coding types from the target coding structure in sequence, and performing coding operations on target nodes based on the target coding types to obtain a coded string further includes:
[0047] If the target coding structure is the second coding structure, the second code corresponding to the second digital data is retrieved from the administrative district database to obtain the second digital code, and the second letter code is calculated using the second digital code and the letter code calculation formula, and the coding string corresponding to the second coding structure is calculated based on the second digital code and the second letter code;
[0048] If the target coding structure is the third coding structure, the coding string corresponding to the third coding structure is calculated using the administrative district database and the letter coding calculation formula;
[0049] If the target coding structure is the fourth coding structure, a fourth code is obtained by using the administrative area database, wherein the fourth code includes: a first pair of values, a second pair of values, and a third pair of values;
[0050] Extracting the first pair of values, the second pair of values, and the third pair of values from the fourth code in sequence, and assigning them to the fourth digital data No. 1, the fourth digital data No. 2, and the fourth digital data No. 3, respectively, to obtain 1-fourth digital code, 2-fourth digital code, and 3-fourth digital code, wherein 1-fourth digital code corresponds to the first pair of values, 2-fourth digital code corresponds to the second pair of values, and 3-fourth digital code corresponds to the third pair of values;
[0051] The fourth letter code is calculated based on 1-fourth digital code, 2-fourth digital code and 3-fourth digital code, and the code string corresponding to the fourth code structure is obtained based on the fourth letter code and 1-fourth digital code, 2-fourth digital code and 3-fourth digital code.
[0052] Optionally, the express sorting method based on the four-segment code model and the pre-constructed delivery sorting method delivers a pre-constructed material set, and completes the construction of a four-segment code sorting recognition model for the express order based on the structure tree based on the delivered material set, including:
[0053] Identify the material four-segment code set corresponding to the material set based on the four-segment code model;
[0054] Extract the material four-segment codes from the material four-segment code set in sequence, and perform the following operations on the extracted material four-segment codes:
[0055] Extract the first segment code of the material from the four-segment code of the material, and identify the provincial sorting center corresponding to the first segment code of the material based on the first segment code of the material and the four-segment code coding model;
[0056] Summarize the provincial sorting centers to obtain one or more provincial destinations, divide the material set based on the one or more provincial destinations to obtain one or more provincial distribution material sets, wherein the provincial distribution material sets correspond to the provincial destinations one by one;
[0057] Perform provincial delivery operations on one or more provincial distribution material sets to obtain one or more prefecture-level material sets to be delivered;
[0058] Perform the following operations on one or more prefecture-level material sets to be dispatched:
[0059] Obtain the second segment code of the material according to the prefecture-level material set to be delivered, obtain multiple destinations according to the second segment code of the material, divide the prefecture-level material set to be delivered according to the multiple destinations, obtain one or more local distribution material sets, perform prefecture-level-county-township delivery operations on the one or more local distribution material sets, and complete express sorting of the prefecture-level material set to be delivered;
[0060] After confirming that one or more sets of materials to be delivered at the local level have completed express sorting, the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed.
[0061] To achieve the above object, the present invention also provides a system for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree, comprising:
[0062] A structure tree acquisition module is used to acquire an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node and a township node;
[0063] The module for acquiring the code set to be verified is used to obtain multiple administrative nodes based on the province-prefecture-county-township regional structure tree, extract administrative nodes from the multiple administrative nodes in sequence, perform coding operations on the extracted administrative nodes, obtain multiple codes to be verified, summarize the multiple codes to be verified, and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree;
[0064] A four-segment code encoding model acquisition module, used to obtain a four-segment code encoding model after confirming that there is no repeated code to be verified in the code set to be verified, wherein the four-segment code encoding model includes a plurality of four-segment codes, and the four-segment codes include a first segment code, a second segment code, a third segment code and a fourth segment code, and the first segment code, the second segment code, the third segment code and the fourth segment code correspond to a provincial node, a prefecture node, a county node and a township node respectively;
[0065] The logistics distribution module is used to deliver the pre-built material set based on the four-segment code encoding model and the pre-built express sorting method, and complete the construction of the express order four-segment code sorting and recognition model based on the structure tree based on the delivered material set.
[0066] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0067] A memory storing at least one instruction; and a processor executing the instructions stored in the memory to implement the above-mentioned method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree.
[0068] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the above-mentioned method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree.
[0069] To solve the problem described in the background technology, the present invention obtains an administrative district database, and constructs a province-prefecture-county-township regional structure tree based on the administrative district database. The present invention summarizes the same province nodes, prefecture nodes, county nodes and township nodes in different township-level branches, and summarizes them according to the tree structure according to the hierarchical relationship of the provincial administrative district, prefecture-level administrative district, county-level administrative district and township-level administrative district in the administrative divisions of the People's Republic of China, and finally obtains a province-prefecture-county-township regional structure tree. The embodiment of the present invention encodes the provincial administrative district, prefecture-level administrative district, county-level administrative district and township-level administrative district respectively through a unique encoding method, and obtains a four-segment code encoding model after confirming that there are no repeated codes to be verified in the code set to be verified, wherein the four-segment code encoding model includes multiple four-segment codes, and the four-segment codes include a first segment code, a second segment code, a third segment code and a fourth segment code, and the first segment code, the second segment code, the third segment code and the fourth segment code correspond to the province node, the prefecture node, the county node and the township node respectively. That is to say, the embodiment of the present invention ensures that each code to be verified is unique in the four-segment code model, avoiding the situation where the code read in the logistics transportation process is in two different positions in the actual geographic space, thereby causing the wrong transportation. The present invention dispatches a pre-constructed material set based on the four-segment code model and the pre-constructed express sorting method, and completes the construction of the express order four-segment code sorting recognition model based on the structure tree based on the material set after delivery. Through the sorting method and combined transportation, the four-segment code is used to solve the transportation problem of express sorting, that is, after the one-time sorting is completed, no more transportation is required, thereby improving the efficiency and accuracy of fast sorting, and reducing transportation costs. Therefore, the present invention can use the sorting method and combined transportation to realize that after the one-time sorting is completed, no more transportation is required, thereby improving the efficiency and accuracy of fast sorting, and reducing transportation costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 A schematic diagram of a flow chart of a method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree provided in one embodiment of the present invention;
[0071] Figure 2 A functional module diagram of a system for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree provided in one embodiment of the present invention;
[0072] Figure 3 A schematic diagram of the structure of an electronic device for implementing the method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree provided in one embodiment of the present invention.
[0073] Description of reference numerals:
[0074] 1. Electronic device; 10. Processor; 11. Memory; 12. Bus.
[0075] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0076] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0077] The embodiment of the present application provides a method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree. The execution subject of the method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0078] Reference Figure 1 FIG. 1 is a flow chart of a method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree according to an embodiment of the present invention. In this embodiment, the method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree includes:
[0079] S1. Obtain the administrative district database and construct a province-prefecture-county-township regional structure tree based on the administrative district database.
[0080] The province-prefecture-county-township regional structure tree includes multiple township-level branches, and the multiple township-level branches include four nodes, and the four nodes are: province node, prefecture node, county node and township node.
[0081] It is understandable that the administrative region database is a database constructed based on the administrative divisions of the People's Republic of China. In the embodiment of the present invention, the province node, prefecture node, county node and township node are nodes in the tree structure constructed based on the provincial administrative region, prefecture-level administrative region, county-level administrative region and township-level administrative region set in the administrative divisions of the People's Republic of China. The province-prefecture-county-township regional structure tree is a tree structure constructed based on the provincial administrative region, prefecture-level administrative region, county-level administrative region and township-level administrative region. The township-level branches are the paths extracted from the province-prefecture-county-township regional structure tree with the township as the child node.
[0082] It should be noted that different township-level branches are different in the province-prefecture-county-township regional structure tree, but if different township-level branches have the same province node, the province node corresponding to the different township-level branches is the parent node.
[0083] For example, the existing province-prefecture-county-township regional structure tree is as follows:
[0084]
[0085] Among them, [a 1 Province-b 1 City-c 1 County-d 1 Township] is a township-level branch, including the province node, prefecture node, county node and township node, respectively. 1 Province, b 1 City, c 1 County and 1 Township, 1 Province-b 1 City-c 1 County-e 1 Township] is another township-level branch, 1 Province-b 1 City-c 1 County-d 1 Township 1 Province-b 1 City-c 1 County-e 1 There are the same
a 1 Province-b 1 City-c 1 County], then the same county node corresponding to the two township-level branches is the parent node, and [d 1 Township
【e 1 Township] is the child node, and so on, which will not be repeated here.
[0086] In detail, the province-prefecture-county-township regional structure tree is constructed based on the administrative district database, including:
[0087] Acquire a first-level data set based on an administrative region database, wherein the first-level data set includes a plurality of first-level data, and the plurality of first-level data are: a plurality of province data, a plurality of autonomous region data, a plurality of municipalities data, and a plurality of special administrative region data;
[0088] Extract first-level data from the first-level data set in sequence, and perform the following operations on the extracted first-level data:
[0089] Based on the first-level data, a first text name is obtained, and based on the first text name, a second-level data set is obtained, wherein the second-level data set includes a plurality of second-level data, and the plurality of second-level data are: a plurality of prefecture-level city data, a plurality of region data, a plurality of autonomous prefecture data, and a plurality of league data;
[0090] Extracting second-level data from the second-level data set in sequence, and constructing a province-region branch based on the extracted second-level data and the first-level data;
[0091] Obtain a third - level data set based on the extracted second - level data, construct multiple province - county branches based on the third - level data set and the extracted second - level data, obtain a fourth - level data set corresponding to each province - county branch among the multiple province - county branches, and obtain multiple fourth - level data sets;
[0092] Construct multiple township - level branches based on the multiple fourth - level data sets, the multiple province - county branches corresponding to the multiple fourth - level data sets, and the province - prefecture branches, and obtain a province - prefecture - county - township regional structure tree based on the multiple township - level branches.
[0093] Further, the constructing of the province - prefecture branches based on the extracted second - level data and the first - level data includes:
[0094] Taking the extracted first - level data as the parent node and the extracted second - level data as the child node, and after marking the parent node as the province node and the child node as the prefecture node, construct an optimized province - prefecture branch. Respectively, taking the province node and the prefecture node as keys and a preset blank value as the value, construct a province - code key - value pair and a prefecture - code key - value pair, and use the province - code key - value pair and the prefecture - code key - value pair to fill the optimized province - prefecture branch to obtain the province - prefecture branch.
[0095] In the embodiments of the present invention, the multiple province data, multiple autonomous region data, multiple municipality - directly - under - the - Central - Government data, and multiple special administrative region data are all data corresponding to provincial - level administrative regions in the administrative divisions of the People's Republic of China. Therefore, the multiple province data represent the data corresponding to 23 provinces, the multiple autonomous region data represent the data corresponding to 5 autonomous regions, and so on for the multiple municipality - directly - under - the - Central - Government data and multiple special administrative region data, which will not be elaborated here.
[0096] Further, the first literal name is: the abbreviation of the Chinese name of the provincial - level administrative region corresponding to the first - level data. For example, if the first - level data represents the province data corresponding to Anhui Province, then the first literal name is [Wan]. Specifically, the multiple prefecture - level city data, multiple region data, multiple autonomous prefecture data, and multiple league data are similar to the multiple province data, multiple autonomous region data, multiple municipality - directly - under - the - Central - Government data, and multiple special administrative region data, and are all data corresponding to prefecture - level administrative regions in the administrative divisions of the People's Republic of China, which will not be elaborated in the embodiments of the present invention. Each first - level data represents a provincial - level administrative region, so each first - level data corresponds to a second - level data set.
[0097] Exemplarily, let the provincial data corresponding to the first - level data be a 1 province. Therefore, based on a 1 province, a second - level data set is extracted. Let the second - level data set include two second - level data, which are: b 1 city and b2 City, first extract the second level data b 1 City, based on b 1 City and first-level dataa 1 Province, taking the extracted first-level data as the parent node and the extracted second-level data as the child node, and marking the parent node as the province node and the child node as the ground node, construct the initial province-ground branch [a 1 Province-b 1 City], and so on, you can also construct the initial province-region branch [a 1 Province-b 2 city】.
[0098] It should be noted that the method of constructing provincial code key-value pairs and local code key-value pairs with provincial nodes and local nodes as keys and preset blank values as values is a commonly used method for constructing key-value pairs. Its purpose is to store the four-segment code in the subsequent content of the embodiments of the present invention. For details, please refer to the subsequent embodiments.
[0099] It can be understood that the provincial code key-value pair and the land code key-value pair are the key-value pair corresponding to the provincial node and the key-value pair corresponding to the land node, respectively, and the values in the key-value pair corresponding to the provincial node and the key-value pair corresponding to the land node are both blank values. After the provincial code key-value pair and the land code key-value pair are used to fill the optimized provincial-land branch, the codes corresponding to the provincial node and the codes corresponding to the land node can be stored in the optimized provincial-land branch.
[0100] It should be noted that, in the embodiment of the present invention, all nodes in the province-prefecture-county-township regional structure tree can store codes, and the construction method is the same as the construction method of the province-prefecture branch, which will not be repeated here.
[0101] Further, the method of obtaining the third-level data set based on the extracted second-level data is similar to the method of obtaining the second-level data set based on the first text name, and can achieve the same effect. For example, if the extracted second-level data is b 1 City, then according to b 1 The third-level dataset extracted from the city is b 1 Therefore, the third-level dataset is the data corresponding to the county-level administrative regions in the administrative divisions of the People's Republic of China, which is similar to the first-level and second-level datasets and can achieve the same effect.
[0102] For example, let the second level data be b 1 City, so based on b 1 The city extracted the third-level data set. Assume that the third-level data set includes two third-level data, namely: c 1 County and c 2 County, first extract the third level data c 1County, based on c 1 County and second-level datab 1 Provincial structure - county branches 1 City-c 1 County], and so on, I will not go into details here.
[0103] Specifically, the step of constructing a plurality of township-level branches based on a plurality of fourth-level data sets, a plurality of prefecture-county branches, and a plurality of province-prefecture branches corresponding to the plurality of fourth-level data sets includes:
[0104] Extract the fourth-level data sets from multiple fourth-level data sets in sequence, identify the prefecture-county branches corresponding to the fourth-level data sets, and perform the following operations on the prefecture-county branches:
[0105] Based on the prefecture-county branch and the fourth-level data set, multiple county-township branches are constructed, and the following operations are performed on multiple county-township branches:
[0106] Get the branch county node corresponding to the county-township branch, use the branch county node as the preset connection point, connect the county-township branch and the prefecture-county branch to obtain the prefecture-county-township branch, get the branch ground node in the prefecture-county-township branch, use the branch ground node as the connection point, connect the province-prefecture branch and the prefecture-county-township branch to obtain the township branch;
[0107] Aggregate the township-level branches to obtain multiple township-level branches.
[0108] Specifically, the fourth-level dataset is data corresponding to the township-level administrative regions in the administrative divisions of the People's Republic of China, which is similar to the first-level dataset, the second-level dataset, and the third-level dataset, and can achieve the same effect, and will not be described in detail here.
[0109] For example, if the district-county branch is [b 1 City-c 1 County], and the fourth-level dataset is [d 1 Township】and
d 2 Township], then in the construction of multiple county-township branches based on the prefecture-county branches and the fourth-level data set, the multiple county-township branches constructed are: [c 1 County-d 1 Township
c 1 County-d 2 Township
c 1 County-d 1 Township
c 1 County-d 2 Township] perform the same operation: identify [c 1 County-d 1 Township
c 1County
【c 1 County] Connect county-town branches 1 County-d 1 Township] and prefecture-county branches [b 1 City-c 1 County], get the prefecture-county-township branch [b 1 City-c 1 County-d 1 Township]. Further, the branch node is similar to the branch county node, which is the node corresponding to the second level data in the branch of prefecture-county-township, that is, [b 1 City], therefore, after the above explanation of the embodiment of the present invention, it can be obtained that the township-level branches are [a 1 Province-b 1 City-c 1 County-d 1 Township], I will not go into details here.
[0110] It should be noted that the preset tree structure has been explained in the previous text of this embodiment, and the integration operation is: for different township-level branches, the same provincial nodes, prefectural nodes, county nodes and township nodes are aggregated, and the hierarchical relationship between provincial-level administrative regions, prefectural-level administrative regions, county-level administrative regions and township-level administrative regions in the administrative divisions of the People's Republic of China is aggregated according to the tree structure, and finally a province-prefecture-county-township regional structure tree is obtained as shown in the previous example.
[0111] S2. Acquire multiple administrative nodes based on the province-prefecture-county-township regional structure tree, extract administrative nodes from the multiple administrative nodes in turn, perform encoding operations on the extracted administrative nodes, obtain multiple codes to be verified, summarize the multiple codes to be verified, and obtain a set of codes to be verified corresponding to the province-prefecture-county-township regional structure tree.
[0112] Further, the administrative nodes are extracted from the plurality of administrative nodes in sequence, and encoding operations are performed on the extracted administrative nodes to obtain a plurality of codes to be verified, and the plurality of codes to be verified are summarized to obtain a set of codes to be verified corresponding to the province-prefecture-county-township regional structure tree, including:
[0113] Administrative nodes are extracted from multiple administrative nodes in sequence to obtain target nodes, and the following operations are performed on the extracted target nodes:
[0114] Acquire a target coding structure based on the target node, wherein the target coding structure includes one or more target coding types, and the target coding type is: digital coding, letter coding or text coding;
[0115] Extract the target encoding type from the target encoding structure in sequence, and perform encoding operation on the target node based on the target encoding type to obtain an encoding string, and fill the encoding string into the blank value of the encoding key-value pair corresponding to the target node to obtain the code to be verified;
[0116] Summarize the codes to be verified and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree.
[0117] It can be understood that, for example, the target node is a provincial node, which corresponds to a provincial code key-value pair in the province-prefecture-county-township regional structure tree. Therefore, the process of filling the code string into the blank value of the code key-value pair corresponding to the target node to obtain the code to be verified is to fill the code string into the blank value of the provincial code key-value pair.
[0118] It should be noted that the multiple administrative nodes are a set of all nodes in the province-prefecture-county-township regional structure tree, and each node is taken only once. For example, the province-prefecture-county-township regional structure tree is:
[0119]
[0120] There are two township-level branches in the province-prefecture-county-township regional structure tree. 3 Province-b 3 City-c 3 County-d 3 Township 3 Province-b 3 City-c 3 County-e 3 Township], there are 5 administrative nodes in the province-prefecture-county-township regional structure tree, namely [a 3 Province 3 City】
c 3 County
e 3 Township
d 3 Township
[0121] Furthermore, the target coding structure is the coding structure of the target node, and the target coding structure is different according to the target node. The code to be verified is the code to be verified after encoding the target node.
[0122] Further, the acquiring the target coding structure based on the target node includes:
[0123] Identify the node type of the target node, wherein the node type includes: provincial node, prefecture node, county node and township node;
[0124] If the node type is a provincial node, the target coding structure is confirmed as a preset first coding structure, wherein the first coding structure sequentially includes: first text data, first digital data and first letter data;
[0125] If the node type is a ground node, the target coding structure is confirmed as a preset second coding structure, wherein the second coding structure includes in sequence: the second coding structure includes: second digital data and second letter data;
[0126] If the node type is a county node, the target coding structure is confirmed as a preset third coding structure, wherein the third coding structure sequentially includes: third letter data and third numeric data;
[0127] If the node type is a township node, the target coding structure is confirmed as a preset fourth coding structure, wherein the fourth coding structure includes in sequence: fourth letter data, No. 1 fourth digital data, No. 2 fourth digital data and No. 3 fourth digital data.
[0128] It should be noted that when constructing the province-prefecture-county-township regional structure tree, the types of each administrative node have been clarified and marked. The method for marking the types of each administrative node is consistent with the method of constructing the initial province-prefecture branch after marking the parent node as a province node and the child node as a prefecture node, and the mark can be marked with text. For example, a text mark [province node] is added to the province node. There are many existing technologies that can be implemented, which will not be repeated here. Therefore, the node type of the target node can be identified. In the embodiment of the present invention, each administrative node needs to be encoded according to the node position of the administrative node in the province-prefecture-county-township regional structure tree when it is subsequently encoded. The purpose is to avoid the duplication of the encoding of administrative nodes with the same name. For example, although V Township in S County and V Township in J County are both [V Township], due to the different node positions in the province-prefecture-county-township regional structure tree, the administrative division codes are also different, so the corresponding encoding strings are also different.
[0129] It should be noted that the first text data, the first digital data and the first letter data respectively represent that when the node type is a provincial node, there is one text data, one digital data and one letter data in the first coding structure. The second digital data, the second letter data, the third letter data and the third digital data, the fourth letter data, the 1st fourth digital data, the 2nd fourth digital data and the 3rd fourth digital data are similar to the first text data, the first digital data and the first letter data, and can achieve the same effect, and are not repeated here.
[0130] It can be understood that the fourth digital data No. 1, the fourth digital data No. 2 and the fourth digital data No. 3 represent that there are three digital data in sequence in the fourth coding structure.
[0131] It should also be noted that the first coding structure includes, in sequence: the first text data, the first digital data and the first letter data, which means that in the first coding structure, the first data must be text data, the second data is digital data and the third data is letter data, the second coding structure, the third coding structure and the fourth coding structure are similar, and will not be repeated here.
[0132] Further, the target coding types are sequentially extracted from the target coding structure, and the coding operation is performed on the target node based on the target coding type to obtain the coding string, including:
[0133] If the target coding structure is the first coding structure, extracting the first text data, the first digital data and the first letter data based on the first coding structure, and extracting the target data from the first text data, the first digital data and the first letter data in sequence;
[0134] If the extracted target data is first text data, the target encoding type is confirmed as a text code, and the text name corresponding to the first text data is retrieved from the administrative district database based on the text code to obtain the first text code;
[0135] If the extracted target data is the first digital data, the target code type is confirmed as a digital code, and a first code corresponding to the first digital data is retrieved from the administrative district database based on the digital code to obtain the first digital code;
[0136] If the extracted target data is the first letter data, the target code type is confirmed as the letter code, and the first letter code corresponding to the first letter data is calculated based on the letter code and the pre-constructed letter code calculation formula, wherein the letter code calculation formula is as follows:
[0137] C 1 =SM 3 (A 1 ‖B 1 ,len)
[0138] Among them, C 1 Indicates the first letter code, SM 3 (*) indicates a commercial cryptographic hash function, [A 1 ] represents the binary code corresponding to the first character code, A 1 Indicates the first character code, B 1 represents the first numeric code, len represents the limited length of the first letter code, and ‖ represents the concatenation operator;
[0139] A code string is obtained based on the first text code, the first digital code and the first letter code, wherein the code string is calculated as follows:
[0140] Cod1 =A 1 ‖B 1 ‖C 1
[0141] Among them, Cod 1 Represents an encoded string.
[0142] It should be noted that the target data is data extracted from the first text data, the first digital data and the first letter data, and can be the first text data, the first digital data and the first letter data. The text encoding is a method of encoding based on text. The text in the embodiment of the present invention is in Chinese, but texts of different languages can be used for different countries. For example, for a state F in country m, the name corresponding to state F can be used as the first text data. Although it is not shown in the embodiment of the present invention, the implementation method is the same, so it will not be repeated here. In the embodiment of the present invention, when the target encoding structure is the first encoding structure and the target data is the first text data, it means that the node type is a provincial node, so the name of the provincial administrative district corresponding to the provincial node is retrieved from the administrative district database, and the name of the provincial administrative district corresponding to the provincial node is confirmed as a text name to obtain the first text encoding. For example, if the provincial node is Anhui, the name of the provincial administrative district corresponding to the provincial node retrieved from the administrative district database is [Anhui], then the text name is [Anhui], and the first text encoding is also [Anhui]. Similarly, the digital code is a method of obtaining administrative division codes based on the administrative division database. If the name of the provincial administrative division is [Anhui], the first code is
[34] , and the first digital code is also
[34] . And so on, no further details will be given here.
[0143] Furthermore, the letter code is a method of encoding using a letter code calculation formula and all codes corresponding to the target code structure that are not letter codes. For example, the first code structure includes: first text data, first digital data, and first letter data in sequence. The first letter data is encoded according to the first text code, the first digital code, and the letter code calculation formula corresponding to the first text data and the first digital data.
[0144] It should be noted that there are a variety of existing technologies that can be used to obtain the binary code corresponding to the first text code, for example, using UTF-8 code to convert text into binary, which is not limited in the embodiments of the present invention. Furthermore, the length limit of the first letter code is used to limit the length of the first letter code. If the length limit of the first letter code is 8, the first letter code should have only 8 characters. The method of limiting the length of the first letter code is an existing technology and will not be repeated here.
[0145] Exemplarily, if the first character code is [Wan], the first numeric code is also
[34] , and the first letter code is [5f6a6f1], then the corresponding code string is [Wan-34-5f6a6f1].
[0146] Further, the step of sequentially extracting target code types from the target coding structure and performing coding operations on the target nodes based on the target code types to obtain a code string further includes:
[0147] If the target coding structure is the second coding structure, retrieve the second code corresponding to the second numeric data from the administrative region database to obtain the second numeric code, and calculate the second letter code using the second numeric code and the letter code calculation formula, and calculate the code string corresponding to the second coding structure based on the second numeric code and the second letter code;
[0148] If the target coding structure is the third coding structure, calculate the code string corresponding to the third coding structure using the administrative region database and the letter code calculation formula;
[0149] If the target coding structure is the fourth coding structure, obtain the fourth code from the administrative region database, where the fourth code includes: a first pair of values, a second pair of values, and a third pair of values;
[0150] Sequentially extract the first pair of values, the second pair of values, and the third pair of values from the fourth code, and assign them to the 1st fourth numeric data, the 2nd fourth numeric data, and the 3rd fourth numeric data respectively to obtain the 1-fourth numeric code, the 2-fourth numeric code, and the 3-fourth numeric code, where the 1-fourth numeric code corresponds to the first pair of values, the 2-fourth numeric code corresponds to the second pair of values, and the 3-fourth numeric code corresponds to the third pair of values;
[0151] Calculate the fourth letter code based on the 1-fourth numeric code, the 2-fourth numeric code, and the 3-fourth numeric code, and obtain the code string corresponding to the fourth coding structure based on the fourth letter code and the 1-fourth numeric code, the 2-fourth numeric code, and the 3-fourth numeric code.
[0152] It should be noted that if the target coding structure is the second coding structure, the corresponding target node is the local node, then the method for the second code, the second numeric code, the second letter code, and the code string corresponding to the second coding structure corresponding to the second numeric data is the same as that of the first coding structure, the first code, the first numeric code, the first letter code, and the code string corresponding to the first coding structure, and the same effect can be achieved, which will not be elaborated here.
[0153] Exemplarily, if the target coding structure is the second coding structure, and the corresponding location node is city m, and the administrative division code obtained by city m based on the administrative division database is [340100], then the second digital code is [340100].
[0154] Furthermore, if the target coding structure is the third coding structure, the method of calculating the coding string corresponding to the third coding structure using the administrative area database and the letter coding calculation formula is similar to the method of obtaining the coding string corresponding to the second coding structure, and can achieve the same effect, which will not be repeated here.
[0155] It should also be noted that if the target coding structure is the fourth coding structure, the method of obtaining the fourth code using the administrative district database is to obtain the administrative district code of the target node from the administrative district database. For example, the administrative district code of the target node obtained from the administrative district database is 610526, then the fourth code is 610526, and the first pair of values, the second pair of values and the third pair of values are
[61] ,
[05] and
[26] respectively. The administrative district code of the target node obtained from the administrative district database is 6105263, and the fourth code is still 610526, and the first pair of values, the second pair of values and the third pair of values are still
[61] ,
[05] and
[26] respectively.
[0156] Further, according to the above embodiment, when the first pair of values, the second pair of values and the third pair of values are
[61] ,
[05] and
[26] respectively, then 1-fourth digital code, 2-fourth digital code and 3-fourth digital code are
[61] ,
[05] and
[26] respectively. The method for obtaining the coded string corresponding to the fourth coding structure based on the fourth letter code and 1-fourth digital code, 2-fourth digital code and 3-fourth digital code is similar to the method for obtaining the coded string corresponding to the second coding structure, and can achieve the same effect, which is not repeated here.
[0157] S3. After confirming that there are no repeated codes to be verified in the code set to be verified, a four-segment code coding model is obtained, wherein the four-segment code coding model includes multiple four-segment codes, and the four-segment codes include a first segment code, a second segment code, a third segment code and a fourth segment code, and the first segment code, the second segment code, the third segment code and the fourth segment code correspond to a provincial node, a prefecture node, a county node and a township node respectively.
[0158] It should be noted that the repeated verification codes indicate that the two verification codes are the same. The embodiment of the present invention needs to ensure that each verification code is unique in the four-segment code model. The purpose is to avoid the situation where the codes read in the logistics transportation process are at two different positions in the actual geographic space, thereby causing erroneous transportation. Therefore, the embodiment of the present invention needs to confirm that there are no repeated verification codes in the verification code set.
[0159] Exemplarily, when logistics transportation is required, the corresponding four-segment code can be identified from the four-segment code encoding model. For example, in Y Province, U City, I County, and O Township, Y Province is the provincial node, U City is the local node, I County is the county node, and O Township is the township node. Therefore, Y Province, U City, I County, and O Township correspond to the first segment code, the second segment code, the third segment code, and the fourth segment code respectively. The encoding method of the four-segment code is the encoding string corresponding to the first encoding structure, the encoding string corresponding to the second encoding structure, the encoding string corresponding to the third encoding structure, and the encoding string corresponding to the fourth encoding structure in the embodiment of the present invention, and the encoding string corresponding to the first encoding structure, the encoding string corresponding to the second encoding structure, the encoding string corresponding to the third encoding structure, and the encoding string corresponding to the fourth encoding structure are all stored in the blank value of the encoding key-value pair of the corresponding node.
[0160] S4. Deliver the pre-built material set based on the four-segment code encoding model and the pre-built express sorting method, and complete the construction of the express order four-segment code sorting and recognition model based on the structure tree based on the delivered material set.
[0161] Furthermore, the express sorting method based on the four-segment code model and the pre-constructed delivery method delivers the pre-constructed material set, and completes the construction of the express order four-segment code sorting recognition model based on the structure tree based on the delivered material set, including:
[0162] Identify the material four-segment code set corresponding to the material set based on the four-segment code model;
[0163] Extract the material four-segment codes from the material four-segment code set in sequence, and perform the following operations on the extracted material four-segment codes:
[0164] Extract the first segment code of the material from the four-segment code of the material, and identify the provincial sorting center corresponding to the first segment code of the material based on the first segment code of the material and the four-segment code coding model;
[0165] Summarize the provincial sorting centers to obtain one or more provincial destinations, divide the material set based on the one or more provincial destinations to obtain one or more provincial distribution material sets, wherein the provincial distribution material sets correspond to the provincial destinations one by one;
[0166] Perform provincial delivery operations on one or more provincial distribution material sets to obtain one or more prefecture-level material sets to be delivered;
[0167] Perform the following operations on one or more prefecture-level material sets to be dispatched:
[0168] Obtain the second segment code of the material according to the prefecture-level material set to be delivered, obtain multiple destinations according to the second segment code of the material, divide the prefecture-level material set to be delivered according to the multiple destinations, obtain one or more local distribution material sets, perform prefecture-level-county-township delivery operations on the one or more local distribution material sets, and complete express sorting of the prefecture-level material set to be delivered;
[0169] After confirming that one or more sets of materials to be delivered at the local level have completed express sorting, the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed.
[0170] It should be noted that a material set is a collection of multiple express deliveries that need to be delivered. The material set includes multiple materials, each of which corresponds to a material four-segment code. The embodiment of the present invention delivers the material set based on the material four-segment code.
[0171] Exemplarily, for the sake of convenience, the material four-segment code is simplified in this example, and the material four-segment code is the same as the to-be-verified code described above in the embodiment of the present invention. The material four-segment code sets corresponding to the existing material sets are [11 provinces-12 cities-13 counties-14 townships], [11 provinces-22 cities-23 counties-24 townships], and [11 provinces-22 cities-33 counties-34 townships]. Then, the material four-segment codes in the material four-segment code sets are extracted in turn, and the material first segment code in the material four-segment code is extracted to obtain [11 provinces], [11 provinces], and [11 provinces]. That is, the material sets should all be sent to the provincial sorting center corresponding to [11 provinces]. At this time, there is only one provincial destination, namely [11 provinces]. The provincial distribution material set is a collection of materials that need to be distributed to the provincial destination. At this time, because the material sets are all sent to the provincial sorting center corresponding to [11 provinces], there is only one provincial distribution material set. When the provincial distribution material set is dispatched, when the provincial distribution material set arrives at the provincial destination, it is renamed as the prefectural-level material set to be dispatched. The prefectural-level material set to be dispatched is a set of materials that need to be dispatched according to the second segment code of the material four-segment code. In the above material four-segment code set, the second segment code includes [12 cities], [22 cities] and [22 cities], and the multiple prefectural destinations are [12 cities] and [22 cities], respectively. The prefectural-level material set to be dispatched is divided according to [12 cities] and [22 cities], and multiple prefectural distribution material sets are obtained, namely the first prefectural distribution material set [11 provinces-12 cities-13 counties-14 townships] and the second prefectural distribution material set [11 provinces-22 cities-23 counties-24 townships] and [11 provinces-22 cities-33 counties-34 townships]. The operation of executing the prefecture-level-county-level delivery is: simultaneously performing prefecture-level delivery on the first-place delivery material set and the second-place delivery material set, so that the first-place delivery material set arrives at [12 cities], and the second-place delivery material set arrives at [22 cities], and so on, until the express sorting of the prefecture-level material set to be delivered is completed, that is, the delivery of all materials in the material set is completed.
[0172] It should be noted that the embodiment of the present invention uses a sorting method and combined transportation to solve the transportation problem of express sorting using a four-segment code, that is, no more transportation is required after a one-time sorting is completed, thereby improving express sorting efficiency and accuracy and reducing transportation costs.
[0173] To solve the problem described in the background technology, the present invention obtains an administrative district database, and constructs a province-prefecture-county-township regional structure tree based on the administrative district database. The present invention summarizes the same province nodes, prefecture nodes, county nodes and township nodes in different township-level branches, and summarizes them according to the tree structure according to the hierarchical relationship of the provincial administrative districts, prefecture-level administrative districts, county-level administrative districts and township-level administrative districts in the administrative divisions of the People's Republic of China, and finally obtains a province-prefecture-county-township regional structure tree and a code set to be verified. The embodiment of the present invention encodes the provincial administrative districts, prefecture-level administrative districts, county-level administrative districts and township-level administrative districts respectively through a unique encoding method, and after confirming that there are no repeated codes to be verified in the code set to be verified, a four-segment code encoding model is obtained, wherein the four-segment code encoding model includes multiple four-segment codes, and the four-segment codes include a first segment code, a second segment code, a third segment code and a fourth segment code, and the first segment code, the second segment code, the third segment code and the fourth segment code correspond to the province node, the prefecture node, the county node and the township node respectively. That is to say, the embodiment of the present invention ensures that each code to be verified is unique in the four-segment code model, avoiding the situation where the code read in the logistics transportation process is in two different positions in the actual geographic space, thereby causing the wrong transportation. The present invention dispatches a pre-constructed material set based on the four-segment code model and the pre-constructed express sorting method, and completes the construction of the express order four-segment code sorting recognition model based on the structure tree based on the material set after delivery. Through the sorting method and combined transportation, the four-segment code is used to solve the transportation problem of express sorting, that is, after the one-time sorting is completed, no more transportation is required, thereby improving the efficiency and accuracy of fast sorting, and reducing transportation costs. Therefore, the present invention can use the sorting method and combined transportation to realize that after the one-time sorting is completed, no more transportation is required, thereby improving the efficiency and accuracy of fast sorting, and reducing transportation costs.
[0174] like Figure 2 , which is a functional module diagram of a system for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree provided by an embodiment of the present invention.
[0175] The express delivery bill four-segment code sorting and recognition model construction system 100 based on the structure tree of the present invention can be installed in an electronic device. According to the functions to be implemented, the express delivery bill four-segment code sorting and recognition model construction system 100 based on the structure tree can include a structure tree acquisition module 101, a code set acquisition module 102 to be verified, a four-segment code model acquisition module 103 and a logistics distribution module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0176] The structure tree acquisition module 101 is used to acquire an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node and a township node;
[0177] The code set acquisition module 102 is used to acquire multiple administrative nodes based on the province-prefecture-county-township regional structure tree, extract administrative nodes from the multiple administrative nodes in sequence, perform coding operations on the extracted administrative nodes, obtain multiple codes to be verified, summarize the multiple codes to be verified, and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree;
[0178] The four-segment code encoding model acquisition module 103 is used to obtain a four-segment code encoding model after confirming that there is no repeated code to be verified in the code set to be verified, wherein the four-segment code encoding model includes a plurality of four-segment codes, and the four-segment codes include a first code segment, a second code segment, a third code segment and a fourth code segment, and the first code segment, the second code segment, the third code segment and the fourth code segment correspond to a provincial node, a prefecture node, a county node and a township node respectively;
[0179] The logistics distribution module 104 is used to deliver the pre-built material set based on the four-segment code encoding model and the pre-built express sorting method, and complete the construction of the express order four-segment code sorting recognition model based on the structure tree based on the delivered material set.
[0180] In detail, the modules in the structure tree-based express order four-segment code sorting and recognition model construction system 100 in the embodiment of the present invention are used in the same manner as above. Figure 1 The same technical means are used as the method for constructing the express delivery order four-segment code sorting and recognition model based on the structure tree described in the specification, and can produce the same technical effects, so they will not be repeated here.
[0181] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a method for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree provided by an embodiment of the present invention.
[0182] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a method program for constructing a four-segment code sorting and recognition model for an express delivery order based on a structure tree.
[0183] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 also includes an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the express delivery four-segment code sorting and recognition model construction method program based on the structure tree, but also can be used to temporarily store data that has been output or is to be output.
[0184] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, a method program for constructing a four-segment code sorting and recognition model for an express order based on a structure tree, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
[0185] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0186] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0187] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management system, so that the power management system can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0188] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0189] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0190] The program of the method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, the following can be achieved:
[0191] Obtain an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node, and a township node;
[0192] Based on the province-prefecture-county-township regional structure tree, multiple administrative nodes are obtained, administrative nodes are extracted from the multiple administrative nodes in sequence, and encoding operations are performed on the extracted administrative nodes to obtain multiple codes to be verified, and the multiple codes to be verified are summarized to obtain a code set to be verified corresponding to the province-prefecture-county-township regional structure tree;
[0193] After confirming that there is no duplicate code to be verified in the code set to be verified, a four-segment code coding model is obtained, wherein the four-segment code coding model includes a plurality of four-segment codes, and the four-segment codes include a first code segment, a second code segment, a third code segment, and a fourth code segment, and the first code segment, the second code segment, the third code segment, and the fourth code segment correspond to a provincial node, a prefecture node, a county node, and a township node, respectively;
[0194] The pre-built material set is delivered based on the four-segment code encoding model and the pre-built express sorting method, and the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed based on the delivered material set.
[0195] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0196] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or system that can carry the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0197] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0198] Obtain an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node, and a township node;
[0199] Based on the province-prefecture-county-township regional structure tree, multiple administrative nodes are obtained, administrative nodes are extracted from the multiple administrative nodes in sequence, and encoding operations are performed on the extracted administrative nodes to obtain multiple codes to be verified, and the multiple codes to be verified are summarized to obtain a code set to be verified corresponding to the province-prefecture-county-township regional structure tree;
[0200] After confirming that there is no duplicate code to be verified in the code set to be verified, a four-segment code coding model is obtained, wherein the four-segment code coding model includes a plurality of four-segment codes, and the four-segment codes include a first code segment, a second code segment, a third code segment, and a fourth code segment, and the first code segment, the second code segment, the third code segment, and the fourth code segment correspond to a provincial node, a prefecture node, a county node, and a township node, respectively;
[0201] The pre-built material set is delivered based on the four-segment code encoding model and the pre-built express sorting method, and the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed based on the delivered material set.
[0202] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only illustrative, and actual implementation may have other division methods.
[0203] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0204] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0205] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0206] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree, characterized in that: The method comprises: Obtain an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node, and a township node; Based on the province-prefecture-county-township regional structure tree, multiple administrative nodes are obtained, administrative nodes are extracted from the multiple administrative nodes in sequence, and encoding operations are performed on the extracted administrative nodes to obtain multiple codes to be verified, and the multiple codes to be verified are summarized to obtain a code set to be verified corresponding to the province-prefecture-county-township regional structure tree; After confirming that there is no duplicate code to be verified in the code set to be verified, a four-segment code coding model is obtained, wherein the four-segment code coding model includes a plurality of four-segment codes, and the four-segment codes include a first code segment, a second code segment, a third code segment, and a fourth code segment, and the first code segment, the second code segment, the third code segment, and the fourth code segment correspond to a provincial node, a prefecture node, a county node, and a township node, respectively; The pre-built material set is delivered based on the four-segment code encoding model and the pre-built express sorting method, and the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed based on the delivered material set.
2. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 1, characterized in that: The province-prefecture-county-township regional structure tree constructed based on the administrative district database includes: Acquire a first-level data set based on an administrative region database, wherein the first-level data set includes a plurality of first-level data, and the plurality of first-level data are: a plurality of province data, a plurality of autonomous region data, a plurality of municipalities data, and a plurality of special administrative region data; Extract first-level data from the first-level data set in sequence, and perform the following operations on the extracted first-level data: Based on the first-level data, a first text name is obtained, and based on the first text name, a second-level data set is obtained, wherein the second-level data set includes a plurality of second-level data, and the plurality of second-level data are: a plurality of prefecture-level city data, a plurality of region data, a plurality of autonomous prefecture data, and a plurality of league data; Extracting second-level data from the second-level data set in sequence, and constructing a province-region branch based on the extracted second-level data and the first-level data; Based on the extracted second-level data, a third-level data set is obtained; based on the third-level data set and the extracted second-level data, a plurality of prefecture-county branches are constructed; a fourth-level data set corresponding to each of the plurality of prefecture-county branches is obtained; and a plurality of fourth-level data sets are obtained; Based on multiple fourth-level data sets, multiple prefecture-county branches and province-prefecture branches corresponding to the multiple fourth-level data sets, multiple township-level branches are constructed, and based on the multiple township-level branches, a province-prefecture-county-township regional structure tree is obtained.
3. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 2, characterized in that: The method of constructing a plurality of township-level branches based on a plurality of fourth-level data sets and a plurality of prefecture-county branches and province-prefecture branches corresponding to the plurality of fourth-level data sets includes: Extract the fourth-level data sets from multiple fourth-level data sets in sequence, identify the prefecture-county branches corresponding to the fourth-level data sets, and perform the following operations on the prefecture-county branches: Based on the prefecture-county branch and the fourth-level data set, multiple county-township branches are constructed, and the following operations are performed on multiple county-township branches: Get the branch county node corresponding to the county-township branch, use the branch county node as the preset connection point, connect the county-township branch and the prefecture-county branch to obtain the prefecture-county-township branch, get the branch ground node in the prefecture-county-township branch, use the branch ground node as the connection point, connect the province-prefecture branch and the prefecture-county-township branch to obtain the township branch; Aggregate the township-level branches to obtain multiple township-level branches.
4. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 3, characterized in that: The step of constructing a province-region branch based on the extracted second-level data and the first-level data includes: Taking the extracted first-level data as the parent node and the extracted second-level data as the child node, and after identifying the parent node as the provincial node and the child node as the ground node, construct the optimized provincial-ground branches, use the provincial node and the ground node as the key, and the preset blank value as the value, construct the provincial code key-value pair and the ground code key-value pair, use the provincial code key-value pair and the ground code key-value pair to fill the optimized provincial-ground branches, and obtain the provincial-ground branches.
5. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 4, characterized in that: The method extracts administrative nodes from the plurality of administrative nodes in sequence, performs coding operations on the extracted administrative nodes, obtains a plurality of codes to be verified, summarizes the plurality of codes to be verified, and obtains a set of codes to be verified corresponding to the province-prefecture-county-township regional structure tree, including: Administrative nodes are extracted from multiple administrative nodes in sequence to obtain target nodes, and the following operations are performed on the extracted target nodes: Acquire a target coding structure based on the target node, wherein the target coding structure includes one or more target coding types, and the target coding type is: digital coding, letter coding or text coding; Extract the target encoding type from the target encoding structure in sequence, and perform encoding operation on the target node based on the target encoding type to obtain an encoding string, and fill the encoding string into the blank value of the encoding key-value pair corresponding to the target node to obtain the code to be verified; Summarize the codes to be verified and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree.
6. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 5, characterized in that: The obtaining of the target coding structure based on the target node includes: Identify the node type of the target node, wherein the node type includes: provincial node, prefecture node, county node and township node; If the node type is a provincial node, the target coding structure is confirmed as a preset first coding structure, wherein the first coding structure sequentially includes: first text data, first digital data and first letter data; If the node type is a ground node, the target coding structure is confirmed as a preset second coding structure, wherein the second coding structure includes in sequence: the second coding structure includes: second digital data and second letter data; If the node type is a county node, the target coding structure is confirmed as a preset third coding structure, wherein the third coding structure sequentially includes: third letter data and third numeric data; If the node type is a township node, the target coding structure is confirmed as a preset fourth coding structure, wherein the fourth coding structure includes in sequence: fourth letter data, No. 1 fourth digital data, No. 2 fourth digital data and No. 3 fourth digital data.
7. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 6, characterized in that: The target encoding type is extracted from the target encoding structure in sequence, and encoding operation is performed on the target node based on the target encoding type to obtain an encoding string, including: If the target coding structure is the first coding structure, extracting the first text data, the first digital data and the first letter data based on the first coding structure, and extracting the target data from the first text data, the first digital data and the first letter data in sequence; If the extracted target data is first text data, the target encoding type is confirmed as a text code, and the text name corresponding to the first text data is retrieved from the administrative district database based on the text code to obtain the first text code; If the extracted target data is the first digital data, the target code type is confirmed as a digital code, and a first code corresponding to the first digital data is retrieved from the administrative district database based on the digital code to obtain the first digital code; If the extracted target data is the first letter data, the target code type is confirmed as the letter code, and the first letter code corresponding to the first letter data is calculated based on the letter code and the pre-constructed letter code calculation formula, wherein the letter code calculation formula is as follows: C1=SM3([A1]‖B1,len) Wherein, C1 represents the first letter code, SM3(*) represents a commercial cryptographic hash function, [A1] represents the binary code corresponding to the first letter code, A1 represents the first letter code, B1 represents the first numeric code, len represents the limit length of the first letter code, and ‖ represents the concatenation operator; A code string is obtained based on the first text code, the first digital code and the first letter code, wherein the code string is calculated as follows: Cod1=A1‖B1‖C1 Among them, Cod1 represents the encoding string.
8. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 7, characterized in that: The step of extracting target coding types from the target coding structure in sequence and performing coding operations on the target nodes based on the target coding types to obtain a coding string also includes: If the target coding structure is the second coding structure, the second code corresponding to the second digital data is retrieved from the administrative district database to obtain the second digital code, and the second letter code is calculated using the second digital code and the letter code calculation formula, and the coding string corresponding to the second coding structure is calculated based on the second digital code and the second letter code; If the target coding structure is the third coding structure, the coding string corresponding to the third coding structure is calculated using the administrative district database and the letter coding calculation formula; If the target coding structure is the fourth coding structure, a fourth code is obtained by using the administrative area database, wherein the fourth code includes: a first pair of values, a second pair of values, and a third pair of values; Extracting the first pair of values, the second pair of values, and the third pair of values from the fourth code in sequence, and assigning them to the fourth digital data No. 1, the fourth digital data No. 2, and the fourth digital data No. 3, respectively, to obtain 1-fourth digital code, 2-fourth digital code, and 3-fourth digital code, wherein 1-fourth digital code corresponds to the first pair of values, 2-fourth digital code corresponds to the second pair of values, and 3-fourth digital code corresponds to the third pair of values; The fourth letter code is calculated based on 1-fourth digital code, 2-fourth digital code and 3-fourth digital code, and the code string corresponding to the fourth code structure is obtained based on the fourth letter code and 1-fourth digital code, 2-fourth digital code and 3-fourth digital code.
9. The method for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree as claimed in claim 8, characterized in that: The express sorting method based on the four-segment code encoding model and the pre-constructed delivery sorting method delivers the pre-constructed material set, and completes the construction of the express order four-segment code sorting recognition model based on the structure tree based on the delivered material set, including: Identify the material four-segment code set corresponding to the material set based on the four-segment code model; Extract the material four-segment codes from the material four-segment code set in sequence, and perform the following operations on the extracted material four-segment codes: Extract the first segment code of the material from the four-segment code of the material, and identify the provincial sorting center corresponding to the first segment code of the material based on the first segment code of the material and the four-segment code coding model; Summarize the provincial sorting centers to obtain one or more provincial destinations, divide the material set based on the one or more provincial destinations to obtain one or more provincial distribution material sets, wherein the provincial distribution material sets correspond to the provincial destinations one by one; Perform provincial delivery operations on one or more provincial distribution material sets to obtain one or more prefecture-level material sets to be delivered; Perform the following operations on one or more prefecture-level material sets to be dispatched: Obtain the second segment code of the material according to the prefecture-level material set to be delivered, obtain multiple destinations according to the second segment code of the material, divide the prefecture-level material set to be delivered according to the multiple destinations, obtain one or more local distribution material sets, perform prefecture-level-county-township delivery operations on the one or more local distribution material sets, and complete express sorting of the prefecture-level material set to be delivered; After confirming that one or more sets of materials to be delivered at the local level have completed express sorting, the construction of the express order four-segment code sorting and recognition model based on the structure tree is completed.
10. A system for constructing a four-segment code sorting and recognition model for express delivery orders based on a structure tree, characterized in that: The system comprises: A structure tree acquisition module is used to acquire an administrative district database, and construct a province-prefecture-county-township regional structure tree based on the administrative district database, wherein the province-prefecture-county-township regional structure tree includes a plurality of township-level branches, and the plurality of township-level branches include four nodes, and the four nodes are: a province node, a prefecture node, a county node and a township node; The module for acquiring the code set to be verified is used to obtain multiple administrative nodes based on the province-prefecture-county-township regional structure tree, extract administrative nodes from the multiple administrative nodes in sequence, perform coding operations on the extracted administrative nodes, obtain multiple codes to be verified, summarize the multiple codes to be verified, and obtain the code set to be verified corresponding to the province-prefecture-county-township regional structure tree; A four-segment code encoding model acquisition module, used to obtain a four-segment code encoding model after confirming that there is no repeated code to be verified in the code set to be verified, wherein the four-segment code encoding model includes a plurality of four-segment codes, and the four-segment codes include a first segment code, a second segment code, a third segment code and a fourth segment code, and the first segment code, the second segment code, the third segment code and the fourth segment code correspond to a provincial node, a prefecture node, a county node and a township node respectively; The logistics distribution module is used to deliver the pre-built material set based on the four-segment code encoding model and the pre-built express sorting method, and complete the construction of the express order four-segment code sorting and recognition model based on the structure tree based on the delivered material set.