ADDRESS PROCESSING METHOD, DEVICE, ELECTRONIC EQUIPMENT AND STORAGE MEDIUM
By hierarchically splitting and weight assignment of addresses, combined with hierarchical similarity, the problem of inaccurate address similarity measurement in the existing technology is solved, and more accurate and efficient address similarity measurement is achieved, improving user experience.
Patent Information
- Application Number
- CN202011156879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-26
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2040-10-26
AI Technical Summary
In the prior art, similarity measurement algorithms based on character strings are difficult to ensure the accuracy of address similarity between two addresses, resulting in poor user experience.
The first address and the second address are segmented by the preset address level, and the sub-addresses at each address level are obtained, and the address similarity between the first address and the second address is determined based on the weight and hierarchical similarity of each address level.
Through the contribution of each address hierarchy to the address similarity measure, the hierarchy similarity between sub-addresses at each address hierarchy are fused, and the accuracy of the overall address similarity between two addresses is achieved, improving the user experience.
Smart Images

Figure CN113761089B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to an address processing method, device, electronic device and storage medium. Background Art
[0002] The e-commerce information platform collects a large number of users' (such as merchants and / or customers) addresses. The geographical correlation of their daily behaviors can be analyzed based on the address similarity between the addresses. This geographical correlation can be used as a reference for personalized recommendations and precision marketing.
[0003] Considering that each address is a string, the address similarity between two addresses can be determined based on a string similarity measurement algorithm, such as determining the address similarity between the two addresses based on the cosine distance, Euclidean distance, edit distance, Jaccard distance, etc.
[0004] In the process of implementing the present invention, the inventors found that the prior art has the following technical problems: the accuracy of the address similarity between two addresses measured by the string-based similarity measurement algorithm is difficult to guarantee, and the user experience is poor. Summary of the invention
[0005] The embodiments of the present invention provide an address processing method, device, electronic device and storage medium to achieve the effect of accurately measuring the address similarity between addresses.
[0006] In a first aspect, an embodiment of the present invention provides an address processing method, which may include:
[0007] The first address and the second address are divided based on the preset address hierarchy to obtain the first sub-address of the first address at each address hierarchy and the second sub-address of the second address at each address hierarchy; the weight of each address hierarchy is obtained, and the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy is determined; the address similarity between the first address and the second address is determined according to each weight and each hierarchical similarity corresponding to each weight.
[0008] Optionally, the weight of each address level can be pre-determined by the following steps: for each address level, determine the information entropy of the address level in the address set based on each collected address in the address set; determine a first number of address values under the address level, and determine the sub-weight of the address level in the address set based on the information entropy and the first number; determine the weight of the address level based on the sub-weight of the address level in each address set.
[0009] Optionally, determining the information entropy of the address level in the address set based on each collected address in the address set may include: determining a second quantity of each collected address in the address set, and respectively determining a third quantity of collected addresses corresponding to each address value under the address level in the address set; determining the occurrence probability of each address value based on the second quantity and each third quantity, and determining the information entropy of the address level in the address set based on each occurrence probability.
[0010] Optionally, the above-mentioned address processing method may also include: obtaining each collected address, and dividing each collected address based on the address hierarchy, and obtaining the collected sub-addresses of each collected address under each address hierarchy; for the grouping hierarchy in each address hierarchy, taking the set of collected addresses with the same collected sub-addresses under the grouping hierarchy as the address set.
[0011] Optionally, determining the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy may include: determining the subsequence length of the longest common subsequence between the first sub-address and the second sub-address belonging to the same address hierarchy; determining the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy based on the subsequence length, and the first sequence length of the first sub-address and the second sequence length of the second sub-address belonging to the same address hierarchy.
[0012] Optionally, determining the address similarity between the first address and the second address based on each weight and each level of similarity corresponding to each weight may include: determining the level similarity results of the first address and the second address at each address level based on each level of similarity; determining the address similarity between the first address and the second address based on each weight and each level of similarity corresponding to each weight.
[0013] Optionally, the above-mentioned address processing method may further include: determining the metric similarity between each collected address, constructing an address relationship network according to each metric similarity, and dividing each collected address in the address relationship network into communities.
[0014] Optionally, the address hierarchy includes a standard hierarchy and / or a custom hierarchy, the standard hierarchy includes at least one of a province, a city, a district, a county, a town and a township, and the custom hierarchy may include at least one of a street, a road, a community, a building and a house number.
[0015] In a second aspect, an embodiment of the present invention further provides an address processing device, which may include:
[0016] An address segmentation module, used for segmenting the first address and the second address based on a preset address hierarchy to obtain a first sub-address of the first address at each address hierarchy and a second sub-address of the second address at each address hierarchy;
[0017] A hierarchical similarity determination module, used to obtain the weight of each address hierarchy and determine the hierarchical similarity between a first sub-address and a second sub-address belonging to the same address hierarchy;
[0018] The address similarity determination module is used to determine the address similarity between the first address and the second address according to each weight and each level similarity corresponding to each weight.
[0019] In a third aspect, an embodiment of the present invention further provides an electronic device, which may include:
[0020] one or more processors;
[0021] A memory for storing one or more programs;
[0022] When one or more programs are executed by one or more processors, the one or more processors implement the address processing method provided by any embodiment of the present invention.
[0023] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the address processing method provided by any embodiment of the present invention is implemented.
[0024] The technical solution of the embodiment of the present invention divides the first address and the second address by address hierarchy, and obtains the first sub-address of the first address at each address hierarchy, and the second sub-address of the second address at each address hierarchy; since the contribution of the hierarchical similarity between sub-addresses at different address hierarchies to the address similarity between addresses is different, the weight of each address hierarchy is obtained, and the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy is determined; then, the address similarity between the first address and the second address is determined according to the weights of different address hierarchies and the hierarchical similarities corresponding to each weight. The above technical solution integrates the hierarchical similarity between sub-addresses at each address hierarchy through the contribution of each address hierarchy to the address similarity measurement, thereby achieving the effect of accurately measuring the overall address similarity between two addresses. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of an address processing method in Embodiment 1 of the present invention;
[0026] Figure 2is a flow chart of an address processing method in Embodiment 2 of the present invention;
[0027] Figure 3 is a flow chart of an address processing method in Embodiment 3 of the present invention;
[0028] Figure 4 is a flowchart of an optional example of an address processing method in Embodiment 3 of the present invention;
[0029] Figure 5 is a structural block diagram of an address processing device in Embodiment 4 of the present invention;
[0030] Figure 6 It is a structural schematic diagram of an electronic device in Embodiment 5 of the present invention. DETAILED DESCRIPTION
[0031] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It is also necessary to explain that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0032] Embodiment 1
[0033] Figure 1 It is a flowchart of an address processing method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the address similarity between the first address and the second address is determined, and is particularly applicable to the case where the address similarity between the first address and the second address is determined based on the weights of each address level. The method can be executed by the address processing device provided in the embodiment of the present invention, and the device can be implemented by software and / or hardware, and the device can be integrated in an electronic device.
[0034] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:
[0035] S110 , dividing the first address and the second address based on the preset address levels to obtain first sub-addresses of the first address at each address level and second sub-addresses of the second address at each address level.
[0036] Among them, the address hierarchy is a pre-set reference indicator for dividing the entire address into levels. Exemplarily, the address hierarchy may include a standard hierarchy and / or a custom hierarchy. The standard hierarchy may be an address hierarchy pre-set by relevant departments, such as province, city, district, county, town, township, etc., among which province, city, district (county) and town (township) may be referred to as a four-level standard hierarchy; the custom hierarchy may be a custom address hierarchy, such as a street, road, community, building, house number, lane, school, etc., which may be set according to actual business scenarios.
[0037] The address segmentation process based on the address hierarchy can be understood as the address word segmentation process based on the address hierarchy, and its specific implementation process is related to the actual business scenario. After segmenting the address based on the address hierarchy, multiple sub-addresses can be obtained, and each sub-address can be considered as an address phrase of the address under a certain address hierarchy, that is, there is a one-to-one correspondence between the sub-addresses and the address hierarchy in a certain address, so that there can be a certain address hierarchy correspondence reference when measuring address similarity. In other words, after segmenting the address, each segmentation result can be mapped to the corresponding address hierarchy in turn, so as to obtain segmentation results under different address hierarchies. This process can be called address hierarchy mapping.
[0038] From the above, it can be seen that the first address and the second address are addresses to be compared for address similarity. The address similarity is the similarity between the two addresses. The first address can be divided based on the address hierarchy to obtain the first sub-address of the first address at each address hierarchy; correspondingly, the second address can be divided based on the address hierarchy to obtain the second sub-address of the second address at each address hierarchy.
[0039] S120: Obtain the weight of each address level, and determine the level similarity between the first sub-address and the second sub-address belonging to the same address level.
[0040] Among them, after the address hierarchy mapping, each sub-address is mapped to the corresponding address hierarchy, so that the hierarchical similarity between each sub-address under the same address hierarchy can be determined respectively, and different address hierarchies can correspond to their own hierarchical similarity. At the same time, considering that different address hierarchies have different importance to the address similarity measurement, for example, when each sub-address under the four-level standard hierarchy is the same, each custom hierarchy has different contributions to the address similarity. For example, two addresses have the same street and the same floor. Obviously, compared with the contribution of the floor to the address similarity, the contribution of the street to the address similarity is higher. Therefore, before determining the address similarity between the first address and the second address, the contribution of each address hierarchy to the address similarity can be obtained first, and the contribution can be expressed by a weight.
[0041] It should be noted that, first of all, the address level can be understood as the characteristic dimension of address similarity. For example, province, city, district, and town are different characteristic dimensions. The weight of the address level can be understood as the importance of its corresponding characteristic dimension to address similarity. This importance can be determined based on some feature importance evaluation algorithms, such as the feature importance evaluation algorithm based on information entropy, etc.
[0042] Secondly, the weight of a certain address level may be the same or different in different address sets. The address set may be a set formed by clustering some addresses together based on certain strategies. Usually, the addresses belonging to the same address set have a high degree of address similarity, and the addresses belonging to different address sets have a low degree of address similarity. On this basis, if the weights differ in different address sets, for the weight of a certain address level, the above weight determination process may be to determine the weight of the address level in the address set where the first address and the second address are located, or to first determine the sub-weights of the address level in each address set, and then determine the weight of the address level based on each sub-weight; of course, assuming that the weights do not differ in different address sets, all collected addresses may be taken as an address set, and the weight of the address level in the address set may be taken as the weight of the address level. The collected addresses may be addresses collected by any information platform.
[0043] S130 , determining the address similarity between the first address and the second address according to each weight and each level similarity corresponding to each weight.
[0044] Among them, each weight is the contribution of each address level to the address similarity, and each level similarity is the similarity between each sub-address under each address level. Therefore, there is a corresponding relationship between the weight and the level similarity. According to each weight and each level similarity corresponding to each weight, the address similarity between the first address and the second address can be determined. It should be noted that, on the one hand, since the level similarity is the similarity between sub-addresses, it can be considered as partial similarity; and the address similarity is the similarity between addresses, which can be considered as overall similarity, that is, the overall similarity between the first address and the second address can be determined through the partial similarity and the contribution of each partial similarity to the overall similarity.
[0045] On the other hand, the string-based similarity measurement algorithm in the prior art directly determines the address similarity of the two addresses through a certain distance of the total of the two addresses. It has the problem of inaccurate address similarity measurement caused by factors such as human-filled differences and human-filled non-address-type additional information. This is because these factors have a greater impact on the full text comparison, especially the non-address-type additional information has a greater impact on the full text comparison. For example, the address similarity between addresses consisting of 20 characters and 30 characters is very low. In particular, the above-mentioned human-filled differences may be caused by overlapping administrative divisions, because the same address may belong to different administrative divisions. For example, a street in Chengdu may belong to both the High-tech West District and the Pidu District, which will cause different users to fill in the same address in different administrative divisions according to their own cognitive habits.
[0046] Accordingly, the technical solution described in the embodiment of the present invention maps each sub-address in the address to the corresponding address level. The weight corresponding to the lower level similarity caused by the above factors may be lower. Generally, the more detailed the address level is from the front to the back, the lower its contribution to the overall similarity; and / or, the above factors only affect part of the similarity. When the similarities of each part are merged to obtain the overall similarity, their influence on the overall similarity is small. Even those non-address additional information may not be mapped to any address level during the address mapping process, which will not have any impact on the accuracy of the overall similarity measurement. In other words, the above technical solution achieves the effect of effectively and accurately describing the address similarity between addresses of different lengths and writing differences.
[0047] The technical solution of the embodiment of the present invention divides the first address and the second address by address hierarchy, and obtains the first sub-address of the first address at each address hierarchy, and the second sub-address of the second address at each address hierarchy; since the contribution of the hierarchical similarity between sub-addresses at different address hierarchies to the address similarity between addresses is different, the weight of each address hierarchy is obtained, and the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy is determined; then, the address similarity between the first address and the second address is determined according to the weights of different address hierarchies and the hierarchical similarities corresponding to each weight. The above technical solution integrates the hierarchical similarity between sub-addresses at each address hierarchy through the contribution of each address hierarchy to the address similarity measurement, thereby achieving the effect of accurately measuring the overall address similarity between two addresses.
[0048] On this basis, optionally, before the address is segmented, it can be preprocessed, and the specific implementation process of the preprocessing can be associated with the actual business scenario. Exemplarily, the address filling page already has a four-level standard level format. When the user fills in the address, there may be some default sub-addresses under the custom level in the custom level, and the sub-addresses under the four-level standard level may be filled in repeatedly. At this time, the duplicate content can be deleted, the default content can be filled in, etc.; or, the address filling page may not have a four-level standard level format, which requires the user to fill in completely by himself. Since there is an address code in the address filled in by the user, for example, Beijing is 1 and Fengtai District, Beijing is 12, at this time, the address code and the data in the database can be mapped and completed, such as mapping the identified Fengtai District to 12, and according to 12, it can be determined that the default "city" level address is Beijing 1. As can be seen from the above, the purpose of preprocessing is mainly to process each address as an address in which the sub-addresses under each address level are present and unique, so that the sub-addresses under each address level can be obtained in the subsequent address division process.
[0049] On this basis, optionally, the process of determining the above-mentioned address similarity can be: according to the hierarchical similarity under each address level, respectively determine the hierarchical similarity results of the first address and the second address under each address level, such as mapping the hierarchical similarity to a certain hierarchical similarity interval, and determining the hierarchical similarity result according to the hierarchical similarity interval, and then performing mathematical operations on the hierarchical similarity, and determining the hierarchical similarity result according to the mathematical operation result, and so on; further, according to each weight and each hierarchical similarity result corresponding to each weight, determine the address similarity between the first address and the second address, that is, determine the address similarity between the first address and the second address through the hierarchical similarity result and the contribution of each hierarchical similarity result to the address similarity. For example, the address similarity S between the first address i and the second address j can be determined by the following formula ij :
[0050]
[0051] Among them, δ(l) is the hierarchical similarity result at the lth address level calculated by the following formula, t is the preset threshold, and w l is the weight of the lth address level, and L is the total number of address levels.
[0052]
[0053] An optional technical solution, since the community aggregation between users is mainly reflected in the community aggregation on the address, such as they are all in the same community, the same street, etc., the above-mentioned address processing method may also include: determining the metric similarity between each collected address, constructing an address relationship network according to each metric similarity, and dividing each collected address in the address relationship network into communities. Among them, the process of determining the metric similarity between any two collected addresses is the same as the process of determining the address similarity between the first address and the second address described above, and will not be repeated here. In addition, the above-mentioned address relationship network can be represented by G(E, V), wherein E is an edge and V is a node, each collected address is a node, and there is a connecting line between the two collected addresses. The metric similarity on the connecting line can be used as a connection weight in the address relationship network, and the connection weight can indicate the strength of the correlation between the two collected addresses connected thereto. Furthermore, each collected address in the address relationship network can be divided into communities, such as dividing each collected address into communities based on a community discovery algorithm, so that each collected address with relatively similar connection weights is regarded as a type of community, thereby identifying the community aggregation between users (such as merchants and / or customers). The community discovery algorithm can be a non-overlapping community discovery algorithm, such as fast-Unfolding, LPA, etc. As can be seen from the above, since the community aggregation is obtained through the regional correlation analysis between users, this means that the accurate calculation of address similarity can provide accurate relationship network input for community identification between users.
[0054] Embodiment 2
[0055] Figure 2 It is a flow chart of an address processing method provided in the second embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the weight of each address level is predetermined by the following steps: for each address level, according to each collected address in the address set, determine the information entropy of the address level in the address set; then determine the first number of each address value under the address level, and determine the sub-weight of the address level in the address set according to the information entropy and the first number; determine the weight of the address level according to the sub-weight of the address level in each address set. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0056] See also Figure 2 The method of this embodiment may specifically include the following steps:
[0057] S210 . For each address level, determine the information entropy of the address level in the address set according to each collected address in the address set.
[0058] Among them, the determination process of each address level is the same, and the determination process of any address level in each address level is described here. The address set can be a set consisting of all collected addresses, that is, all collected addresses are regarded as addresses in an address set, and the number of address sets is one. Alternatively, considering that the address similarity measurement process may involve Cartesian product calculation, the amount of calculation is very large. For example, the complexity of address similarity calculation between N collected addresses is (N-1)N / 2. When N is large, the capacity of ordinary computing nodes or engineering timeliness is almost unbearable. Therefore, the collected addresses can be grouped according to a certain grouping logic, and the set consisting of the collected addresses belonging to the same group is used as the address set. At this time, there is a possibility of similarity between the collected addresses belonging to the same group (that is, the addresses within the group), and there is no possibility of similarity between the collected addresses that do not belong to the same group (that is, the addresses between groups), that is, there is no need to calculate the similarity, thereby reducing the amount of calculation of the address similarity measurement.
[0059] On this basis, there are multiple implementation processes for determining the information entropy of the address level in the address set based on the collected addresses in the address set. For example, since there may be multiple address values under each address level, such as the address values under the "city" level may include Beijing, Tianjin, Shanghai, Chengdu, etc., the information entropy can be determined based on the probability of occurrence of each address value in the address level in the address set, and the probability of occurrence of each address value can be determined based on the second number of each collected address in the address set and the third number of each collected address in the address set that contains the address value, that is, the probability of occurrence of the address value can be determined based on the second number and the third number, and then the information entropy of the address level in the address set can be determined based on the probability of occurrence of each address value.
[0060] S220, determining a first quantity of each address value under the address level, determining a sub-weight of the address level in the address set according to the information entropy and the first quantity, and determining a weight of the address level according to the sub-weight of the address level in each address set.
[0061] Among them, the first number is the total number of address values that may appear under the address level. According to the first number and the information entropy, the sub-weight of the address level in the address set can be determined, that is, the sub-weight can be measured according to the uncertainty of the address value under the address level. The greater the uncertainty, the lower the importance of the address level. Furthermore, the weight of the address level can be determined according to the sub-weight of the address level in each address set, such as taking the average value of each sub-weight as the weight. It should be noted that when the number of address sets is one, the sub-weight explained above is the weight, that is, the process of determining the weight of the address level according to the sub-weight of the address level in each address set can be understood as directly using the sub-weight as the weight, that is, this step does not limit the number of address sets.
[0062] In order to better understand the process of determining the weight of a certain address level, the following can be illustrated with a specific example: For example, it is assumed that each collected address is divided into F address sets Each collected address has L address levels. For the i-th address set S in the F address sets i , the second number of collected addresses is N i =|S i |, where || represents the number of elements in the set; S i The third number of collected addresses corresponding to the kth address value at the jth address level is M ijk =|V ijk |, V ijk YesS i The address subset consisting of the collected addresses corresponding to the kth address value under the jth address level in S i The probability of the kth address value appearing is denoted by p ijk =M ijk / N i , the jth address level in the set S i The information entropy in is H ij =-∑ k p ijk log p ijk , that is, the information entropy is related to the occurrence probability of each address value at the jth address level. i Take the address set of Chaoyang District, Beijing as an example. The L address levels may include streets, roads, communities, buildings, house numbers, schools, etc. Taking the weight of the jth address level "road" in the L address levels as an example, the address values under "road" include road 1, road 2 and road 3. The third quantity corresponding to road 1 is M 朝阳.路.1 , the third quantity corresponding to path 2 is M 朝阳.路.2 , and the third number corresponding to road 3 is M 朝阳.路.3, then the occurrence probability of each address value can be calculated based on them, and then the information entropy of the "road" in the address set can be calculated based on these three occurrence probabilities.
[0063] Furthermore, since 0≤H ij ≤log(X ij ), X ij Indicates S i The total number of address values under the jth address level in (i.e., the maximum value that k can take), the weight of the jth address level can be
[0064] w ij =1-H ij / log(X ij )
[0065] Obviously, when the probability of occurrence of each address value is evenly distributed, the information entropy reaches the maximum value log(X ij ), at this time w ij =0, that is, the contribution of this address level to the overall similarity measurement is low; on the contrary, when there is p ijk =1, H ij =0, then w ij =1, that is, the contribution of this address level to the overall similarity measurement is relatively high. Further, in order to comprehensively consider each address set, the w calculated from the F address sets can be ij Take the average to get the weight w of the jth address level applicable to all collected addresses j :
[0066] It should be noted that, since the first address and the second address are both collected addresses, the weights at each address level calculated above are also applicable to the first address and the second address.
[0067] S230: Segment the first address and the second address based on the preset address levels to obtain first sub-addresses of the first address at each address level and second sub-addresses of the second address at each address level.
[0068] S240: Determine the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy, and determine the address similarity between the first address and the second address according to the weights of the address hierarchies and the hierarchical similarities corresponding to the weights.
[0069] The technical solution of the embodiment of the present invention can determine, for each address level, the sub-weight of the address level in the address set based on the information entropy of the address level in the address set and the first number of address values under the address level, and subsequently determine the weight of the address level based on the sub-weight of the address level in different address sets, thereby achieving the effect of accurately evaluating the importance of each address level based on information entropy.
[0070] An optional technical solution, the process of determining each address set can be: obtaining each collected address, and dividing each collected address based on the address level, respectively obtaining the collected sub-addresses of each collected address under each address level; for the grouping level in each address level, the set of collected addresses with the same collected sub-addresses under the grouping level is taken as the address set. The process of obtaining each collected sub-address is the same as the process of obtaining the first sub-address, and the grouping level is the address level used to group each collected address, and the number of the grouping level can be at least one.
[0071] Therefore, a set of collected addresses with the same collected sub-addresses at the grouping level can be used as an address set. For example, the grouping level includes "province", "city" and "district". Suppose a collected address is XX Street, Pidu District, Chengdu City, Sichuan Province, and another collected address is YY Street, Pidu District, Chengdu City, Sichuan Province. Then the collected sub-addresses of these two collected addresses under "province" are both "Sichuan Province", the collected sub-addresses under "city" are both "Chengdu City", and the collected sub-addresses under "district" are both "Pidu District". Both are collected addresses with the same collected sub-addresses at each grouping level, and they can be classified into the same address set.
[0072] In actual applications, the specific selection of grouping levels is related to the actual business scenarios. For example, the four-level standard level and a custom level can be used as grouping levels. The custom level can be streets, roads, buildings, communities, etc. When the custom level is streets, the collected addresses belonging to the same street can be attributed to an address set according to such a grouping level. For another example, since administrative divisions may overlap, the two-level standard level and a custom level can be used as grouping levels. The two-level standard level is "province" and "city", and the custom level can be streets, roads, buildings, communities, etc. This can avoid the situation where the same address cannot be attributed to an address set due to different writing habits due to overlapping administrative divisions. For example, when the custom level is streets, "XX Street, Pidu District, Chengdu City, Sichuan Province" and "XX Street, High-tech Zone, Chengdu City, Sichuan Province" can be attributed to an address set. This is because although different users have different understandings of administrative divisions, streets are fixed.
[0073] Embodiment 3
[0074] Figure 3 It is a flowchart of an address processing method provided in Example 3 of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, determining the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy may specifically include: determining the subsequence length of the longest common subsequence between the first sub-address and the second sub-address belonging to the same address hierarchy; determining the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy according to the subsequence length, and the first sequence length of the first sub-address and the second sequence length of the second sub-address belonging to the same address hierarchy. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0075] See also Figure 3 The method of this embodiment may specifically include the following steps:
[0076] S310: Segment the first address and the second address based on the preset address levels to obtain first sub-addresses of the first address at each address level and second sub-addresses of the second address at each address level.
[0077] S320: Determine the subsequence length of the longest common subsequence between the first subaddress and the second subaddress belonging to the same address level.
[0078] Among them, considering the differences in writing habits of different users, sub-addresses that are essentially the same at the same address level may have different expressions, such as some users like to carry the developer name, while some users do not like to carry the developer name; some users like to carry the primary school, while some users do not like to carry the primary school; some users like to add a "·" in the middle of "Zhongfang Xuefu Haitang" to become "Zhongfang·Xuefu Haitang"; and so on. In order to eliminate this difference, the hierarchical similarity between two sub-addresses can be determined based on the longest common subsequence. The longest common subsequence is the longest common subsequence between the first sub-address and the second sub-address, the common subsequence is the common part between the two, the subsequence length is the length of the longest common subsequence, and the first sub-address and the second sub-address are sub-addresses at the same address level.
[0079] S330: Determine the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address level according to the sub-sequence length, and the first sequence length of the first sub-address and the second sequence length of the second sub-address belonging to the same address level.
[0080] Among them, according to the subsequence length, the first sequence length and the second sequence length, the hierarchical similarity between the two subaddresses under the address level can be obtained. On this basis, optionally, in order to exclude the influence of house numbers, building numbers, English words and other information, in actual applications, information such as numbers, letters and punctuation can be excluded before calculating the hierarchical similarity.
[0081] For example, assuming that the longest common subsequence length of the first subaddress A and the second subaddress B at the jth address level is l, the hierarchical similarity S between A and B is j It can be calculated by the following formula:
[0082]
[0083] Among them, lenA is the length of the first sequence, and lenB is the length of the second sequence. It can be seen that for A and B, the longer the common subsequence, the higher the hierarchical similarity between A and B.
[0084] S340: Obtain the weight of each address level, and determine the address similarity between the first address and the second address according to each weight and the similarity of each level corresponding to each weight.
[0085] The technical solution of the embodiment of the present invention can determine the hierarchical similarity between the first sub-address and the second sub-address at the same address level by determining the subsequence length of the longest common subsequence between the first sub-address and the second sub-address at the same address level, based on the subsequence length, the first sequence length of the first sub-address and the second sequence length of the second sub-address, thereby solving the problem that the accuracy of determining the hierarchical similarity is difficult to ensure due to differences in users' writing habits.
[0086] On this basis, in order to better understand the specific implementation process of the above address processing method, Figure 4 An optional address processing process is illustrated by taking as an example. The community identification process may be: preprocessing each address, segmenting the preprocessing result, mapping each segmentation result to the corresponding address level, grouping each address according to the mapping result, determining the address similarity between any two addresses in the same group, and performing community identification based on the similarity of each address. Among them, the process of determining the address similarity may be: determining the weight of each address level and the level similarity of the two addresses at each address level, and determining the overall address similarity between the two addresses based on each weight and the level similarity corresponding to each weight.
[0087] Embodiment 4
[0088] Figure 5This is a structural block diagram of an address processing device provided in Embodiment 4 of the present invention. The device is used to execute the address processing method provided in any of the above embodiments. The device and the address processing method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the address processing device, please refer to the embodiment of the above address processing method. Figure 5 The device may specifically include: an address segmentation module 410 , a hierarchical similarity determination module 420 and an address similarity determination module 430 .
[0089] The address segmentation module 410 is used to segment the first address and the second address based on the preset address levels to obtain the first sub-address of the first address at each address level and the second sub-address of the second address at each address level.
[0090] A hierarchical similarity determination module 420, configured to obtain the weight of each address hierarchy and determine the hierarchical similarity between a first sub-address and a second sub-address belonging to the same address hierarchy;
[0091] The address similarity determination module 430 is used to determine the address similarity between the first address and the second address according to each weight and each level similarity corresponding to each weight.
[0092] Optionally, on this basis, the device may further include:
[0093] An information entropy determination module is used to determine, for each address level, the information entropy of the address level in the address set based on each collected address in the address set; a sub-weight determination module is used to determine a first quantity of each address value under the address level, and determine the sub-weight of the address level in the address set based on the information entropy and the first quantity; a weight determination module is used to determine the weight of the address level based on the sub-weight of the address level in each address set.
[0094] Optionally, the information entropy determination module can be specifically used to: determine the second number of each collected address in the address set, and determine the third number of collected addresses corresponding to each address value under the address level in the address set; determine the occurrence probability of each address value based on the second number and each third number, and determine the information entropy of the address level in the address set based on each occurrence probability.
[0095] Optionally, based on the above device, the device may further include:
[0096] The collected sub-address obtaining module is used to obtain each collected address and segment each collected address based on the address level to obtain the collected sub-addresses of each collected address under each address level;
[0097] The address set forming module is used for taking, for the grouping level in each address level, a set of collected addresses having the same collected sub-addresses at the grouping level as an address set.
[0098] Optionally, the hierarchical similarity determination module 420 may specifically include:
[0099] A subsequence length determination unit, used to determine the subsequence length of the longest common subsequence between a first subaddress and a second subaddress belonging to the same address level;
[0100] The hierarchical similarity determination unit is used to determine the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy according to the sub-sequence length and the first sequence length of the first sub-address and the second sequence length of the second sub-address belonging to the same address hierarchy.
[0101] Optionally, the address similarity determination module 430 may include:
[0102] A hierarchical similarity result determination unit, used to determine hierarchical similarity results of the first address and the second address at each address level according to the similarity of each level;
[0103] The address similarity determination unit is used to determine the address similarity between the first address and the second address according to each weight and each level of similarity results corresponding to each weight.
[0104] Optionally, based on the above device, the device may further include:
[0105] The community division module is used to determine the metric similarities between the collected addresses, build an address relationship network according to the metric similarities, and divide the collected addresses in the address relationship network into communities.
[0106] Optionally, the address hierarchy includes a standard hierarchy and / or a custom hierarchy, the standard hierarchy includes at least one of province, city, district, county, town and township, and the custom hierarchy includes at least one of street, road, community, building and house number.
[0107] In the address processing device provided by the fourth embodiment of the present invention, the address segmentation module segments the first address and the second address by address hierarchy, and obtains the first sub-address of the first address at each address hierarchy and the second sub-address of the second address at each address hierarchy respectively; since the hierarchical similarity between sub-addresses at different address hierarchies has different contribution to the address similarity between addresses, the hierarchical similarity determination module obtains the weight of each address hierarchy and determines the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy; further, the address similarity determination module determines the address similarity between the first address and the second address according to the weights of different address hierarchies and the hierarchical similarities corresponding to each weight. The above device integrates the hierarchical similarity between sub-addresses at each address hierarchy by the contribution of each address hierarchy to the address similarity measurement, thereby achieving the effect of accurately measuring the overall address similarity between two addresses.
[0108] The address processing device provided in the embodiment of the present invention can execute the address processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0109] It is worth noting that in the embodiment of the above-mentioned address processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0110] Embodiment 5
[0111] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention is shown in FIG. Figure 6 As shown, the electronic device includes a memory 510, a processor 520, an input device 530, and an output device 540. The number of processors 520 in the electronic device can be one or more. Figure 6 A processor 520 is taken as an example; the memory 510, the processor 520, the input device 530 and the output device 540 in the electronic device can be connected via a bus or other means. Figure 6 The connection via bus 550 is taken as an example.
[0112] The memory 510, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the address processing method in the embodiment of the present invention (for example, the address segmentation module 410, the hierarchical similarity determination module 420 and the address similarity determination module 430 in the address processing device). The processor 520 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 510, that is, implements the above-mentioned address processing method.
[0113] The memory 510 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 510 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 510 may further include a memory remotely arranged relative to the processor 520, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] The input device 530 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 540 may include a display device such as a display screen.
[0115] Embodiment 6
[0116] Embodiment 6 of the present invention provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute an address processing method when executed by a computer processor, including:
[0117] The first address and the second address are divided based on the preset address hierarchy to obtain the first sub-address of the first address at each address hierarchy and the second sub-address of the second address at each address hierarchy; the weight of each address hierarchy is obtained, and the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy is determined; the address similarity between the first address and the second address is determined according to each weight and each hierarchical similarity corresponding to each weight.
[0118] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the address processing method provided by any embodiment of the present invention.
[0119] Through the above description of the implementation mode, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation mode. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0120] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. An address processing method, characterized in that: include: For each address value under the address level, determine the probability of occurrence of the address value in the address set according to a third number of collected addresses in the address set that contain the address value and a second number of collected addresses in the address set; Determine the information entropy of the address level in the address set according to the determined occurrence probabilities corresponding to each address value under the address level, and determine the sub-weight of the address level in the address set according to the first number of address values under the address level and the information entropy, wherein the sub-weight represents the uncertainty of the address value under the address level; Determining the weight of the address level according to the sub-weight of the address level in each of the address sets; Based on the preset address levels, the first address and the second address are divided to obtain first sub-addresses of the first address at each address level and second sub-addresses of the second address at each address level; Obtaining the weight of each of the address levels, and determining the level similarity between the first sub-address and the second sub-address belonging to the same address level; The address similarity between the first address and the second address is determined according to the weights and the hierarchical similarities corresponding to the weights.
2. The method according to claim 1, characterized in that Also includes: Acquire each collected address, and segment each collected address based on the address level to obtain the collected sub-addresses of each collected address under each address level; For each grouping level in the address level, a set consisting of the collected addresses having the same collected sub-addresses at the grouping level is used as the address set.
3. The method according to claim 1, characterized in that The determining the hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy includes: Determine the subsequence length of the longest common subsequence between the first sub-address and the second sub-address belonging to the same address level; The hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchy is determined according to the sub-sequence length, and a first sequence length of the first sub-address and a second sequence length of the second sub-address belonging to the same address hierarchy.
4. The method according to claim 1, characterized in that: The determining the address similarity between the first address and the second address according to the weights and the hierarchical similarities corresponding to the weights respectively includes: According to each of the hierarchical similarities, respectively determine hierarchical similarity results of the first address and the second address at each of the address hierarchies; The address similarity between the first address and the second address is determined according to the weights and the hierarchical similarity results respectively corresponding to the weights.
5. The method according to claim 1, characterized in that Also includes: Determine the metric similarity between each collected address, construct an address relationship network according to each metric similarity, and divide each collected address in the address relationship network into communities.
6. The method according to claim 1, characterized in that The address level includes a standard level and / or a custom level, the standard level includes at least one of a province, a city, a district, a county, a town and a township, and the custom level includes at least one of a street, a road, a community, a building and a house number.
7. An address processing device, characterized in that: include: an information entropy determination module, configured to determine, for each address value under the address level, an occurrence probability of the address value in the address set according to a third number of collected addresses containing the address value in the address set and a second number of collected addresses in the address set, so as to determine the information entropy of the address level in the address set according to the determined occurrence probabilities respectively corresponding to the address values under the address level; a sub-weight determination module, configured to determine a sub-weight of the address level in the address set according to a first number of address values at the address level and the information entropy, wherein the sub-weight indicates uncertainty of the address value at the address level; A weight determination module, configured to determine the weight of the address level according to the sub-weights of the address level in each of the address sets; An address segmentation module, used for segmenting the first address and the second address based on the preset address levels, to obtain the first sub-address of the first address at each address level and the second sub-address of the second address at each address level; A hierarchical similarity determination module, configured to obtain a weight of each of the address hierarchies, and determine a hierarchical similarity between the first sub-address and the second sub-address belonging to the same address hierarchical level; The address similarity determination module is used to determine the address similarity between the first address and the second address according to each of the weights and each of the level similarities corresponding to each of the weights.
8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the address processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the address processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Address similarity calculation method and apparatus
CN107239442A
An address similarity measurement method based on hierarchical labeling
CN109684440A