A method and device for address completion based on double array, and storage medium
By using a double array dictionary tree and address dictionary in the address completion process, the address information is extracted and completed, and the problem of slow address completion speed and low accuracy in the existing technology is solved, and more efficient address information processing is achieved.
Patent Information
- Application Number
- CN202210299119.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-03-25
AI Technical Summary
In the prior art, there are problems of slow matching speed and low accuracy in the completion process of address information in address data.
The address completion method based on double array is adopted, and the matching addresses in the address fragment are extracted by the preset double array dictionary tree, and the address encoding and level are determined using the preset address dictionary, and finally the address to be completed is completed.
It effectively improves the efficiency and accuracy of address information extraction and improves the speed of address completion.
Smart Images

Figure CN114818670B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an address completion method and device based on a double array, a storage medium, and a computer device. Background Art
[0002] We have entered a big data society, and a large amount of data is generated every day, including address data. Complete address data can be widely used in many fields. However, in daily life, address data is often unstructured data, and there are problems such as incomplete address information. Completing the address information in address data is of great significance and role.
[0003] In the prior art, when completing address information in address data, the address data is often first decomposed through hard rules and regular matching to obtain address information, and then the address information is completed. This method often has problems such as slow matching speed and low matching accuracy. Summary of the invention
[0004] In view of this, the present application provides an address completion method and apparatus based on a dual array, a storage medium, and a computer device, which can effectively improve the efficiency and accuracy of address information extraction and increase the speed of address completion.
[0005] According to one aspect of the present application, a double array-based address completion method is provided, comprising:
[0006] Acquire an address fragment, input the address fragment into a preset double-array dictionary tree, and extract a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level, and community level;
[0007] According to a preset address dictionary, determine the address code and the address level corresponding to each of the matching addresses, and determine the address to be completed and the target address code corresponding to the address to be completed based on the address code and the address level corresponding to each of the matching addresses, wherein the preset address dictionary includes the preset address, the address code corresponding to any of the preset addresses, and the address level;
[0008] The address to be completed is completed based on the target address code and the preset address dictionary.
[0009] According to another aspect of the present application, there is provided an address completion device based on a double array, comprising:
[0010] An address extraction module, used for obtaining an address fragment, inputting the address fragment into a preset double-array dictionary tree, and extracting a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level and community level;
[0011] a module for determining an address to be completed, configured to determine the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary, and determine the address to be completed and the target address code corresponding to the address to be completed based on the address code and the address level corresponding to each of the matching addresses, wherein the preset address dictionary includes the preset address, the address code corresponding to any of the preset addresses, and the address level;
[0012] The address completion module is used to complete the address to be completed based on the target address code and the preset address dictionary.
[0013] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned address completion method based on a double array is implemented.
[0014] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned double array-based address completion method when executing the program.
[0015] By means of the above technical scheme, the present application provides a method and device for address completion based on a double array, a storage medium, and a computer device. First, an address fragment can be obtained, and then the obtained address fragment can be input into a preset double array dictionary tree. The preset address included in the preset double array dictionary tree can be used to extract the matching address contained in the address fragment. Here, the preset double array dictionary tree is pre-constructed, and the preset double array dictionary tree may include one or several preset addresses of different address levels, where the address level may be provincial, municipal, district, street, and community. Further, based on the preset address dictionary, the address code corresponding to each matching address is found from the preset address dictionary, and the address level corresponding to each matching address can also be determined. Here, the preset address dictionary may include preset addresses of various address levels, and may also include address codes and address levels corresponding to each preset address. After determining the address code and address level corresponding to each matching address, the address to be completed corresponding to the address fragment can be determined according to the address code and address level corresponding to these matching addresses. In addition, the target address code corresponding to the address to be completed can also be determined. After determining the address to be completed and the target address code, the empty address in the address to be completed can be completed according to the target address code and the preset address dictionary. The embodiment of the present application extracts matching addresses from address fragments according to the preset double array dictionary tree, which can effectively improve the extraction efficiency and extraction accuracy of address information and increase the speed of address completion.
[0016] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A schematic flow chart of a dual array-based address completion method provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of a preset double-array dictionary tree construction process provided in an embodiment of the present application is shown;
[0020] Figure 3 A schematic diagram of a preset double-array dictionary tree construction process provided in an embodiment of the present application is shown;
[0021] Figure 4A schematic diagram of a preset double-array dictionary tree construction process provided in an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of a preset double-array dictionary tree construction process provided in an embodiment of the present application is shown;
[0023] Figure 6 A schematic diagram of a preset double-array dictionary tree construction process provided in an embodiment of the present application is shown;
[0024] Figure 7 A schematic structural diagram of an address completion device based on a double array provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] In this embodiment, a double array-based address completion method is provided, such as Figure 1 As shown, the method includes:
[0027] Step 101, obtaining an address fragment, inputting the address fragment into a preset double-array dictionary tree, and extracting a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level and community level;
[0028] The address completion method based on a double array provided in the embodiment of the present application can be applied to the client side or the server side, and can greatly improve the efficiency of address information extraction and the accuracy of address information matching. First, an address fragment can be obtained, wherein the address fragment can include a part of the address information, for example, the address fragment "My home is in a community 50 meters east of Wanda in Gongshu, Zhejiang", from which it can be determined that the words related to the address information include Zhejiang, Gongshu, and Wanda, where Zhejiang is the province, Gongshu is the district, and Wanda is the name of the square, that is, the address fragment does not include city information, community information, street information, etc. Therefore, after extracting the address information from this address fragment, the address can be further completed. Then, the obtained address fragment can be input into a preset double array dictionary tree, and the matching address contained in the address fragment can be extracted through the preset address included in the preset double array dictionary tree. Here, the preset double array dictionary tree is pre-built, and the preset double array dictionary tree may include one or several preset addresses of different address levels, where the address level may be provincial level, municipal level, such as Zhejiang Province, Hangzhou City, or district level, street level and community level, such as Changning District, Jiru Community, Changning Street, etc. In addition to the above five address levels, it may also include poi level and road level. Among them, poi (point of interesting) refers to a point of interest, that is, any non-geographically meaningful point on the map, such as a store, a bar, a gas station, a hospital, a station, etc. The road level refers to a specific road, such as Zhongshan Road, Jiefang Road, etc. The road level and poi level preset addresses may be obtained by crawling a map crawler. The preset double array dictionary tree may specifically be a double array trie tree. When storing the preset address in the preset double array dictionary tree, it may be stored according to the classic t=base[i]+a, check[t]=i in the double array trie tree. The preset double array dictionary tree includes two arrays, which may be referred to as a first array and a second array. The first array may be a base array, and the second array may be a check array. The array value corresponding to each position in the base array represents a trie node, that is, a state, and the array value corresponding to each position in the check array represents the predecessor state of the state at that position. The positions in the first array and the second array can be represented by i. If base[i] and check[i] are both 0, it means that the position is empty; if check[i] is a negative value, it means that the state can be an end state. The i in the first array represents the subscript of the current state, t represents the subscript of the transfer state, and a represents the numerical value of the input character. In addition, after finding the matching address from the address fragment, in order to avoid duplication in the matching address, the extracted matching address can be further deduplicated.
[0029] Step 102, determining the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary, and determining the address to be completed and the target address code corresponding to the address to be completed based on the address code and the address level corresponding to each of the matching addresses, wherein the preset address dictionary includes the preset address, the address code corresponding to any of the preset addresses, and the address level;
[0030] In this embodiment, the preset address dictionary can be further used as a basis to find the address code corresponding to each matching address from the preset address dictionary, and the address level corresponding to each matching address can also be determined. Since the matching addresses are different, the address codes found are also different. Here, the preset address dictionary can include preset addresses of various address levels, and can also include address codes and address levels corresponding to each preset address. Among them, when the address level does not include the poi level and the road level, the number of digits of the address code can be directly related to the number of address levels, and each address code can include different subcodes, and each subcode corresponds to an address level. For example, the address level can be named 1-5 levels in the order of provincial, municipal, district, street and community levels, that is, the larger the range of the preset address, the higher the corresponding address level. The address code corresponding to each preset address can be 12 digits, wherein the 1st-2nd digits represent the subcode corresponding to the provincial address, the 3rd-4th digits represent the subcode corresponding to the municipal address, the 5th-6th digits represent the subcode corresponding to the district address, the 7th-9th digits represent the subcode corresponding to the street address, and the 10th-12th digits represent the subcode corresponding to the community address. For example, the address code corresponding to "Zhejiang Province" can be 330000000000, and the address code corresponding to "Hangzhou City" can be 330100000000, that is, when the preset address is a provincial address, the address code corresponding to the preset address except the 1st and 2nd digits can be filled with 0, when the preset address is a district address, the address code corresponding to the preset address except the first 6 digits can be filled with 0, and so on. When the address level only includes provincial and municipal levels, the corresponding address code can also include only 4 digits, which is not required here. In addition, when the address level includes the POI level and the road level, since the POI level and the road level themselves do not have corresponding sub-codes, for the POI-level preset address and the road-level preset address, the address codes of the two preset addresses can be the address codes of the corresponding communities. For example, the POI-level preset address is Gongchen Bridge, and the community-level preset address corresponding to Gongchen Bridge is Jiru Community, and the address code of Jiru Community is 330105101123, then the address code corresponding to the POI-level preset address of Gongchen Bridge can also be 330105101123. In addition, the address level corresponding to the POI-level preset address can be level 6, and the address level corresponding to the road-level preset address can be level 7. After determining the address code and address level corresponding to each matching address, the address to be completed corresponding to the address fragment can be determined according to the address code and address level corresponding to these matching addresses.For example, there are three matching addresses extracted, namely Zhejiang Province, Gongshu District, and Jiru Community. The address level corresponding to Zhejiang Province is level 1, and the corresponding address code is 330000000000, the address level corresponding to Gongshu District is level 3, and the corresponding address code is 330105000000, and the address level corresponding to Jiru Community is level 5, and the corresponding address code is 330105101123. By comparing the address codes of the three matching addresses, it can be seen that the subcodes corresponding to the provincial address level in the three address codes are the same, and the subcodes corresponding to the district address level in the address codes corresponding to Gongshu District and Jiru Community are also the same, indicating that there is an inclusion relationship among the three matching addresses. The three matching addresses are sorted from high to low according to the address level. It is found that there are only level 1 addresses, level 3 addresses, and level 5 addresses in the matching addresses, and level 2 addresses and level 4 addresses are missing. Therefore, the addresses to be completed can be obtained as ['Zhejiang', '', 'Gongshu', '', 'Jiruru Community']. In addition, the target address code corresponding to the address to be completed can also be determined. For example, the address code corresponding to the above-mentioned Jiru community can be used as the target address code.
[0031] Step 103: Complete the address to be completed based on the target address code and the preset address dictionary.
[0032] In this embodiment, after the address to be completed and the target address code are determined, the empty address in the address to be completed can be completed according to the target address code and a preset address dictionary.
[0033] By applying the technical solution of this embodiment, first, the address fragment can be obtained, and then the obtained address fragment can be input into the preset double array dictionary tree, and the matching address contained in the address fragment can be extracted from the preset address included in the preset double array dictionary tree. Here, the preset double array dictionary tree is pre-constructed, and the preset double array dictionary tree may include one or several preset addresses of different address levels, where the address level may be provincial, municipal, district, street, and community. Further based on the preset address dictionary, the address code corresponding to each matching address is found from the preset address dictionary, and the address level corresponding to each matching address can also be determined. Here, the preset address dictionary may include preset addresses of various address levels, and may also include address codes and address levels corresponding to each preset address. After determining the address code and address level corresponding to each matching address, the address to be completed corresponding to the address fragment can be determined according to the address code and address level corresponding to these matching addresses. In addition, the target address code corresponding to the address to be completed can also be determined. After determining the address to be completed and the target address code, the empty address in the address to be completed can be completed according to the target address code and the preset address dictionary. The embodiment of the present application extracts matching addresses from address fragments according to a preset dual-array dictionary tree, which can effectively improve the extraction efficiency and accuracy of address information and increase the speed of address completion.
[0034] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another address completion method based on a double array is provided, and the method includes:
[0035] Step 201, acquiring address information, wherein the address information includes the preset address, the address level, and the address code; based on the preset address, determining a synonymous address corresponding to each preset address, updating the preset address based on the synonymous address to obtain an updated preset address, and constructing the preset address dictionary based on the updated preset address, the address level corresponding to each updated preset address, and the address code;
[0036] In this embodiment, the address information can be obtained first. Specifically, the address information of various regions in the country can be obtained by crawling with a crawler based on the regional classification level list of the National Bureau of Statistics website. Here, the address information can include three parts, namely, a preset address, an address level, and an address code. Here, the address level can be provincial, municipal, district, street, and community, or POI and road levels. Then, the synonymous address corresponding to each preset address can be determined based on the preset address in the acquired address information. For example, for the preset address of "Zhejiang Province", its synonymous addresses can include "Zhejiang", "Zhejiang", etc. The address levels and address codes corresponding to the synonymous addresses of "Zhejiang Province" are the same as the address levels and address codes corresponding to the preset address of "Zhejiang Province". For the POI-level preset address of "Tsinghua University", its synonymous addresses can include "Tsinghua", etc. The address levels and address codes corresponding to the synonymous addresses of "Tsinghua" and the preset address of "Tsinghua University" are the same, and the address code of "Tsinghua University" is the same as the address code corresponding to the community where "Tsinghua University" is located. Afterwards, the preset addresses can be updated and expanded using these synonymous addresses to obtain updated preset addresses. After obtaining the updated preset addresses, a preset address dictionary is constructed based on the updated preset addresses, address levels, and address codes.
[0037] Step 202, obtaining all the preset addresses from the preset address dictionary, performing deduplication processing on the words included in the preset addresses to obtain preset target words, and setting an initial value for each of the preset target words;
[0038] In this embodiment, all preset addresses can be obtained from the preset address dictionary, wherein each preset address may include one or more characters, for example, the preset address "Zhejiang" includes the characters "Zhejiang" and "Jiangjiang", and the preset address "Shanghai" includes only the character "Shanghai". After all preset addresses are split into single characters, these single characters can be deduplicated, and repeated single characters among these single characters can be removed, and the single characters remaining after deduplication are used as preset target characters, and an initial value can be set for each preset target character.
[0039] Step 203, based on the initial value and the preset address corresponding to each of the preset target words, construct the preset double array dictionary tree, wherein the preset double array dictionary tree includes a first array and a second array, and the array value corresponding to any position in the second array is used to indicate the position corresponding to the upper state of the preset target word or preset target word combination corresponding to any position;
[0040] In this embodiment, after setting corresponding initial values for each preset target word, a preset double-array trie can be further constructed based on the initial values corresponding to these preset target words and all preset addresses. Specifically, the preset double-array trie can include two arrays, which can be respectively referred to as the first array and the second array. The preset double-array trie can be a double-array trie tree. The first array can be the base array, and the second array can be the check array. When storing, it satisfies t = base[i] + a, check[t] = i, where i in the first array represents the subscript of the current state, t represents the subscript of the transition state, and a represents the numerical value of the input character. The first array and the second array can have the same array length. Each position in the preset double-array trie corresponds to a preset target word or a combination of preset target words. Here, the array value corresponding to each position in the second array is the position corresponding to the upper-level state of the preset target word or combination of preset target words at that position. For example, the preset target word combination "Zhejiang" is composed of the preset target words "Zhe" and "Jiang". For the preset target word combination "Zhejiang", its upper-level state is the preset target word "Zhe". The position corresponding to the preset target word combination "Zhejiang" in the preset double-array trie is the seventh position, and the position corresponding to the preset target word "Zhe" is the fourth position. Then, the array value corresponding to the position of "Zhejiang" in the second array is 4. Another example is that the array value of the first position in the first array can be set to 0. Now, the preset addresses "Zhejiang" and "Jiangsu" are stored in the preset double-array trie respectively. Among them, the preset target words are "Zhe", "Jiang", and "Su", and the initial values of these three preset target words are set to 1, 2, and 3 respectively. First, store "Zhe" in the preset double-array trie. The state of "Zhe" is obtained by (state "empty" + state "Zhe"). Set base[0] = 0, that is, the array value corresponding to the position 0 in the first array (the base array, hereinafter referred to as the first array) is 0. Therefore, t 浙 = base[i] + a = base[0] + 1. Here, a can represent the initial value corresponding to each preset target word. The initial value of "Zhe" is 1. Therefore, a = 1, and t 浙 = 0 + 1 = 1. And check[t 浙 = i. Therefore, check[1] = 0. So, the array value corresponding to the first position in the second array (the check array, hereinafter referred to as the second array) is 0. See Figure 2 for details. Since t represents the subscript of the transition state, the state of "Zhe" corresponds to the first position in the preset double-array trie. Next, the state of "Zhejiang" can be stored in the preset double-array trie. The state of "Zhejiang" is obtained by (state "Zhe" + state "Jiang"). Therefore, t 浙江 = base[i] + a, that is, t 浙江= base[1] + 2 = unknown + 2. Since the state corresponding to the second position in the preset double array dictionary tree is empty, if the state "Zhejiang" is corresponding to the second position in the preset double array dictionary tree, then t 浙江 =2, that is, 2=base[1]+2, so at this time base[1]=0, check[2]=1, so the array value corresponding to the first position in the first array is 0, and the array value corresponding to the second position in the second array is 1, see Figure 3 After that, the state "Jiang" can be stored in the preset double array dictionary tree. The state "Jiang" is equivalent to (state "empty" + state "Jiang"), so t 江 =base[i]+a, which is t 江 = base[0] + 2 = 0 + 2 = 2, so the state "Jiang" corresponds to the second position in the preset double array dictionary tree, but the previous state "Zhejiang" has already corresponded to the second position in the preset double array dictionary tree, so there is a conflict. At this time, the state "Zhejiang" can be corresponded to the maximum position in the preset double array dictionary tree. In the embodiment of the present application, it is assumed that the maximum position is 7, then t 浙江 =7=base[1]+2, so base[1]=5, check[7]=1, that is to say, the state "Zhejiang" corresponds to the seventh position in the preset double array dictionary tree, the array value corresponding to the first position in the first array is modified to 5, and the array value corresponding to the seventh position in the second array is 1. The state "Jiang" corresponds to the second position in the preset double array dictionary tree, and the array value corresponding to the second position in the second array is check[2]=0, see details Figure 4 Finally, the state "Jiangsu" can be stored in the preset double array dictionary tree. The state "Jiangsu" is equivalent to (state "Jiangsu" + state "Su"), so t 江苏 =base[i]+a, which is t 江苏 = base[2] + 3 = unknown + 3. Since the state corresponding to the third position in the preset double array dictionary tree is empty, if the state "Jiangsu" is corresponding to the third position in the preset double array dictionary tree, then t 江苏 =3, that is, 3=base[2]+3, so at this time base[2]=0, check[3]=2, so the array value corresponding to the third position in the first array is 0, and the array value corresponding to the third position in the second array is 2. For details, see Figure 5 By analogy, all preset addresses are stored in the preset double array dictionary tree. It should be noted that when each preset address is stored, the array value at the corresponding position in the second array can be a negative value. Figure 6 .
[0041] Step 204, obtaining an address fragment, inputting the address fragment into the preset double array dictionary tree, and determining a target word contained in the address fragment from the preset target word, wherein the preset double array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level and community level;
[0042] In this embodiment, an address fragment is obtained and input into a preset double-array dictionary tree, and the address fragment is matched with a preset target word in the preset double-array dictionary tree to find the target word included in the preset fragment. Here, the preset double-array dictionary tree may include a preset address of one address level, or may include preset addresses of multiple address levels, and the address level may be a provincial address, a municipal address, a district address, a street address, a community address, etc., and may also include a poi-level address, a road-level address, etc.
[0043] Step 205, determining the position of any target word in the address segment, and determining the next adjacent word of the target word, and judging whether the next adjacent word belongs to the preset target word;
[0044] In this embodiment, after determining the target word included in the address segment, the position of each target word in the address segment is determined respectively, and then the next adjacent word corresponding to each target word is determined. For example, the address segment is "My home is in a community 50 meters east of Wanda in Gongshu, Zhejiang", and the first target word is "Zhejiang". After determining the position of "Zhejiang" in the address segment, it can be determined that the next adjacent word is "Jiang". Then, it can be determined whether the next adjacent word is included in the preset target word. If the next adjacent word of the target word belongs to the preset target word, then it means that the target word combination composed of the target word and the next adjacent word of the target word may belong to the preset address. If the next adjacent word of the target word does not belong to the preset target word, then it means that the target word combination composed of the target word and the next adjacent word of the target word definitely does not belong to the preset address.
[0045] Step 206, when the next adjacent word belongs to the preset target word, based on the target position corresponding to the target word in the preset double array dictionary tree, determine the array value corresponding to the first array at the target position, calculate a first sum value between the array value corresponding to the first array at the target position and the initial value corresponding to the next adjacent word, and extract the matching address contained in the address fragment based on the first sum value;
[0046] In this embodiment, when the next adjacent word of the target word belongs to the preset target word, it can be further verified whether the previous state corresponding to the target word combination consisting of the target word and the next adjacent word of the target word is the target word based on the target position of the target word in the preset double array dictionary tree, so as to verify whether the target word combination belongs to the preset address. When constructing the preset double array dictionary tree, the previous state in the target word combination is set to the target word combination or the target word except the last target word in the target word combination. For example, the target word combination can be "Lianyungang", then the previous state of "Lianyungang" is "Lianyun"; the target word combination can be "Lianyun", then the previous state of "Lianyun" is "Lian". Since the array value at the position corresponding to the target word or target word combination in the second array is the position corresponding to the previous state of the target word or target word combination when constructing the preset double-array dictionary tree, when verifying whether the target word combination composed of the target word and the next adjacent word belongs to the preset address, first determine the target position of the target word in the preset double-array dictionary tree, and the array value corresponding to the first array at the target position, calculate the first sum value between the array value corresponding to the first array at the target position and the initial value corresponding to the next adjacent word, and then extract the matching address from the address fragment according to the first sum value.
[0047] Step 207, when the next adjacent word does not belong to the preset target word, based on the target position corresponding to the target word in the preset double array dictionary tree, determine whether the array value corresponding to the second array at the target position is a negative value, and when the result is yes, use the target word as the matching address;
[0048] In this embodiment, if the next adjacent word of the target word does not belong to the preset target word, then the target position of the target word in the preset double array dictionary tree can be further used as the basis to determine whether the array value in the second array at the target position is a negative value. If it is a negative value, it means that the target word is a complete preset address. At this time, the target word can be output as a matching address. If it is not a negative value, it means that the target word is not a preset address and is directly discarded.
[0049] Step 208, determining the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary; comparing the address codes corresponding to any two of the matching addresses to determine the matching addresses that have a containment relationship in the comparison result, sorting the matching addresses that have a containment relationship shown in the comparison result from high to low according to the address levels to obtain a first address to be completed; determining a second address to be completed based on the matching addresses that do not have the containment relationship; performing confidence calculation on the first address to be completed and the second address to be completed to determine the address to be completed, and taking the address code corresponding to the matching address with the lowest address level among the addresses to be completed as the target address code;
[0050] In this embodiment, the address code and address level corresponding to each matching address can be determined based on the preset address dictionary. Then, the inclusion relationship among these matching addresses can be determined according to the address code corresponding to each matching address. Specifically, the address codes corresponding to these matching addresses can be compared with each other. If there is an inclusion relationship between two matching addresses, then the same subcode must exist in the address codes corresponding to the two matching addresses. Here, each matching address can be composed of subcodes corresponding to different address levels. For example: the address code is a 12-bit code, which includes 6 subcodes. The 1st and 2nd bits belong to the subcodes corresponding to the provincial address, the 3rd and 4th bits belong to the subcodes corresponding to the municipal address, the 5th and 6th bits belong to the subcodes corresponding to the district address, the 7th and 9th bits belong to the subcodes corresponding to the street address, and the 10th and 12th bits belong to the subcodes corresponding to the community address. The matching addresses are "Zhejiang" and "Gongshu" respectively. Since "Gongshu" belongs to the district address under the jurisdiction of "Zhejiang", the subcodes corresponding to the 1st and 2nd bits in the address codes corresponding to "Gongshu" and "Zhejiang" are the same. If the comparison results show that there is an inclusion relationship between some matching addresses, then the matching addresses with an inclusion relationship will be sorted from high to low according to the address level, and then the first address to be completed will be obtained. The matching addresses with higher address levels contain a larger address range. For example, after comparison, it is found that there is an inclusion relationship between the three matching addresses "Zhejiang", "Gongshu", and "Jiru Community", and the address level corresponding to "Zhejiang" is "1", the address level corresponding to "Gongshu" is "3", and the address level corresponding to "Jiru Community" is "5", then the first address to be completed can be ["Zhejiang", "", "Gongshu", "", "Jiru Community"]. In addition to the matching addresses with an inclusion relationship, the second address to be completed is determined based on the remaining matching addresses that do not have an inclusion relationship with other matching addresses. For example, in addition to "Zhejiang", "Gongshu" and "Ji Ru Community", the matching address also includes "Wanghua Community". The address level corresponding to "Wanghua Community" is "5", and the address code corresponding to "Wanghua Community" is different from the other matching addresses starting from the sub-code corresponding to the provincial address. Therefore, the second address to be completed can be determined based on "Wanghua Community", and the second address to be completed can be ["","","","","","Wanghua Community"]. In addition, after comparing the address codes of the matching addresses, one or more first addresses to be completed and one or more second addresses to be completed can be determined. Afterwards, the confidence of the first address to be completed and the second address to be completed can be calculated, and finally the address to be completed can be determined. There are many ways to calculate the confidence. The commonly used method is to reversely sort the number of empty data in the content after the first address to be completed and the second address to be completed. If there is a possibility of location coding, it will also be taken into account in the confidence.After determining the address to be completed, the target address code corresponding to the address to be completed can be further determined. Specifically, the address code corresponding to the matching address with the lowest address level can be found from the address levels corresponding to all matching addresses included in the address to be completed, and the address code can be used as the target address code.
[0051] Step 209, determining an empty address in the address to be completed; determining the target address corresponding to the target address code based on the target address code and the preset address dictionary, and completing the empty address in the address to be completed based on the target address.
[0052] In this embodiment, after determining the address to be completed, the empty address in the address to be completed can be further determined. For example, the address to be completed is ["Zhejiang", "", "Gongshu", "", "Ji Ru Community"], where both the municipal address and the street address are empty addresses. Next, the municipal address and the street address are determined from the preset address dictionary according to the target address code. Here, the municipal address and the street address can be referred to as the target address, and then the address to be completed is completed according to the target address, that is, the empty address in the address to be completed is completed according to the municipal address and the street address, so as to obtain a complete address. Specifically, when it is determined that the empty address in the address to be completed is a municipal address and a street-level address, first, for the municipal address, all the sub-codes after the municipal address in the target address code can be changed to 0, and then the corresponding municipal address is found according to the adjusted address code. For example, if the target address code is 330105101123 and you want to determine the municipal address, adjust the target address code to 330100000000, and determine the municipal address from the preset address dictionary according to the adjusted address code 330100000000; if you want to determine the street-level address, adjust the target address code to 330105101000, and determine the street-level address from the preset address dictionary according to the adjusted address code 330105101000.
[0053] In the embodiment of the present application, the step of "extracting the matching address included in the address segment based on the first sum value" in step 206 specifically includes: searching for the array value corresponding to the position of the first sum value in the second array; when the array value at the position of the first sum value in the second array is the same as the value corresponding to the target position, combining the target word and the next adjacent word as a target word combination, and determining whether the array value corresponding to the second array at the position of the first sum value is negative; when the result is no, determining the next adjacent word of the target word combination in the address segment, and when the next adjacent word belongs to the preset target word, based on the position of the first sum value corresponding to the target word combination in the preset double-array trie, determining the array value corresponding to the first array at the position of the first sum value, calculating the second sum value between the array value corresponding to the first array at the position of the first sum value and the initial value corresponding to the next adjacent word, searching for the array value corresponding to the position of the second sum value in the second array, when the array value at the position of the second sum value in the second array is the same as the first sum value, updating the target word combination with the target word combination and the next adjacent word, determining whether the array value corresponding to the second array at the position of the second sum value is negative, and when the result is no, returning to the step of determining the next adjacent word of the target word combination in the address segment until the result is no; when the result is yes, taking the target word combination as the matching address.
[0054] In this embodiment, when extracting the matching address from the address segment according to the first sum value, first, the array value corresponding to the position of the first sum value can be determined in the second array. If the array value corresponding to the position of the first sum value in the second array is the same as the value corresponding to the target position, then the target word and the next adjacent word of the target word can be combined as a target word combination. For example, the target position corresponding to the target word "Zhe" in the preset double-array trie is the fifth position, and the initial value corresponding to the next adjacent word "Jiang" is 2. Then the first sum value is the sum between the array value corresponding to the first array at the fifth position value and the initial value 2. Assuming that the array value corresponding to the first array at the fifth position value is 4, then the first sum value is (4 + 2) = 6. Then, determine the array value corresponding to the position of the first sum value in the second array (i.e., the sixth position). If the array value corresponding to the position of the first sum value in the second array is 5, that is, check[6] = 5, then according to the construction principle of the preset double-array trie (when storing, the array value corresponding to a certain position in the second array is the position corresponding to the superior state of the preset target word or preset target word combination at that position), it indicates that the target word and the next adjacent word can be combined as a target word combination, and this target word combination may be a preset address. If the array value corresponding to the position of the first sum value in the second array is not 5, then it indicates that the combination of the target word and the next adjacent word is not a preset address.
[0055] Next, after combining the target word and the next adjacent word as the target word, it can be determined whether the target word combination is a complete preset address. Specifically, it can be determined whether the array value corresponding to the second array at the first sum value position is a negative value. When constructing the preset double array dictionary tree, if the target word or target word combination corresponding to a certain position is a complete preset address, then the array value in the second array at this position is a negative value. Afterwards, if the array value corresponding to the second array at the first sum value position is not a negative value, then the next adjacent word of the target word combination in the address fragment can be further determined, and it is judged again whether the next adjacent word is the preset target word. If the next adjacent word is not the preset target word, it means that the above target word combination is not a preset address, and it is directly discarded and ended. If the next adjacent word is a preset target word, then the array value corresponding to the first array at the first sum position can be determined according to the first sum position corresponding to the target word combination in the preset double array dictionary tree, the second sum between the array value corresponding to the first array at the first sum position and the initial value corresponding to the next adjacent word is calculated, and the array value corresponding to the second sum position is searched in the second array. When the array value at the second sum position in the second array is the same as the first sum, the target word combination can be updated by the target word combination and the next adjacent word. The updated target word combination contains three words. It is determined whether the array value corresponding to the second array at the second sum position is a negative value. When the result is no, the next adjacent word of the target word combination in the address fragment is re-determined, and it is determined whether the next adjacent word is the preset target word. When it is the preset target word, the third sum is calculated... until the array value corresponding to the second array at the calculated sum position is negative, and the final target word combination is output as the matching address.
[0056] In the embodiment of the present application, optionally, the step 208 of "comparing the address codes corresponding to any two of the matching addresses to determine the matching addresses having an inclusion relationship in the comparison result" specifically includes: when the address levels corresponding to any two of the matching addresses are different, determining the higher address level in the address levels corresponding to the any two matching addresses, and respectively determining the sub-code in the address codes corresponding to the any two matching addresses whose address level is not lower than the higher address level, and determining whether the sub-codes are the same by comparison; when the comparison result shows that the sub-codes are the same, determining that the inclusion relationship exists between the any two matching addresses.
[0057] In this embodiment, the address code includes subcodes corresponding to the different address levels. When determining whether there is an inclusion relationship between the matching addresses, the address codes corresponding to the matching addresses can be compared in pairs. Specifically, if the address levels corresponding to the two matching addresses selected from the matching addresses for comparison are different, it means that there may be an inclusion relationship between the two matching addresses. If the corresponding address levels are the same, it means that there cannot be an inclusion relationship between the two matching addresses. When the address levels corresponding to the two arbitrarily selected matching addresses are different, it is determined which address level is higher, and then the subcodes corresponding to the address levels higher than and equal to the higher address level in the address codes corresponding to the two matching addresses can be determined respectively. For example, the address code corresponding to "Zhejiang" is 330000000000, and the address code corresponding to "Gongshu" is 330105000000. The address level corresponding to "Zhejiang" is level 1, and the address level corresponding to "Gongshu" is level 3, so the higher address level is level 1. For the address code corresponding to the matching address "Zhejiang", the sub-code whose address level is not lower than the higher address level is determined, that is, the sub-code corresponding to the 1st to 2nd digits (provincial address) in the address code, which is 33. For the address code corresponding to the matching address "Gongshu", the sub-code whose address level is not lower than the higher address level is determined, that is, the sub-code corresponding to the 1st to 2nd digits (provincial address) in the address code is also 33. Therefore, it can be determined that the two matching addresses "Zhejiang" and "Gongshu" have an inclusion relationship. For another example, the address code corresponding to "Jiru Community" is 330105101123, and the address code corresponding to Xiangfu Street is 330105101000. The address level corresponding to "Jiru Community" is 5, and the address level corresponding to "Xiangfu Street" is 4, so the higher address level is 4. For the address code corresponding to the matching address of "Jiru Community", determine the sub-code whose address level is not lower than the higher address level, that is, the 1st to 9th digits in the address code (the sub-code corresponding to the provincial address, the sub-code corresponding to the municipal address, the sub-code corresponding to the district address, and the sub-code corresponding to the district address). The subcode corresponding to the address, the subcode corresponding to the street-level address) is 330105101. For the address code corresponding to the matching address of "Xiangfu Street", the subcode whose address level is not lower than the higher address level is determined, which is also the 1st to 9th digits in the address code (the subcode corresponding to the provincial address, the subcode corresponding to the municipal address, the subcode corresponding to the district address, and the subcode corresponding to the street-level address), which is also 330105101. Therefore, it can be determined that the two matching addresses of "Ji Ru Community" and "Xiangfu Street" have an inclusion relationship.For another example, the address code corresponding to "Jiru Community" is 330105101123, and the address code corresponding to Changning Street is 310101101000. The address level corresponding to "Jiru Community" is 5, and the address level corresponding to "Changning Street" is 4, so the higher address level is 4. For the address code corresponding to the matching address of "Jiru Community", the sub-code whose address level is not lower than the higher address level is determined, that is, the 1st to 9th digits in the address code (the sub-code corresponding to the provincial address, the sub-code corresponding to the municipal address, and the sub-code corresponding to the district address) The subcode corresponding to the provincial-level address, the subcode corresponding to the street-level address), is 330105101. For the address code corresponding to the matching address of "Changning Street", the subcode whose address level is not lower than the higher address level is determined, which is also the 1st to 9th digits in the address code (the subcode corresponding to the provincial-level address, the subcode corresponding to the municipal-level address, the subcode corresponding to the district-level address, and the subcode corresponding to the street-level address), which is 310101101. These two subcodes are different, so it can be determined that there is no inclusion relationship between the two matching addresses of "Jiru Community" and "Changning Street".
[0058] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides an address completion device based on a double array, such as Figure 7 As shown, the device comprises:
[0059] An address extraction module, used for obtaining an address fragment, inputting the address fragment into a preset double-array dictionary tree, and extracting a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level and community level;
[0060] a module for determining an address to be completed, configured to determine the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary, and determine the address to be completed and the target address code corresponding to the address to be completed based on the address code and the address level corresponding to each of the matching addresses, wherein the preset address dictionary includes the preset address, the address code corresponding to any of the preset addresses, and the address level;
[0061] The address completion module is used to complete the address to be completed based on the target address code and the preset address dictionary.
[0062] Optionally, the device further comprises:
[0063] A deduplication module, used for obtaining all the preset addresses from the preset address dictionary before obtaining the address fragments, deduplicating the words included in the preset addresses to obtain preset target words, and setting an initial value for each of the preset target words;
[0064] A dictionary tree construction module is used to construct the preset double array dictionary tree based on the initial value corresponding to each of the preset target words and the preset address, wherein the preset double array dictionary tree includes a first array and a second array, and the array value corresponding to any position in the second array is used to indicate the position corresponding to the upper state of the preset target word or preset target word combination corresponding to any position.
[0065] Optionally, the address extraction module specifically includes:
[0066] An input unit, used for inputting the address fragment into the preset double array dictionary tree, and determining the target word contained in the address fragment from the preset target word;
[0067] A judging unit, configured to determine a position of any target word in the address segment, determine a next adjacent word of the target word, and judge whether the next adjacent word belongs to the preset target word;
[0068] a calculation unit, configured to, when the next adjacent word belongs to the preset target word, determine, based on a target position corresponding to the target word in the preset double array dictionary tree, an array value corresponding to the first array at the target position, calculate a first sum value between the array value corresponding to the first array at the target position and the initial value corresponding to the next adjacent word, and extract the matching address contained in the address fragment based on the first sum value;
[0069] A matching address determination unit is used to determine whether the array value corresponding to the second array at the target position is a negative value based on the target position corresponding to the target word in the preset double array dictionary tree when the next adjacent word does not belong to the preset target word, and when the result is yes, use the target word as the matching address.
[0070] The computing unit is specifically used for:
[0071] Search the second array for the array value corresponding to the first sum value position; when the array value at the first sum value position in the second array is the same as the value corresponding to the target position, use the target word and the next adjacent word as the target word combination, and determine whether the array value corresponding to the second array at the first sum value position is a negative value; when the result is no, determine the next adjacent word of the target word combination in the address fragment; when the next adjacent word belongs to the preset target word, determine the array value corresponding to the first array at the first sum value position based on the first sum value position corresponding to the target word combination in the preset dual array dictionary tree, and calculate the first sum. A second sum value between the array value corresponding to the first array at the value position and the initial value corresponding to the next adjacent word, searching the array value corresponding to the second sum value position in the second array, when the array value at the second sum value position in the second array is the same as the first sum value, updating the target word combination through the target word combination and the next adjacent word, judging whether the array value corresponding to the second array at the second sum value position is a negative value, and when the result is no, returning to the above step of determining the next adjacent word of the target word combination in the address fragment until the result is no; when the result is yes, taking the target word combination as the matching address.
[0072] Optionally, the device further comprises:
[0073] An address information acquisition module, used for acquiring address information before determining the address code and the address level corresponding to each matching address according to the preset address dictionary, wherein the address information includes the preset address, the address level and the address code;
[0074] The address updating module is used to determine the synonymous address corresponding to each preset address based on the preset address, update the preset address based on the synonymous address to obtain the updated preset address, and construct the preset address dictionary based on the updated preset address, the address level corresponding to each updated preset address, and the address code.
[0075] Optionally, the module for determining the address to be completed specifically includes:
[0076] The first unit is used to compare the address codes corresponding to any two matching addresses, determine the matching addresses that have a containment relationship in the comparison result, and sort the matching addresses that have a containment relationship shown in the comparison result from high to low according to the address level to obtain a first address to be completed;
[0077] A second unit is used to determine a second address to be completed based on the matching address that does not have the inclusion relationship;
[0078] The to-be-completed address determination unit is used to calculate the confidence of the first to-be-completed address and the second to-be-completed address, determine the to-be-completed address, and use the address code corresponding to the matching address with the lowest address level in the to-be-completed address as the target address code.
[0079] Optionally, the address code includes subcodes corresponding to the different address levels one by one; and the first unit is specifically used to:
[0080] When the address levels corresponding to any two of the matching addresses are different, determine the higher address level among the address levels corresponding to the any two matching addresses, and respectively determine the sub-codes in the address codes corresponding to the any two matching addresses whose address levels are not lower than the higher address level, and determine whether the sub-codes are the same by comparison; when the comparison result shows that the sub-codes are the same, determine that the inclusion relationship exists between the any two matching addresses.
[0081] Optionally, the address completion module is specifically used to:
[0082] Determine an empty address in the address to be completed; determine the target address corresponding to the target address code based on the target address code and the preset address dictionary, and complete the empty address in the address to be completed based on the target address.
[0083] It should be noted that for other corresponding descriptions of the functional units involved in the address completion device based on a double array provided in the embodiment of the present application, reference can be made to Figure 1 The corresponding description in the method will not be repeated here.
[0084] Based on the above Figure 1 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 The double array based address completion method shown.
[0085] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0086] Based on the above Figure 1 The method shown, and Figure 7In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 The double array based address completion method shown.
[0087] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0088] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0089] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. First, the address fragment can be obtained, and then the obtained address fragment can be input into the preset double array dictionary tree, and the matching address contained in the address fragment can be extracted from the address fragment by the preset address included in the preset double array dictionary tree. Here, the preset double array dictionary tree is pre-constructed, and the preset double array dictionary tree may include one or several preset addresses of different address levels, where the address level may be provincial, municipal, district, street, and community. Further based on the preset address dictionary, the address code corresponding to each matching address is found from the preset address dictionary, and the address level corresponding to each matching address can also be determined. Here, the preset address dictionary may include preset addresses of various address levels, and may also include address codes and address levels corresponding to each preset address. After determining the address code and address level corresponding to each matching address, the address to be completed corresponding to the address fragment can be determined according to the address code and address level corresponding to these matching addresses. In addition, the target address code corresponding to the address to be completed can also be determined. After determining the address to be completed and the target address code, the empty address in the address to be completed can be completed according to the target address code and the preset address dictionary. The embodiment of the present application extracts matching addresses from address fragments according to the preset double array dictionary tree, which can effectively improve the extraction efficiency and extraction accuracy of address information and increase the speed of address completion.
[0091] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0092] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A method for address completion based on a double array, characterized in that: include: Acquire an address fragment, input the address fragment into a preset double-array dictionary tree, and extract a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level, and community level; Determine the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary, wherein the preset address dictionary includes the preset addresses, the address code and the address level corresponding to any of the preset addresses; Compare the address codes corresponding to any two matching addresses, determine the matching addresses that have a containment relationship in the comparison result, and sort the matching addresses that have a containment relationship shown in the comparison result from high to low according to the address levels to obtain a first address to be completed; Determine a second address to be completed based on the matching address that does not have the inclusion relationship; Calculate the confidence of the first address to be completed and the second address to be completed to determine the address to be completed, and use the address code corresponding to the matching address with the lowest address level in the addresses to be completed as the target address code; The address to be completed is completed based on the target address code and the preset address dictionary.
2. The method according to claim 1, characterized in that Before obtaining the address fragment, the method further includes: Acquire all the preset addresses from the preset address dictionary, perform deduplication processing on the words included in the preset addresses to obtain preset target words, and set an initial value for each of the preset target words; Based on the initial value and the preset address corresponding to each of the preset target words, the preset double array dictionary tree is constructed, wherein the preset double array dictionary tree includes a first array and a second array, and the array value corresponding to any position in the second array is used to indicate the position corresponding to the upper state of the preset target word or preset target word combination corresponding to any position.
3. The method according to claim 2, characterized in that The step of inputting the address fragment into a preset double array dictionary tree and extracting a matching address contained in the address fragment based on a preset address included in the preset double array dictionary tree specifically includes: Inputting the address fragment into the preset double array dictionary tree, and determining the target word contained in the address fragment from the preset target word; Determine the position of any target word in the address segment, determine the next adjacent word of the target word, and judge whether the next adjacent word belongs to the preset target word; When the next adjacent word belongs to the preset target word, based on the target position corresponding to the target word in the preset double array dictionary tree, determining the array value corresponding to the first array at the target position, calculating a first sum value between the array value corresponding to the first array at the target position and the initial value corresponding to the next adjacent word, and extracting the matching address contained in the address fragment based on the first sum value; When the next adjacent word does not belong to the preset target word, based on the target position corresponding to the target word in the preset double array dictionary tree, determining whether the array value corresponding to the second array at the target position is a negative value, and when the result is yes, using the target word as the matching address; The extracting the matching address contained in the address fragment based on the first sum value specifically includes: searching the second array for an array value corresponding to the first sum value position, and when the array value at the first sum value position in the second array is the same as the value corresponding to the target position, combining the target word with the next adjacent word as the target word, and determining whether the array value corresponding to the second array at the first sum value position is a negative value; When the result is no, determine the next adjacent word of the target word combination in the address segment, when the next adjacent word belongs to the preset target word, determine the array value corresponding to the first array at the first sum position based on the first sum position corresponding to the target word combination in the preset double array dictionary tree, calculate the second sum between the array value corresponding to the first array at the first sum position and the initial value corresponding to the next adjacent word, search the second array for the array value corresponding to the second sum position, when the array value at the second sum position in the second array is the same as the first sum, update the target word combination through the target word combination and the next adjacent word, determine whether the array value corresponding to the second array at the second sum position is a negative value, and when the result is no, return to the above step of determining the next adjacent word of the target word combination in the address segment until the result is yes; When the result is yes, the target word combination is used as the matching address.
4. The method according to claim 1, characterized in that Before determining the address code and the address level corresponding to each matching address according to the preset address dictionary, the method further includes: Acquiring address information, wherein the address information includes the preset address, the address level, and the address code; Based on the preset addresses, a synonymous address corresponding to each of the preset addresses is determined, the preset addresses are updated based on the synonymous addresses to obtain updated preset addresses, and the preset address dictionary is constructed based on the updated preset addresses, and the address level and address code corresponding to each of the updated preset addresses.
5. The method according to claim 1, characterized in that The address code includes subcodes corresponding to different address levels one by one; and comparing the address codes corresponding to any two matching addresses to determine the matching addresses having a containment relationship in the comparison result specifically includes: When the address levels corresponding to any two of the matching addresses are different, determining a higher address level among the address levels corresponding to the any two matching addresses, and respectively determining a subcode whose address level is not lower than the higher address level in the address codes corresponding to the any two matching addresses, and determining whether the subcodes are the same by comparison; When the comparison result shows that the subcodes are the same, it is determined that the any two matching addresses have the inclusion relationship.
6. The method according to claim 1, characterized in that The completing the address to be completed based on the target address code and the preset address dictionary specifically includes: Determine an empty address in the address to be completed; Based on the target address code and the preset address dictionary, the target address corresponding to the target address code is determined, and the empty address in the address to be completed is completed based on the target address.
7. An address completion device based on a double array, characterized in that: include: An address extraction module, used for obtaining an address fragment, inputting the address fragment into a preset double-array dictionary tree, and extracting a matching address contained in the address fragment based on a preset address included in the preset double-array dictionary tree, wherein the preset double-array dictionary tree includes the preset address of at least one address level, and the address level includes provincial level, municipal level, district level, street level and community level; The to-be-completed address determination module is used to determine the address code and the address level corresponding to each of the matching addresses according to a preset address dictionary, wherein the preset address dictionary includes the preset address, the address code and the address level corresponding to any of the preset addresses; The first unit is used to compare the address codes corresponding to any two matching addresses, determine the matching addresses that have a containment relationship in the comparison result, and sort the matching addresses that have a containment relationship shown in the comparison result from high to low according to the address levels to obtain a first address to be completed; A second unit is used to determine a second address to be completed based on the matching address that does not have the inclusion relationship; The address to be completed determining unit is used to calculate the confidence of the first address to be completed and the second address to be completed, determine the address to be completed, and use the address code corresponding to the matching address with the lowest address level in the addresses to be completed as the target address code; The address completion module is used to complete the address to be completed based on the target address code and the preset address dictionary.
8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Base address library construction method and system
CN106777300A
Address information standardization method and device, electronic equipment and storage medium
CN112632213A