CN-121542447-B - Virtual geographic address generation method and device, electronic equipment and storage medium
Abstract
The application discloses a virtual geographic address generation method, a device, electronic equipment and a storage medium, which comprise the steps of obtaining a plurality of real geographic addresses, wherein each real geographic address comprises longitude and latitude coordinates and an address text, the address text comprises N geographic levels, determining weighted distance values of any two real geographic addresses in the plurality of real geographic addresses based on the longitude and latitude coordinates and the address text, obtaining a real geographic address to be replaced, of which the weighted distance values meet preset requirements, from the plurality of real geographic addresses for a target real geographic address, and replacing an ith geographic level text of the target real geographic address by utilizing an ith 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. The weighted distance value is calculated by longitude and latitude coordinates and address text, so that the target virtual geographic address is not easy to be close to the real geographic address, and the occurrence of potential safety hazards of data is avoided as much as possible.
Inventors
- Zhu Runsu
- ZHANG JINGJING
- WANG YUQI
- CHEN SHAOQIONG
- DUAN CHANGLONG
Assignees
- 深圳市智城软件技术服务有限公司
- 深圳市智慧城市科技发展集团有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260120
Claims (10)
- 1. A method for generating a virtual geographic address, the method comprising: acquiring a plurality of real geographic addresses, wherein each real geographic address comprises longitude and latitude coordinates and an address text, the address text is text information for identifying a geographic position, the address text comprises N geographic levels, and N is a positive integer greater than 1; Determining weighted distance values of any two real geographic addresses in the plurality of real geographic addresses based on longitude and latitude coordinates and address texts; for a target real geographic address, acquiring a real geographic address to be replaced, wherein the weighted distance value of the real geographic address meets a preset requirement, from the plurality of real geographic addresses, and the target real geographic address is any one of the plurality of real geographic addresses; The method comprises the steps of obtaining a target virtual geographic address corresponding to the target real geographic address by replacing an ith geographic level text of the target real geographic address with the ith geographic level text of the real geographic address to be replaced, wherein i is a positive integer less than or equal to N, and obtaining the target virtual geographic address corresponding to the target real geographic address by replacing the ith geographic level text of the target real geographic address with the ith geographic level text of the real geographic address to be replaced, and comprises the following steps: The method comprises the steps of obtaining a target virtual geographic address, obtaining a target real geographic address, obtaining an ith geographic hierarchy text of the target real geographic address by using an ith geographic hierarchy text of the target real geographic address to obtain a replacement result, obtaining a second real geographic address to be replaced, with the weighted distance value meeting a second preset requirement, from a plurality of real geographic addresses for the real geographic address to be replaced, replacing an (i+1) th geographic hierarchy text of the replacement result by using an (i+1) th geographic hierarchy text of the second real address to be replaced, taking the second real geographic address to be replaced as a new real geographic address to be replaced if the (i+1) th geographic hierarchy text is not greater than N, and jumping to the step of obtaining a second real geographic address to be replaced, with the weighted distance value meeting a second preset requirement, from the plurality of real geographic addresses for the real geographic address to be replaced until the (i+1) th geographic address to be replaced is greater than N, and obtaining a virtual geographic address to be the target virtual geographic address under the condition that the (i+1) th geographic address is greater than N.
- 2. The method of claim 1, wherein the determining the weighted distance value for any two of the plurality of real geographic addresses based on the latitude and longitude coordinates and the address text comprises: Acquiring a first longitude and latitude coordinate of a first real geographic address and a second longitude and latitude coordinate of a second real geographic address, wherein the first real geographic address and the second real geographic address are any two real geographic addresses in the plurality of real geographic addresses; Calculating a geographic distance value of the first real geographic address and the second real geographic address based on the first longitude and latitude coordinates and the second longitude and latitude coordinates; acquiring a first address text of the first real geographic address and a second address text of the second real geographic address; determining the text similarity of the first address text and the second address text; And calculating a weighted distance value of the first real geographic address and the second real geographic address based on the geographic distance value and the text similarity.
- 3. The method of claim 1, wherein the obtaining, for the target real geographic address, the real geographic address to be replaced for which the weighted distance value satisfies a preset requirement from the plurality of real geographic addresses includes: And acquiring the real geographic address with the largest weighted distance value with the target real geographic address from the real geographic addresses, wherein the real geographic address with the largest weighted distance value with the target real geographic address is the real geographic address to be replaced.
- 4. The method of claim 1, wherein the method further comprises: And taking the first M geographic levels of the target real geographic address as the first M geographic levels of the target virtual geographic address, wherein M is a positive integer smaller than N.
- 5. The method of claim 1, wherein the method further comprises: Acquiring a first geographic level of the target real geographic address; Acquiring at least one preliminary screening real geographic address from the real geographic addresses, wherein a first geographic level of the preliminary screening real geographic address is the same as a first geographic level of the target real geographic address; and replacing the first M geographic levels of the target real geographic address by using the first M geographic levels of the at least one primary screening real geographic address to obtain the first M geographic levels of the target virtual geographic address.
- 6. The method of claim 1, wherein the method further comprises: Acquiring a first geographic level of the target real geographic address; based on the geographical region affiliation corresponding to the first geographical hierarchy, randomly acquiring M-1 geographical hierarchies subordinate to the first geographical hierarchy; 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 generating device, the device comprising: The system comprises a real address acquisition unit, a real address generation unit and a real address generation unit, wherein the real address acquisition unit is used for acquiring a plurality of real geographic addresses, each real geographic address comprises longitude and latitude coordinates and an address text, the address text is text information for identifying a geographic position, the address text comprises N geographic levels, and N is a positive integer greater than 1; the weighted distance value unit is used for determining weighted distance values of any two real geographic addresses in the plurality of real geographic addresses based on longitude and latitude coordinates and address texts; the unit to be replaced is used for acquiring the real geographic address to be replaced, of which the weighted distance value meets the preset requirement, from the plurality of real geographic addresses for the target real geographic address, wherein the target real geographic address is any one of the plurality of real geographic addresses; The method comprises the steps of obtaining a target virtual geographic address corresponding to a target real geographic address by using an ith geographic level text of the real geographic address to be replaced, obtaining the target virtual geographic address corresponding to the target real geographic address by using an ith geographic level text of the real geographic address to be replaced, wherein i is a positive integer smaller than or equal to N, using the ith geographic level text of the real geographic address to be replaced to replace the ith geographic level text of the target real geographic address to obtain a replacing result, obtaining a second real geographic address to be replaced, of which the weighted distance value meets a second preset requirement, from the plurality of real geographic addresses to be replaced, using an (i+1) th geographic level text of the second real geographic address to be replaced to replace the ith geographic level text of the replacing result, using the (i+1) th real address to be replaced as a new real address to be replaced if the (i+1) th geographic level text is not larger than N, and using the (i+1) th real address to be replaced as a new (i) th geographic address to be replaced, and obtaining a weighted distance value from the plurality of the real addresses to be replaced to be more than N+1' the target virtual address to be replaced to the target virtual geographic address to be more than N.
- 8. An electronic device, comprising a processor and a memory, the memory storing instructions, the processor loading instructions from the memory to perform the steps in the virtual geographic address generating method as claimed in any one of claims 1 to 6.
- 9. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the virtual geographical address generating method of any one of claims 1 to 6.
- 10. A computer program product comprising instructions which when executed by a processor implement the steps of the virtual geographical address generating method of any one of claims 1 to 6.
Description
Virtual geographic address generation method and device, electronic equipment and storage medium Technical Field The present application relates to the field of computers, and in particular, to a method and apparatus for generating a virtual geographic address, an electronic device, and a storage medium. Background In the process of developing and constructing smart cities, detailed addresses and longitude and latitude are often required for city planning and development. If the detailed address is real address data, the real address data may implicitly include information of local population, industry, economy, traffic, etc., which may cause potential safety hazard. Thus, development work typically uses address data that is subject to virtualization. In the prior art, a virtual address is often obtained by blurring processing on real address data. However, the existing blurring processing method easily causes that the output virtual address is too close to the real address, or easily causes potential safety hazard of data. Disclosure of Invention The embodiment of the application provides a virtual geographic address generation method, a device, electronic equipment and a storage medium, which can solve the problem of potential safety hazard of data caused by the fact that a virtual address is too close to a real address in the prior art. The embodiment of the application provides a virtual geographic address generation method, which comprises the following steps: The method comprises the steps of obtaining a plurality of real geographic addresses, wherein each real geographic address comprises longitude and latitude coordinates and an address text, the address text is text information for identifying a geographic position, the address text comprises N geographic levels, N is a positive integer greater than 1, determining weighted distance values of any two real geographic addresses in the plurality of real geographic addresses based on the longitude and latitude coordinates and the address text, obtaining a real geographic address to be replaced, of which the weighted distance values meet preset requirements, from the plurality of real geographic addresses for a target real geographic address, wherein the target real geographic address is any real geographic address in the plurality of real geographic addresses, replacing the i geographic level text of the target real geographic address by utilizing the i geographic level text of the real geographic address to be replaced, and obtaining a target virtual geographic address corresponding to the target real geographic address, wherein i is a positive integer less than or equal to N. The embodiment of the application provides a virtual geographic address generating device, which comprises: The system comprises a real address acquisition unit, a real address generation unit and a real address generation unit, wherein the real address acquisition unit is used for acquiring a plurality of real geographic addresses, each real geographic address comprises longitude and latitude coordinates and an address text, the address text is text information for identifying a geographic position, the address text comprises N geographic levels, and N is a positive integer greater than 1; the weighted distance value unit is used for determining weighted distance values of any two real geographic addresses in the plurality of real geographic addresses based on longitude and latitude coordinates and address texts; the unit to be replaced is used for acquiring the real geographic address to be replaced, of which the weighted distance value meets the preset requirement, from the plurality of real geographic addresses for the target real geographic address, wherein the target real geographic address is any one of the plurality of real geographic addresses; And the text replacement unit is used for replacing the ith geographic hierarchy text of the target real geographic address by using the ith geographic hierarchy text of the real geographic address to be replaced to obtain a target virtual geographic address corresponding to the target real geographic address, wherein i is a positive integer less than or equal to N. In one embodiment, a text replacement unit includes: an ith level replacement subunit, configured to replace an ith geographical hierarchy text of the target real geographical address with the ith geographical hierarchy text of the real geographical address to be replaced; the second address obtaining subunit is used for obtaining a second to-be-replaced real geographic address, of which the weighted distance value meets a second preset requirement, from the plurality of real geographic addresses for the to-be-replaced real geographic address; An i+1th level replacement subunit configured to replace an i+1th geographic level text of the target real geographic address with an i+1th geographic level text of the second real geographic address to be replaced; The rotor jum