Virtual geographic address generation method and device, electronic equipment and storage medium
By calculating the weighted distance value of the real geographic address and replacing the geographic level text, a virtual address is generated, which solves the data security risk problem of the virtual address being too close to the real address, and achieves the security and rationality of the address.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ZHICHENG SOFTWARE TECH SERVICE CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, virtual addresses are too close to real addresses, leading to data security risks.
By acquiring the latitude and longitude coordinates and address text of multiple real geographic addresses, calculating the weighted distance value, selecting the real geographic address to be replaced that meets the preset requirements, and using its geographic level text to replace the corresponding level of the target real geographic address, a target virtual geographic address is generated.
The generated virtual address is less likely to resemble the real address, effectively avoiding data security risks and ensuring that the address format is reasonable and far removed from the real location.
Smart Images

Figure CN121542447B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and specifically to a method, apparatus, electronic device, and storage medium for generating virtual geographic addresses. Background Technology
[0002] In the development and construction of smart cities, urban planning and development often require the use of detailed addresses and their latitude and longitude coordinates. If real address data is used, it may pose data security risks because real address data implicitly contains information about local population, industries, economy, and transportation. Therefore, development work typically uses virtual address data.
[0003] In existing technologies, virtual addresses are often obtained by obfuscating the real address data. However, current obfuscation methods can easily lead to the output virtual address being too close to the real address, which can still pose data security risks. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for generating virtual geographic addresses, which can improve the data security risks caused by virtual addresses being too close to real addresses in the prior art.
[0005] This application provides a method for generating virtual geographic addresses, the method comprising:
[0006] Multiple real geographic addresses are obtained, each of which includes latitude and longitude coordinates and address text. The address text is text information identifying a geographic location and includes N geographic levels, where N is a positive integer greater than 1. Based on the latitude and longitude coordinates and address text, a weighted distance value is determined between any two real geographic addresses. For a target real geographic address, a replacement real geographic address is obtained from the multiple real geographic addresses whose weighted distance value meets a preset requirement. The target real geographic address is any one of the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is replaced with the text of the i-th geographic level text of the replacement real geographic address to obtain the target virtual geographic address corresponding to the target real geographic address. Here, i is a positive integer less than or equal to N.
[0007] This application provides a virtual geographic address generation device, the device comprising:
[0008] The real address acquisition unit is used to acquire multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information that identifies a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1;
[0009] The weighted distance value unit is used to determine the weighted distance value between any two real geographic addresses among the plurality of real geographic addresses based on latitude and longitude coordinates and address text.
[0010] The replacement unit is used to obtain, for a target real geographic address, a real geographic address whose weighted distance value meets a preset requirement from the plurality of real geographic addresses; wherein, the target real geographic address is any one of the plurality of real geographic addresses;
[0011] The text replacement unit is used to replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, so as to obtain the target virtual geographic address corresponding to the target real geographic address; wherein, i is a positive integer less than or equal to N.
[0012] In one implementation, the text replacement unit includes:
[0013] The i-th level replacement subunit is used to replace the i-th level text of the target real geographic address with the i-th level text of the real geographic address to be replaced;
[0014] The second address acquisition subunit is used to acquire, from the plurality of real geographical addresses, a second real geographical address to be replaced that satisfies the second preset requirement;
[0015] The (i+1)th level replacement subunit is used to replace the (i+1)th level text of the target real geographic address with the (i+1)th level text of the second real geographic address to be replaced.
[0016] The jump rotor unit is used to, when the (i+1)th is less than N, take the second real geographic address to be replaced as the new real geographic address to be replaced, take the (i+1)th as the new ith, and jump to the step: "For the real geographic address to be replaced, from the plurality of real geographic addresses, obtain the second real geographic address to be replaced that satisfies the second preset requirement", until the (i+1)th is equal to N.
[0017] The target address subunit is used to determine the target virtual geographic address when the (i+1)th digit equals N.
[0018] In one implementation, the weighted distance value unit includes:
[0019] The latitude and longitude subunit is used to obtain the first latitude and longitude coordinates of the first real geographic address and the second latitude and longitude coordinates of the second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses among the plurality of real geographic addresses.
[0020] The geographic distance value subunit is used to calculate the geographic distance value between the first real geographic address and the second real geographic address based on the first latitude and longitude coordinates and the second latitude and longitude coordinates;
[0021] The geographic text subunit is used to obtain the first address text of the first real geographic address and the second address text of the second real geographic address;
[0022] A similarity subunit is used to determine the text similarity between the first address text and the second address text;
[0023] The weighted distance value subunit is used to calculate the weighted distance value between the first real geographic address and the second real geographic address based on the geographic distance value and the text similarity.
[0024] In one implementation, the unit to be replaced is specifically used for:
[0025] From the plurality of real geographic addresses, obtain the real geographic address with the largest weighted distance value to the target real geographic address, wherein the real geographic address with the largest weighted distance value to the target real geographic address is the real geographic address to be replaced.
[0026] In one embodiment, the device further includes:
[0027] The address replacement unit is used to take the first M geographic levels of the target real geographic address as the first M geographic levels of the target virtual geographic address, where M is a positive integer less than N.
[0028] In one embodiment, the device further includes:
[0029] Geographic hierarchical unit, used to obtain the first geographic level of the target's real geographic address;
[0030] The initial screening address unit is used to obtain at least one initial screening real geographic address from the plurality of real geographic addresses, wherein the first geographic level of the initial screening real geographic address is the same as the first geographic level of the target real geographic address.
[0031] The initial screening and replacement unit is used to replace the first M geographical levels of the target real geographical address with the first M geographical levels of the at least one initial screening real geographical address to obtain the first M geographical levels of the target virtual geographical address.
[0032] In one embodiment, the device further includes:
[0033] Geographic hierarchical unit, used to obtain the first geographic level of the target's real geographic address;
[0034] Subordinate relationship unit, used to randomly obtain M-1 geographical levels belonging to the first geographical level based on the subordinate relationship of the geographical area corresponding to the first geographical level;
[0035] Subordinate replacement unit is used to determine the M-1 geographic levels and the first geographic level as the first M geographic levels of the target virtual geographic address.
[0036] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the virtual geographic address generation methods provided in this application.
[0037] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in any of the virtual geographic address generation methods provided in this application.
[0038] The virtual geographic address generation method provided in this application embodiment can obtain multiple real geographic addresses, each of which includes latitude and longitude coordinates and address text, with the address text including N geographic levels. Based on the latitude and longitude coordinates and address text, the weighted distance value between any two real geographic addresses among the multiple real geographic addresses is calculated. For any one of the multiple real geographic addresses (let's call it the target real geographic address), a replacement real geographic address whose weighted distance value with the target real geographic address meets a preset requirement can be obtained from the multiple real geographic addresses. Then, the i-th geographic level text of the target real geographic address is replaced with the i-th geographic level text of the replacement real geographic address, thereby obtaining the target virtual geographic address corresponding to the target real geographic address.
[0039] This application embodiment can obtain multiple real geographic addresses and calculate a weighted distance value between any two real geographic addresses based on the latitude and longitude coordinates and address text included in each real geographic address. For a target real geographic address, firstly, obtain the real geographic address to be replaced that meets the preset requirements for the weighted distance value, and then replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address. In this application embodiment, the target virtual geographic address can be generated by filtering out the real geographic addresses to be replaced corresponding to the target real geographic address based on the weighted distance value, and replacing the i-th geographic level text of the former with the i-th geographic level text of the real geographic address to be replaced. Since the calculation of the weighted distance value involves both latitude and longitude coordinates and address text, the weighted distance value can better reflect the distance between any two real geographic addresses, thus making the obtained target virtual geographic address less likely to be close to the target real geographic address, minimizing the occurrence of data security risks. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1a This is a schematic diagram illustrating an application scenario of the virtual geographic address generation method provided in this application;
[0042] Figure 1b This is a flowchart illustrating the virtual geographic address generation method provided in an embodiment of this application;
[0043] Figure 1c A schematic block diagram of the first three levels of the geographic hierarchy in one implementation is shown;
[0044] Figure 1d A schematic diagram of a graph database in one embodiment is shown;
[0045] Figure 2 This is a flowchart illustrating a virtual geographic address generation method provided in another specific embodiment of this application;
[0046] Figure 3 This is a schematic diagram of a virtual geographic address generation device provided in one embodiment of this application;
[0047] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0048] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0049] This application provides a method, apparatus, electronic device, and storage medium for generating virtual geographic addresses.
[0050] Specifically, the virtual geographic address generation device can be integrated into an electronic device, such as a terminal or server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0051] In some embodiments, the virtual geographic address generation device can also be integrated into multiple electronic devices, such as multiple servers, with multiple servers implementing the virtual geographic address generation method of this application.
[0052] In some embodiments, the terminal can also be used as a server to implement some or all of the functions of a server.
[0053] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0054] Please see details Figure 1aThe method provided in this application embodiment may include: obtaining multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information identifying a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1; determining the weighted distance value between any two real geographic addresses among the multiple real geographic addresses based on the latitude and longitude coordinates and address text; for a target real geographic address, obtaining a real geographic address to be replaced from the multiple real geographic addresses whose weighted distance value meets a preset requirement; wherein the target real geographic address is any one of the multiple real geographic addresses; replacing the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced to obtain the target virtual geographic address corresponding to the target real geographic address; wherein i is a positive integer less than or equal to N.
[0055] The above method can filter out the real geographic addresses to be replaced based on the weighted distance value, and then replace the i-th geographic level text of the original real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby generating the target virtual geographic address. Since the calculation of the weighted distance value involves both latitude and longitude coordinates and address text, the weighted distance value can better reflect the distance between any two real geographic addresses, thus making the obtained target virtual geographic address less likely to be close to the target real geographic address, and minimizing the possibility of data security risks.
[0056] The method provided in this application can be applied to fields such as graph models, data structures, and natural language processing.
[0057] It is understood that in the embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent should be explicitly obtained, and the collection, use and processing of related data should comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0058] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0059] In this embodiment, a method for generating virtual geographic addresses is provided, such as... Figure 1b As shown, the specific process of this method may include the following steps 110 to 140:
[0060] 110. Obtain multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information identifying a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1.
[0061] Latitude and longitude coordinates refer to the precise geographical location of the corresponding real geographic address on the Earth's surface, such as (XX°N, YY°E), where XX and YY are specific numbers, and the magnitude of these specific numbers should not be construed as a limitation of this application.
[0062] Address text refers to an address describing a corresponding real geographical address in natural language, such as Unit 203, Community E, District D, City C, Province A. Here, A, B, C, D, and E are specific words, and their specific textual content should not be construed as a limitation on this application, provided that the specific regional division is satisfied. Satisfying the specific regional division means that the attribution relationship between the lower-level address and the higher-level address is accurate. For example, Shenzhen belongs to Guangdong Province; therefore, the appearance of "Shenzhen, Guangdong Province" in the address text satisfies the specific regional division. Shenzhen does not belong to Heilongjiang Province; therefore, the appearance of "Shenzhen, Heilongjiang Province" in the address text is inaccurate.
[0063] Alternatively, in one implementation, N can be set to 6, and the 6 geographic levels can be as follows:
[0064]
[0065] Optionally, in one implementation, the first three levels of the six geographic levels (i.e., the first-level address, second-level address, and third-level address in the table above) can be represented by a tree diagram, such as... Figure 1c As shown.
[0066] 120. Based on latitude and longitude coordinates and address text, determine the weighted distance value between any two real geographical addresses among the plurality of real geographical addresses.
[0067] The weighted distance value reflects both the actual physical distance between the two real geographic addresses on Earth and the degree of similarity in their address descriptions at the semantic level.
[0068] The goal of step 120 is to calculate a weighted distance value for any two real geographic addresses by comprehensively considering both spatial location (i.e., latitude and longitude) and semantic structure (i.e., address text). Step 120 can avoid misjudgments caused by relying solely on latitude and longitude, such as "seemingly far but actually in the same area" or "seemingly close but actually in different cities," thereby more accurately selecting address pairs suitable for virtual replacement.
[0069] Optionally, in one embodiment, step 120 may specifically include the following steps 121 to 125:
[0070] 121. Obtain the first latitude and longitude coordinates of the first real geographic address and the second latitude and longitude coordinates of the second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses among the plurality of real geographic addresses.
[0071] Choose any two real geographic addresses from the multiple obtained addresses; let's call these two addresses the first real geographic address and the second real geographic address. Extract their latitude and longitude coordinates respectively.
[0072] The latitude and longitude of the first real geographical address can be recorded as: ;
[0073] The latitude and longitude of the second real geographical address can be recorded as: .
[0074] 122. Based on the first latitude and longitude coordinates and the second latitude and longitude coordinates, calculate the geographical distance between the first real geographical address and the second real geographical address.
[0075] Using latitude and longitude coordinates, the spherical distance between two points is calculated through geographic distance algorithms. Geographic distance algorithms can include the Haversine Formula, Vincenty's Formula, etc.
[0076] Continuing with the example above, we can substitute the first and second latitude / longitude coordinates into the following formula:
[0077]
[0078] Calculate geographic distance value .
[0079] Where r is the Earth's radius, and the value of r is 6.378137*10^6m.
[0080] Alternatively, in one implementation, after calculating the geographic distance value... Afterwards, normalization can be performed. The specific process of normalization is as follows:
[0081] Select the geographical distance value with the largest value from among multiple geographical distance values; let's denote it as... .
[0082] Divide each geographic distance value by This will give us the normalized result. Let's denote the normalized geographical distance value as... .but .
[0083] 123. Obtain the first address text of the first real geographic address and obtain the second address text of the second real geographic address.
[0084] 124. Determine the text similarity between the first address text and the second address text.
[0085] Text similarity can be represented by cosine similarity or Euclidean distance. It should be understood that the specific method of measuring text similarity should not be construed as a limitation of this application.
[0086] Let's assume the first address text is: "Building F, No. 1012, District C, City B, A".
[0087] The second address text is: "Building Z, Street T, District H, City B, Province A / Room 305".
[0088] In one implementation, the text similarity between the two can be calculated in the following way:
[0089] 1241. Perform Chinese word segmentation on the original text to obtain the corresponding word sequence.
[0090] The original text refers to either the first address text or the second address text.
[0091] Let's take the first address text as an example: "A Province B City C District D Street F Building 1012". The result after word segmentation is: "A Province / B City / C District / D Street / F Building / 1012".
[0092] Taking the second address text as an example: “A Province B City H District T Street Z Building / 305”, the result after word segmentation is: “A Province / B City / H District / T Street / Z Building / 305”.
[0093] In step 1241 above, the Chinese word segmentation process can be specifically implemented using the open-source Python Chinese word segmentation tool jieba.
[0094] 1242. For each word in the word sequence, convert it into a corresponding word vector.
[0095] Optionally, a pre-trained or self-trained Word2Vec model can be used to map each word in a word sequence to a fixed-dimensional real-valued vector. Word2Vec can capture semantic relationships between words, not just literal matching. It is understood that other models, such as the GloVe model, can be used in addition to the Word2Vec model. It should be understood that the specific type of model used should not be construed as a limitation of this application.
[0096] Taking the word sequence "Province A / City B / District C / Street D / Building F / 1012" as an example, City B can be transformed into [0.1, -0.3, ..., 0.8], where the dimension of the aforementioned real number vector can take values such as 100 or 300. It should be understood that the specific range of values for the dimension of the real number vector should not be construed as a limitation on this application.
[0097] Each word in the word sequence is converted into a vector representation of the same dimension to facilitate subsequent mathematical operations.
[0098] 1243. Average the vectors of all words in the same word sequence to obtain the sentence vector.
[0099] The sentence vector is the vector of the address text corresponding to the word sequence.
[0100] Continuing with the example above, let's assume the sentence vector corresponding to the first address text is... The sentence vector corresponding to the second address text is , where n is a fixed dimension value.
[0101] 1244. Calculate the cosine similarity between the sentence vector corresponding to the first address text and the sentence vector corresponding to the second address text, and normalize the cosine similarity to obtain the text similarity.
[0102] Continuing with the example above, the formula for calculating text similarity is as follows:
[0103]
[0104] in, Text similarity; Let be the cosine similarity.
[0105] In the above implementation, by introducing the technical path of jieba word segmentation + Word2Vec word vectors + average sentence vectors + cosine similarity, step 124 achieves an efficient, accurate, and semantically sensitive address text similarity calculation method. This allows the weighted distance value to not only reflect spatial distance but also the linguistic and semantic relevance of address texts, thereby improving the security and rationality of virtual address generation.
[0106] 125. Based on the geographic distance value and the text similarity, calculate the weighted distance value between the first real geographic address and the second real geographic address.
[0107] In step 125, the geographic distance value and text similarity can be fused to obtain a unified weighted distance value. The weighted distance value measures both geographic distance and text similarity, avoiding two special cases: First, the address text similarity is low, but the actual geographic distance is relatively close, which usually occurs at the boundary of administrative divisions, such as "No. 23, XXX Road, Shenzhen, Guangdong Province" and "XXX Business Department, XXX Road, XXX District, Hong Kong Special Administrative Region"; Second, the address text is relatively similar, but the actual physical distance is far, which usually occurs in common place names, such as "Nanjing Road, Shanghai" and "Shanghai Road, Nanjing".
[0108] Continuing with the example above, let's assume the weight parameter is... The range of values for the weight parameters is: .
[0109] The formula for calculating the weighted distance value is: .
[0110] Will and Substituting the calculation formula into the above equation, we get:
[0111]
[0112] By repeating steps 121 to 125 above, weighted distance values between each pair of real geographic addresses can be obtained.
[0113] Optionally, in one implementation, if the number of virtual geographic addresses to be output is large, multiple processes can be started simultaneously to generate virtual geographic addresses in parallel. Let's assume there are N real geographic addresses to be converted, and x processes in total. The N real geographic addresses can be divided into x groups, with each group containing N / x data. For each of the x groups, its respective weight parameters can be determined. .
[0114] In the above implementation, by integrating spatial information and semantics, the one-sidedness of single-dimensional judgment can be avoided; and a basis for subsequent secure replacement can be provided, that is, to ensure that the subsequently generated virtual address "looks reasonable, but is not accurately located".
[0115] Optionally, in one implementation, a graph database can be generated first based on the multiple real geographic addresses obtained in step 110, and each real geographic address can be represented by a node. Then, a weighted distance value can be calculated based on the nodes in the graph database.
[0116] Alternatively, in one implementation, multiple real geographic addresses can be summarized in a table, and the specific table may be as follows:
[0117]
[0118] Latitude and longitude can be retained to 6 decimal places. Based on the table above, the graph database can be obtained as follows: Figure 1d As shown.
[0119] 130. For a target real geographic address, obtain a real geographic address to be replaced from the plurality of real geographic addresses whose weighted distance value meets the preset requirements; wherein, the target real geographic address is any one of the plurality of real geographic addresses.
[0120] The target real geographic address is the object to be de-identified, and it belongs to any one of multiple real geographic addresses.
[0121] The real geographic address to be replaced is a substitute selected from the remaining real geographic addresses. The real geographic address to be replaced and the target real geographic address meet the condition that "the weighted distance value meets the preset requirements".
[0122] The purpose of step 130 is to select another real address with sufficient distinctiveness as the replacement address for the target real geographic address, which will be used in the subsequent generation of virtual addresses. Whether the distinctiveness is sufficient can be determined based on whether the weighted distance value meets the preset requirements.
[0123] The preset requirement can be a predefined requirement; specifically, the preset requirement can be the maximum weighted distance value. Accordingly, in one implementation, step 130 may specifically include the following steps:
[0124] From the plurality of real geographic addresses, obtain the real geographic address with the largest weighted distance value to the target real geographic address, wherein the real geographic address with the largest weighted distance value to the target real geographic address is the real geographic address to be replaced.
[0125] The above steps can be represented by the following formula:
[0126]
[0127] Among them, let us assume The latitude and longitude coordinates corresponding to the actual geographic address of the target. The sentence vector of the address text corresponding to the target's real geographic address; This refers to the latitude and longitude coordinates of any real geographic address other than the target real geographic address among multiple real geographic addresses. for The sentence vector of the address text corresponding to the real geographic address; This indicates that the real geographical address with the largest weighted distance value to the target real geographical address is obtained from the plurality of real geographical addresses.
[0128] In the above implementation, selecting the real geographic address with the largest weighted distance value maximizes privacy protection, ensuring that the virtual address deviates significantly from the real address both spatially and semantically. This avoids local ambiguity and failures, such as preventing the replacement of addresses only within the same cell and preventing attackers from inferring the real location from the context. By selecting the real geographic address with the largest weighted distance value, the generated virtual address maintains the validity of the address format while minimizing its deviation from the real location, thus effectively preventing the risk of sensitive information exposure due to address data leakage.
[0129] 140. Replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced to obtain the target virtual geographic address corresponding to the target real geographic address; wherein, i is a positive integer less than or equal to N.
[0130] Step 140 generates a target virtual geographic address that is both "seemingly plausible" and "far removed from the real location" by replacing the geographic hierarchical text. Optionally, in one implementation, step 140 may specifically include the following steps 141 to 145:
[0131] 141. Replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, and obtain the replacement result.
[0132] i is a positive integer less than or equal to N. Continuing with the example above, if N is 6, then i can take the values 1, 2, 3, 4, 5, and 6. For ease of description, let's take the initial value of i as 4 as an example.
[0133] Let's assume the target's real geographical address is "Building F, Room 1012, Street D, District C, City B, Province A". Then, the corresponding fourth-level geographical text of the target's real geographical address would be "Street D".
[0134] If the real geographical address to be replaced is “Building Z / 305, Street T, District H, City B, Province A”, then the corresponding fourth-level geographical text of the real geographical address to be replaced is “Street T”.
[0135] Then, “D Street” (the fourth-level text of the target real geographical address) can be replaced with “T Street” (the fourth-level text of the real geographical address to be replaced). The replacement result is: “A Province B City C District T Street F Building 1012”.
[0136] 142. For the real geographic address to be replaced, obtain the second real geographic address to be replaced from the plurality of real geographic addresses whose weighted distance value meets the second preset requirement.
[0137] The second preset requirement for the weighted distance value can be the same as or different from the preset requirement in step 130. For ease of description, let's assume the second preset requirement is: the real geographical address with the largest weighted distance value, excluding the processed geographical addresses.
[0138] The processed geographic addresses can include the target real geographic address and the selected real geographic addresses to be replaced. The setting of the second preset requirement mentioned above can prevent the target real geographic address itself from being selected when filtering based on the maximum weighted distance value.
[0139] 143. Replace the (i+1)th geographic level text of the replacement result with the (i+1)th geographic level text of the second real geographic address to be replaced, and obtain a new replacement result.
[0140] Continuing with the example above, if i is 4, then i+1 is 5. Therefore, in step 143, the 5th geographic level text of the replacement result can be replaced with the 5th geographic level text of the second real geographic address to be replaced.
[0141] It is important to note that the replacement result at this point is the result obtained after the i-th geographic level text of the target real geographic address has been replaced. Therefore, continuing with the example above, let's assume that the second real geographic address to be replaced is "X Province, Y City, Z District, SS Road, P Community 305", and correspondingly, the 5th geographic level text of the second real geographic address to be replaced is "P Community".
[0142] The replacement result is: "Building F, Street T, District C, City B, Province A, Room 1012". Correspondingly, the fifth geographic level text of the replacement result is: "Building F".
[0143] Then, “F Building” (the 5th geographic level text of the replacement result) can be replaced with “P Community” (the 5th geographic level text of the second real geographic address to be replaced), resulting in the new replacement result: “A Province B City C District T Street P Community 1012”.
[0144] 144. If the (i+1)th is not greater than N, then the second real geographic address to be replaced is taken as the new real geographic address to be replaced, and the (i+1)th is taken as the new ith. Then jump to the step: "For the real geographic address to be replaced, from the plurality of real geographic addresses, obtain the second real geographic address to be replaced that satisfies the second preset requirement", until the (i+1)th is greater than N.
[0145] Step 144 is the loop condition judgment step, which involves comparing the values of i+1 and N.
[0146] If i+1 is less than or equal to N, then the second real geographic address to be replaced can be used as the new real geographic address to be replaced, and i can be set to i+1. Then, jump to step 142 to find a new replacement source for the next level of the original target real geographic address. This continues until the last geographic level text of the original target real geographic address has also been replaced.
[0147] 145. When the (i+1)th term is greater than N, the obtained virtual geographic address is the target virtual geographic address.
[0148] When the loop ends (i.e., i+1 is greater than N), it means that layers i through N of the original target real geographic address have been replaced. At this point, the resulting virtual geographic address is the target virtual geographic address. In the target virtual geographic address, layers i through N all come from different real addresses. Therefore, the generated target virtual geographic address has a high degree of virtuality, provided that the format is completely valid (i.e., the target real geographic address cannot be obtained by reverse engineering based on the target virtual geographic address).
[0149] In the above implementation, the starting level of desensitization can be controlled by setting a specific value of i; and the replacement source can be selected independently at each geographic level, thereby making the generated target virtual geographic address more irreversible.
[0150] In one embodiment, the present application may further include the following steps:
[0151] The first M geographic levels of the target real geographic address are taken as the first M geographic levels of the target virtual geographic address, where M is a positive integer less than N.
[0152] Optionally, M can be 3, in which case the first M geographical levels correspond to provinces, cities, and districts / counties; M can also be 2, in which case the first M geographical levels correspond to provinces and cities. It should be understood that the specific value of M, provided that it is less than N and is a positive integer, should not be construed as a limitation on this application.
[0153] In the above implementation, a strategy is described that preserves high-level address information while only desensitizing low-level information: the first M geographical levels remain unchanged and are directly copied from the target real address to the virtual address; from the (M+1)th level onwards, the aforementioned steps (such as steps 141 to 145) are used for replacement or desensitization; where M is a positive integer less than the total number of levels N (i.e., 1 ≤ M). <N)。
[0154] This implementation introduces a parameter M to achieve a flexible mechanism combining layered retention and layered desensitization: M controls the "trusted reservation area" to ensure the virtual address is effective at the macro level; N M controls the "secure desensitization zone" to prevent the leakage of microscopic locations. This implementation method, combined with technologies such as weighted distance and multi-source replacement, can form a configurable, highly secure, and highly available virtual address generation system.
[0155] In another embodiment, the present application may further include the following steps S1 to S3:
[0156] S1. Obtain the first geographic level of the target's real geographic address.
[0157] The first geographic level is the provincial level. Determining the first geographic level of the target's actual geographic address can determine the geographic range constraints for subsequent screening.
[0158] S2. Obtain at least one preliminary real geographic address from the plurality of real geographic addresses, wherein the first geographic level of the preliminary real geographic address is the same as the first geographic level of the target real geographic address.
[0159] From multiple real geographic addresses, select all addresses whose first geographic level is the same as the first geographic level of the target real geographic address; these addresses constitute the initial set of real geographic addresses.
[0160] For example, let's assume that the first geographic level of the target real geographic address is province A. Then, we can obtain all addresses with the first geographic level of province A from multiple geographic addresses. These all addresses with the first geographic level of province A are at least one initial screening real geographic address.
[0161] S3. Replace the first M geographical levels of the target real geographical address with the first M geographical levels of the at least one pre-screened real geographical address to obtain the first M geographical levels of the target virtual geographical address.
[0162] Optionally, in step S3, one preliminary real geographic address can be selected from at least one preliminary real geographic address, and its first M geographic levels can be used to replace the first M geographic levels of the target virtual geographic address.
[0163] The above implementation method can randomly select a real geographic address for initial screening, or it can select based on a weighted distance value. The advantages of the above implementation method are: the address structure is naturally valid, the implementation is simple, and the computational cost is small.
[0164] In step S3, M preliminary real geographic addresses can be selected from at least one preliminary real geographic address. For the M preliminary real geographic addresses, one geographic level can be selected from each of the first M geographic levels to replace the corresponding geographic level of the target real geographic address.
[0165] For example, if we assume M is 3, then we can select 3 preliminary real geographic addresses: preliminary real geographic address 1, preliminary real geographic address 2, and preliminary real geographic address 3. We then replace the first geographic level of the target real geographic address with the first geographic level of preliminary real geographic address 1; replace the third geographic level of the target real geographic address with the third geographic level of preliminary real geographic address 2; and replace the second geographic level of the target real geographic address with the second geographic level of preliminary real geographic address 3.
[0166] The advantage of the above implementation method is that it is highly irreversible, and attackers cannot reverse-engineer any original address through the virtual address.
[0167] In yet another embodiment, the present application may further include the following steps X1 to X3:
[0168] X1. Obtain the first geographic level of the target's real geographic address.
[0169] Step X1 is the same as step S1 above, so it will not be repeated here.
[0170] X2. Based on the geographic region affiliation relationship corresponding to the first geographic level, randomly obtain M-1 geographic levels that belong to the first geographic level.
[0171] "Geographical subordination" can refer to a hierarchical system of regional divisions, for example:
[0172] Province A {City A1, City A2, City A3, …}
[0173] A3 City {A31, A32, A33, …}
[0174] These relationships can be obtained from publicly available regional partitioning databases.
[0175] Operation logic:
[0176] Using "Province A" as the root; randomly select a legal prefecture-level city (e.g., "City A2"); then randomly select a legal district / county under that city (e.g., "District A22").
[0177] ...
[0178] M generated in total One lower level, which, together with the first level, forms M levels.
[0179] X3. Determine the M-1 geographic levels and the first geographic level as the first M geographic levels of the target virtual geographic address.
[0180] The first layer obtained in step X1 and the M layer obtained in step X2 are compared. One lower-level layer is concatenated in sequence to form the first M layers of the virtual address; subsequent layers (M+1 to N) can be further desensitized through step 140 above.
[0181] In the above implementation, the association with the original location can be completely severed: the city and district are randomly generated and cannot be reversed; there is no need to store or access other real addresses, making it suitable for environments with strict data isolation.
[0182] The virtual geographic address generation method provided in this application embodiment can obtain multiple real geographic addresses, each of which includes latitude and longitude coordinates and address text. The address text includes N geographic levels. Based on the latitude and longitude coordinates and address text, the weighted distance value between any two real geographic addresses among the multiple real geographic addresses is calculated. For any one of the multiple real geographic addresses (let's call it the target real geographic address), a replacement real geographic address whose weighted distance value with the target real geographic address meets a preset requirement can be obtained from the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is then replaced with the i-th geographic level text of the replacement real geographic address, thereby obtaining the target virtual geographic address corresponding to the target real geographic address. This application embodiment can obtain multiple real geographic addresses and calculate the weighted distance value between any two real geographic addresses based on the latitude and longitude coordinates and address text included in each real geographic address. For a target real geographic address, firstly, obtain the real geographic addresses to be replaced that meet the preset requirements in terms of weighted distance value. Then, replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address. In this embodiment, the target virtual geographic address can be generated by filtering out the real geographic addresses to be replaced corresponding to the target real geographic address based on the weighted distance value, and replacing the i-th geographic level text of the former with the i-th geographic level text of the real geographic address to be replaced. Since the calculation of the weighted distance value involves both latitude and longitude coordinates and address text, the weighted distance value can better reflect the distance between any two real geographic addresses, thus making the obtained target virtual geographic address less likely to be close to the target real geographic address.
[0183] The embodiments of this application can minimize the occurrence of data security risks.
[0184] In this embodiment, the method of this application embodiment will be described in detail. The virtual geographic address generation method provided in this application embodiment can be executed by an electronic device. In this embodiment, let's take a product live broadcast video as an example, which is a live broadcast video segment for selling goods. Figure 2 As shown, the specific process of a virtual geographic address generation method is as follows:
[0185] 201. Obtain multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information that identifies a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1.
[0186] 202. Obtain the first latitude and longitude coordinates of the first real geographic address and the second latitude and longitude coordinates of the second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses among the plurality of real geographic addresses.
[0187] 203. Based on the first latitude and longitude coordinates and the second latitude and longitude coordinates, calculate the geographical distance between the first real geographical address and the second real geographical address.
[0188] 204. Obtain the first address text of the first real geographic address and obtain the second address text of the second real geographic address.
[0189] 205. Determine the text similarity between the first address text and the second address text.
[0190] 206. Based on the geographic distance value and the text similarity, calculate the weighted distance value between the first real geographic address and the second real geographic address.
[0191] 207. From the plurality of real geographic addresses, obtain the real geographic address with the largest weighted distance value to the target real geographic address, wherein the real geographic address with the largest weighted distance value to the target real geographic address is the real geographic address to be replaced, and the target real geographic address is any one of the plurality of real geographic addresses.
[0192] 208. Replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, and obtain the replacement result, where i is a positive integer less than or equal to N.
[0193] 209. For the real geographic address to be replaced, obtain the second real geographic address to be replaced from the plurality of real geographic addresses whose weighted distance value meets the second preset requirement.
[0194] 210. Replace the (i+1)th geographic level text of the replacement result with the (i+1)th geographic level text of the second real geographic address to be replaced.
[0195] 211. If the (i+1)th is not greater than N, then the second real geographic address to be replaced is taken as the new real geographic address to be replaced, and the (i+1)th is taken as the new ith. Jump to step 209 until the (i+1)th is greater than N.
[0196] 212. When the (i+1)th time is greater than N, the obtained virtual geographic address is the target virtual geographic address.
[0197] Optionally, in one embodiment, after step 212, the present application embodiment may further include the following steps:
[0198] The first M geographic levels of the target real geographic address are taken as the first M geographic levels of the target virtual geographic address, where M is a positive integer less than N.
[0199] Alternatively, in another embodiment, after step 212, the present application embodiment may further include the following steps:
[0200] Obtain the first geographic level of the target real geographic address; from the plurality of real geographic addresses, obtain at least one preliminary screening real geographic address, wherein the first geographic level of the preliminary screening real geographic address is the same as the first geographic level of the target real geographic address; replace the first M geographic levels of the target real geographic address with the first M geographic levels of the at least one preliminary screening real geographic address to obtain the first M geographic levels of the target virtual geographic address.
[0201] Alternatively, in another embodiment, after step 212, the present application embodiment may further include the following steps:
[0202] Obtain the first geographic level of the target real geographic address; based on the geographic region affiliation relationship corresponding to the first geographic level, randomly obtain M-1 geographic levels belonging to the first geographic level; determine the M-1 geographic levels and the first geographic level as the first M geographic levels of the target virtual geographic address.
[0203] The specific execution process of steps 201 to 212 has been explained in detail above, and will not be repeated here.
[0204] The virtual geographic address generation method provided in this application embodiment can obtain multiple real geographic addresses, each of which includes latitude and longitude coordinates and address text. The address text includes N geographic levels. Based on the latitude and longitude coordinates and address text, the weighted distance value between any two real geographic addresses among the multiple real geographic addresses is calculated. For any one of the multiple real geographic addresses (let's call it the target real geographic address), a replacement real geographic address whose weighted distance value with the target real geographic address meets a preset requirement can be obtained from the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is then replaced with the i-th geographic level text of the replacement real geographic address, thereby obtaining the target virtual geographic address corresponding to the target real geographic address. This application embodiment can obtain multiple real geographic addresses and calculate the weighted distance value between any two real geographic addresses based on the latitude and longitude coordinates and address text included in each real geographic address. For a target real geographic address, firstly, obtain the real geographic addresses to be replaced that meet the preset requirements in terms of weighted distance value. Then, replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address. In this embodiment, the target virtual geographic address can be generated by filtering out the real geographic addresses to be replaced corresponding to the target real geographic address based on the weighted distance value, and replacing the i-th geographic level text of the former with the i-th geographic level text of the real geographic address to be replaced. Since the calculation of the weighted distance value involves both latitude and longitude coordinates and address text, the weighted distance value can better reflect the distance between any two real geographic addresses, thus making the obtained target virtual geographic address less likely to be close to the target real geographic address.
[0205] The embodiments of this application can minimize the occurrence of data security risks.
[0206] To better implement the above methods, embodiments of this application also provide a virtual geographic address generation device. For example... Figure 3 As shown, the device includes:
[0207] The real address acquisition unit 301 is used to acquire multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information that identifies a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1;
[0208] The weighted distance value unit 302 is used to determine the weighted distance value between any two real geographical addresses among the plurality of real geographical addresses based on latitude and longitude coordinates and address text.
[0209] The replacement unit 303 is used to obtain, for a target real geographic address, a real geographic address whose weighted distance value meets a preset requirement from the plurality of real geographic addresses; wherein, the target real geographic address is any one of the plurality of real geographic addresses;
[0210] The text replacement unit 304 is used to replace the i-th geographical level text of the target real geographical address with the i-th geographical level text of the real geographical address to be replaced, so as to obtain the target virtual geographical address corresponding to the target real geographical address; wherein, i is a positive integer less than or equal to N.
[0211] In one embodiment, the text replacement unit 304 includes:
[0212] The i-th level replacement subunit is used to replace the i-th level text of the target real geographic address with the i-th level text of the real geographic address to be replaced;
[0213] The second address acquisition subunit is used to acquire, from the plurality of real geographical addresses, a second real geographical address to be replaced that satisfies the second preset requirement;
[0214] The (i+1)th level replacement subunit is used to replace the (i+1)th level text of the target real geographic address with the (i+1)th level text of the second real geographic address to be replaced.
[0215] The jump rotor unit is used to, when the (i+1)th is less than N, take the second real geographic address to be replaced as the new real geographic address to be replaced, take the (i+1)th as the new ith, and jump to the step: "For the real geographic address to be replaced, from the plurality of real geographic addresses, obtain the second real geographic address to be replaced that satisfies the second preset requirement", until the (i+1)th is equal to N.
[0216] The target address subunit is used to determine the target virtual geographic address when the (i+1)th digit equals N.
[0217] In one embodiment, the weighted distance value unit 302 includes:
[0218] The latitude and longitude subunit is used to obtain the first latitude and longitude coordinates of the first real geographic address and the second latitude and longitude coordinates of the second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses among the plurality of real geographic addresses.
[0219] The geographic distance value subunit is used to calculate the geographic distance value between the first real geographic address and the second real geographic address based on the first latitude and longitude coordinates and the second latitude and longitude coordinates;
[0220] The geographic text subunit is used to obtain the first address text of the first real geographic address and the second address text of the second real geographic address;
[0221] A similarity subunit is used to determine the text similarity between the first address text and the second address text;
[0222] The weighted distance value subunit is used to calculate the weighted distance value between the first real geographic address and the second real geographic address based on the geographic distance value and the text similarity.
[0223] In one embodiment, the unit to be replaced 303 is specifically used for:
[0224] From the plurality of real geographic addresses, obtain the real geographic address with the largest weighted distance value to the target real geographic address, wherein the real geographic address with the largest weighted distance value to the target real geographic address is the real geographic address to be replaced.
[0225] In one embodiment, the device further includes:
[0226] The address replacement unit is used to take the first M geographic levels of the target real geographic address as the first M geographic levels of the target virtual geographic address, where M is a positive integer less than N.
[0227] In one embodiment, the device further includes:
[0228] Geographic hierarchical unit, used to obtain the first geographic level of the target's real geographic address;
[0229] The initial screening address unit is used to obtain at least one initial screening real geographic address from the plurality of real geographic addresses, wherein the first geographic level of the initial screening real geographic address is the same as the first geographic level of the target real geographic address.
[0230] The initial screening and replacement unit is used to replace the first M geographical levels of the target real geographical address with the first M geographical levels of the at least one initial screening real geographical address to obtain the first M geographical levels of the target virtual geographical address.
[0231] In one embodiment, the device further includes:
[0232] Geographic hierarchical unit, used to obtain the first geographic level of the target's real geographic address;
[0233] Subordinate relationship unit, used to randomly obtain M-1 geographical levels belonging to the first geographical level based on the subordinate relationship of the geographical area corresponding to the first geographical level;
[0234] Subordinate replacement unit is used to determine the M-1 geographic levels and the first geographic level as the first M geographic levels of the target virtual geographic address.
[0235] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0236] The virtual geographic address generation method provided in this application embodiment can obtain multiple real geographic addresses, each of which includes latitude and longitude coordinates and address text. The address text includes N geographic levels. Based on the latitude and longitude coordinates and address text, the weighted distance value between any two real geographic addresses among the multiple real geographic addresses is calculated. For any one of the multiple real geographic addresses (let's call it the target real geographic address), a replacement real geographic address whose weighted distance value with the target real geographic address meets a preset requirement can be obtained from the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is then replaced with the i-th geographic level text of the replacement real geographic address, thereby obtaining the target virtual geographic address corresponding to the target real geographic address. This application embodiment can obtain multiple real geographic addresses and calculate the weighted distance value between any two real geographic addresses based on the latitude and longitude coordinates and address text included in each real geographic address. For a target real geographic address, firstly, obtain the real geographic addresses to be replaced that meet the preset requirements in terms of weighted distance value. Then, replace the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address. In this embodiment, the target virtual geographic address can be generated by filtering out the real geographic addresses to be replaced corresponding to the target real geographic address based on the weighted distance value, and replacing the i-th geographic level text of the former with the i-th geographic level text of the real geographic address to be replaced. Since the calculation of the weighted distance value involves both latitude and longitude coordinates and address text, the weighted distance value can better reflect the distance between any two real geographic addresses, thus making the obtained target virtual geographic address less likely to be close to the target real geographic address.
[0237] The embodiments of this application can minimize the occurrence of data security risks.
[0238] This application also provides an electronic device, which can be a terminal, a server, or other similar device. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.
[0239] In some embodiments, the virtual geographic address generation device can also be integrated into multiple electronic devices, such as multiple servers, with multiple servers implementing the virtual geographic address generation method of this application.
[0240] In this embodiment, a server will be used as an example for detailed description. For example, ... Figure 4 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:
[0241] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0242] The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 401.
[0243] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and violation detection by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0244] The electronic device also includes a power supply 403 that supplies power to the various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0245] The electronic device may also include an input module 404, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0246] The electronic device may also include a communication module 405. In some embodiments, the communication module 405 may include a wireless module, through which the electronic device can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 405 can be used to help users send and receive emails, browse web pages, and access streaming media.
[0247] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402, thereby realizing the various functions in the various method embodiments of this application, as follows:
[0248] Multiple real geographic addresses are obtained, each of which includes latitude and longitude coordinates and address text. The address text is text information identifying a geographic location and includes N geographic levels, where N is a positive integer greater than 1. Based on the latitude and longitude coordinates and address text, a weighted distance value is determined between any two real geographic addresses. For a target real geographic address, a replacement real geographic address is obtained from the multiple real geographic addresses whose weighted distance value meets a preset requirement. The target real geographic address is any one of the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is replaced with the text of the i-th geographic level text of the replacement real geographic address to obtain the target virtual geographic address corresponding to the target real geographic address. Here, i is a positive integer less than or equal to N.
[0249] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0250] Therefore, embodiments of this application provide a computer-readable storage medium storing instructions that can be loaded by a processor to perform steps in any of the virtual geographic address generation methods provided in embodiments of this application. For example, the instructions can perform the following steps:
[0251] Multiple real geographic addresses are obtained, each of which includes latitude and longitude coordinates and address text. The address text is text information identifying a geographic location and includes N geographic levels, where N is a positive integer greater than 1. Based on the latitude and longitude coordinates and address text, a weighted distance value is determined between any two real geographic addresses. For a target real geographic address, a replacement real geographic address is obtained from the multiple real geographic addresses whose weighted distance value meets a preset requirement. The target real geographic address is any one of the multiple real geographic addresses. The i-th geographic level text of the target real geographic address is replaced with the text of the i-th geographic level text of the replacement real geographic address to obtain the target virtual geographic address corresponding to the target real geographic address. Here, i is a positive integer less than or equal to N.
[0252] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0253] According to one aspect of this application, a computer program product or computer program is provided, comprising instructions stored in a computer-readable storage medium. A processor of a computer device reads the instructions from the computer-readable storage medium and executes the instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.
[0254] Since the instructions stored in the storage medium can execute the steps in any of the virtual geographic address generation methods provided in the embodiments of this application, the beneficial effects that any of the virtual geographic address generation methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0255] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0256] The foregoing has provided a detailed description of a virtual geographic address generation method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for generating virtual geographic addresses, characterized in that, The method includes: Multiple real geographic addresses are obtained, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information that identifies a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1; Based on latitude and longitude coordinates and address text, determine the weighted distance value between any two real geographical addresses among the plurality of real geographical addresses; For a target real geographic address, from the plurality of real geographic addresses, obtain the real geographic address to be replaced that meets the preset requirements for the weighted distance value; wherein, the target real geographic address is any one of the plurality of real geographic addresses; The process involves replacing the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address corresponding to the target real geographic address; wherein i is a positive integer less than or equal to N; the process of replacing the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, thereby obtaining the target virtual geographic address corresponding to the target real geographic address, includes: The process involves replacing the i-th geographic level text of the target real geographic address with the i-th geographic level text of the real geographic address to be replaced, obtaining a replacement result; for the real geographic address to be replaced, a second real geographic address whose weighted distance value meets the second preset requirement is obtained from the plurality of real geographic addresses; the (i+1)-th geographic level text of the replacement result is replaced with the (i+1)-th geographic level text of the second real geographic address to be replaced; if (i+1)-th is not greater than N, the second real geographic address to be replaced is taken as the new real geographic address to be replaced, and (i+1)-th is taken as the new i-th, and the process jumps to step: "For the real geographic address to be replaced, a second real geographic address whose weighted distance value meets the second preset requirement is obtained from the plurality of real geographic addresses", until (i+1)-th is greater than N; if (i+1)-th is greater than N, the resulting virtual geographic address is the target virtual geographic address.
2. The method as described in claim 1, characterized in that, The determination of the weighted distance value between any two real geographic addresses among the plurality of real geographic addresses based on latitude and longitude coordinates and address text includes: Obtain the first latitude and longitude coordinates of the first real geographic address and the second latitude and longitude coordinates of the second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses among the plurality of real geographic addresses; Based on the first latitude and longitude coordinates and the second latitude and longitude coordinates, calculate the geographical distance between the first real geographical address and the second real geographical address; Obtain the first address text of the first real geographic address and obtain the second address text of the second real geographic address; Determine the text similarity between the first address text and the second address text; Based on the geographic distance value and the text similarity, a weighted distance value is calculated between the first real geographic address and the second real geographic address.
3. The method as described in claim 1, characterized in that, For the target real geographic address, obtaining the real geographic address to be replaced from the plurality of real geographic addresses whose weighted distance value meets the preset requirements includes: From the plurality of real geographic addresses, obtain the real geographic address with the largest weighted distance value to the target real geographic address, wherein the real geographic address with the largest weighted distance value to the target real geographic address is the real geographic address to be replaced.
4. The method as described in claim 1, characterized in that, The method further includes: The first M geographic levels of the target real geographic address are taken as the first M geographic levels of the target virtual geographic address, where M is a positive integer less than N.
5. The method as described in claim 1, characterized in that, The method further includes: Obtain the first geographic level of the target's actual geographic address; From the plurality of real geographic addresses, at least one preliminary real geographic address is obtained, wherein the first geographic level of the preliminary real geographic address is the same as the first geographic level of the target real geographic address. The first M geographic levels of the target real geographic address are replaced with the first M geographic levels of the at least one pre-screened real geographic address to obtain the first M geographic levels of the target virtual geographic address.
6. The method as described in claim 1, characterized in that, The method further includes: Obtain the first geographic level of the target's actual geographic address; Based on the geographical region affiliation relationship corresponding to the first geographical level, M-1 geographical levels belonging to the first geographical level are randomly selected; The M-1 geographic levels and the first geographic level are determined as the first M geographic levels of the target virtual geographic address.
7. A virtual geographic address generation device, characterized in that, The device includes: The real address acquisition unit is used to acquire multiple real geographic addresses, wherein each real geographic address includes latitude and longitude coordinates and address text; the address text is text information that identifies a geographic location, and the address text includes N geographic levels, where N is a positive integer greater than 1; The weighted distance value unit is used to determine the weighted distance value between any two real geographic addresses among the plurality of real geographic addresses based on latitude and longitude coordinates and address text. The replacement unit is used to obtain, for a target real geographic address, a real geographic address whose weighted distance value meets a preset requirement from the plurality of real geographic addresses; wherein, the target real geographic address is any one of the plurality of real geographic addresses; The text replacement unit is used to replace the i-th geographical level text of the target real geographical address with the i-th geographical level text of the real geographical address to be replaced, thereby obtaining the target virtual geographical address corresponding to the target real geographical address; wherein, i is a positive integer less than or equal to N; specifically, the text replacement unit is used to replace the i-th geographical level text of the target real geographical address with the i-th geographical level text of the real geographical address to be replaced, thereby obtaining a replacement result; for the real geographical address to be replaced, from the plurality of real geographical addresses, a second real geographical address to be replaced whose weighted distance value satisfies the second preset requirement is obtained. Replace the (i+1)th geographic level text of the replacement result with the (i+1)th geographic level text of the second real geographic address to be replaced; if the (i+1)th is not greater than N, then take the second real geographic address to be replaced as the new real geographic address to be replaced, take the (i+1)th as the new i, and jump to the step: "For the real geographic address to be replaced, from the plurality of real geographic addresses, obtain the second real geographic address to be replaced that satisfies the second preset requirement", until the (i+1)th is greater than N; if the (i+1)th is greater than N, the obtained virtual geographic address is the target virtual geographic address.
8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing instructions; the processor loads instructions from the memory to perform the steps in the virtual geolocation generation method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions adapted for loading by a processor to perform the steps of the virtual geographic address generation method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The method includes instructions that, when executed by a processor, implement the steps in the virtual geographic address generation method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Position privacy protection method and system based on Android platform
CN110866271A
Address information desensitization method based on administrative region correction
CN117852073A