Digital twin city generation method based on mesh segmentation coding

By selecting the appropriate encoding method based on size information and tilt information in the generation of digital twin cities, performing multi-level grid segmentation and uneven height segmentation on the target space, and generating four-dimensional vector grid encoding, the problems of high encoding complexity and redundancy in the existing technology are solved, the data indexing and query efficiency are improved, and the generation efficiency of digital twin cities is enhanced.

CN119322811BActive Publication Date: 2025-10-10HUNAN INST OF ADVANCED TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411417833.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-10-10
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

The existing grid segmentation coding method has high computational complexity, resulting in low data indexing and query efficiency, and fails to effectively consider the spatial differences in data distribution, resulting in coding redundancy and affecting the efficiency of digital twin cities.

Method used

By obtaining the size information of the target spatial area, determining the maximum number of segmentation levels based on the minimum segmentation distance, and selecting the encoding method using the horizontal and tilt information, the plane area is grid-segmented multiple times and unevenly segmented in the height direction to generate a four-dimensional vector grid code to improve the encoding efficiency.

Benefits of technology

It achieves efficient data indexing and query, reduces coding redundancy, and improves the generation efficiency and overall performance of digital twin cities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322811B_ABST
    Figure CN119322811B_ABST
Patent Text Reader

Abstract

The application relates to a digital twin city generation method, device and equipment based on mesh segmentation coding, which comprises the following steps: obtaining a maximum segmentation level number according to size information and a preset minimum segmentation distance; when a second-level mesh segmentation is performed on a planar region of a target space region, a coding mode of the segmented mesh is selected according to horizontal and inclined information, and the second-level segmented mesh is coded; when mesh segmentation is performed at a level higher than the second level, the last-level mesh coding is filled into a top-left region of the current-level segmented mesh, the coding sequence is determined according to the distance between the last coding of the region and the two top corner sub-meshes of the current-level segmented mesh, the remaining sub-meshes are coded, and planar mesh coding is obtained until height segmentation coding is performed; and finally, a corresponding digital twin city is generated according to the planar mesh coding and the height mesh coding. The method can improve the efficiency of generating the digital twin city.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of geographic information technology, and in particular to a method for generating a digital twin city based on grid segmentation coding. Background Art

[0002] The digital twin city is a widespread application of digital twin technology at the urban level. It leverages data from physical models, sensors, and operational history to integrate multidisciplinary, multi-physics, multi-scale, and multi-probability simulation processes, mapping them in virtual space and reflecting the entire lifecycle of corresponding physical devices. By collecting, analyzing, and processing urban data, and leveraging virtual simulation and 3D modeling technologies, a digital twin city is established in virtual space, a one-to-one correspondence and mutual mapping with the physical city. This allows city managers to more accurately analyze urban issues and develop more targeted solutions, thereby providing more efficient and convenient public services to city residents and comprehensively improving the quality of urban management.

[0003] However, in the practical advancement of digital twin cities, challenges such as difficulty integrating, correlating, and calculating urban data have become key technical bottlenecks hindering development. Urban spatial data inherently suffers from the diversity of spatiotemporal descriptions, making integration and unification of existing CIS, BIM, and various human geography data difficult. Data on various objects, events, and activities within cities is even more complex, coming from a wide range of sources and using diverse description formats. Currently, urban grid management is the mainstream development direction for addressing GIS spatial positioning and spatial retrieval mechanisms. Based on the concept of multi-level spatial information grids, urban space is divided into grid cells of a certain size according to specific rules, forming multi-level grids of varying levels, with grid segmentation and coding being the core technology.

[0004] Grid segmentation encoding method is the basis and key to data indexing, querying and other calculations based on grid models. However, existing encoding methods have high encoding calculation complexity, which is not conducive to efficient data indexing and querying operations, or do not consider the spatial differences in data distribution, thus usually generating a large amount of encoding redundancy when filling the space, reducing utilization efficiency. Summary of the Invention

[0005] Based on this, it is necessary to provide a digital twin city generation method based on grid segmentation coding that can improve efficiency in response to the above technical problems.

[0006] A method for generating a digital twin city based on grid segmentation coding, the method comprising:

[0007] Get the target space area and its size information;

[0008] Obtaining a maximum number of cutting levels according to the size information and a preset minimum cutting distance;

[0009] Performing multiple grid divisions on the plane area of ​​the target space area in sequence, selecting an encoding method for the grid after division according to the horizontal and tilt information when performing the second-level grid division, and encoding the second-level grid using the selected grid encoding method;

[0010] When performing grid segmentation at a level greater than level 2, fill the upper left corner area of ​​the current level grid with the code of the previous level grid. At the same time, determine the coding order of the remaining subgrids of the current level grid based on the distance between the subgrid where the last code of the area is located and the subgrids at the upper right corner and lower left corner of the current level grid, and then code the remaining subgrids according to the determined order.

[0011] Until the maximum number of segmentation levels is reached, the grid segmentation and encoding of the plane region in the target space region are completed to obtain the plane grid encoding;

[0012] Performing highly uneven segmentation coding in the target space region according to the size information to obtain a highly grid-coded image;

[0013] A four-dimensional vector grid code of the target space area is obtained according to the plane grid code and the height grid code, and a corresponding digital twin city is generated based on the four-dimensional vector grid code.

[0014] In one embodiment, before obtaining the maximum number of segmentation levels based on the size information and the preset minimum segmentation distance, if the plane area shape of the target space area is not in the positive direction, the plane area is expanded outward to obtain a new square plane area, and grid segmentation and encoding are performed based on the new plane area.

[0015] In one embodiment, when performing the second-level grid segmentation, the selectable encoding methods include two:

[0016] The first method is to encode each subgrid in a clockwise order starting from the subgrid in the upper left corner;

[0017] The second method is to encode each sub-grid in sequence along a "Z"-shaped path starting from the sub-grid located in the upper left corner.

[0018] In one embodiment, selecting the first or second encoding method for the segmented grid according to the horizontal and tilt information includes:

[0019] Each sub-grid in the new plane area after the second-level grid segmentation is represented by the coordinates of its center point;

[0020] Calculating the mean and variance of the new plane area according to the coordinates of the center points of each subgrid, and calculating the distribution coefficient and template size coefficient of the new plane area according to the mean and method;

[0021] Constructing horizontal template, tilt template and weight template according to distribution coefficient and template size coefficient;

[0022] Using the horizontal template and the tilted template, and the weighted template, respectively, to perform a convolution operation on each subgrid in the new plane area, and obtain convolution results corresponding to the horizontal template and the tilted template for each subgrid;

[0023] Compare the sizes of the two convolution results on each sub-grid, and determine the encoding method based on the comparison results on all sub-grids.

[0024] In one embodiment, constructing the horizontal template, the tilt template, and the weight template according to the distribution coefficient and the template size coefficient includes:

[0025] According to the template size coefficient, constructing an initial horizontal template and an initial tilted template of a square grid respectively, wherein the initial value of each grid in the initial horizontal template and the initial tilted template is 0;

[0026] Constructing a first vector whose length is the template size coefficient and whose elements include distribution coefficients, and assigning values ​​to the initial horizontal template according to the first vector and the reverse vector of the first vector to obtain the horizontal template;

[0027] Constructing a second vector whose length is the template size coefficient minus 1 and whose elements include the distribution coefficient, and assigning values ​​to the initial tilted template according to two tilted line segments preset in the initial tilted template, the second vector, and the reverse vector of the second vector to obtain the tilted template;

[0028] The weight template is constructed according to pre-set parameters, the template size coefficient, and the distribution coefficient.

[0029] In one embodiment, when determining the coding order of the remaining subgrids of the current level segmentation grid based on the distances between the subgrid where the last coding of the region is located and the subgrids at the upper right corner and the lower left corner of the current level segmentation grid:

[0030] If the distance between the last coded subgrid and the subgrid at the upper right corner of the current level is greater than the distance between the last coded subgrid and the subgrid at the lower left corner of the current level, the remaining subgrids are coded in sequence along the broken line starting from the subgrid at the upper right corner of the current level.

[0031] If not, the encoding of the remaining sub-grids is performed in sequence according to the fold line from the sub-grid at the lower left corner of the current level of split grid.

[0032] If the distance between the sub-grid where the last encoding is located and the sub-grid at the upper right corner of the current level of split grid is equal to the distance between the sub-grid where the last encoding is located and the sub-grid at the lower left corner of the current level of split grid, the starting sub-grid of the encoding is determined according to the similarity between the sub-grid where the last encoding is located and the two sub-grids respectively.

[0033] In one embodiment, when performing the height non-uniform split encoding in the target space region according to the size information:

[0034] The initial height split coefficient is calculated according to the preset parameter, and the final split coefficient is obtained by normalizing the calculated initial height split coefficient;

[0035] According to the final split coefficient, the highest height in the target space region that needs to be split is split in the order from bottom to top to obtain height sub-blocks, and the current order is assigned to the current height sub-block;

[0036] The height split level and the order of the height sub-blocks are combined into a two-dimensional vector as the height grid encoding.

[0037] The above digital twin city generation method based on grid split encoding first obtains the maximum split level according to the size information and the preset minimum split distance. When performing the second level of grid split on the planar region of the target space region, the second level of split grid is encoded according to the encoding mode of the split grid selected by the horizontal and inclined information. When performing grid split at a level greater than the second level, the last level of grid encoding is filled into the upper left corner region of the current level of split grid. At the same time, the encoding order of the remaining sub-grids of the current level of split grid is determined according to the distance between the sub-grid where the last encoding is located and the sub-grids at the upper right corner and the lower left corner of the current level of split grid, and the remaining sub-grids are encoded, until the planar grid encoding is obtained. At the same time, the height non-uniform split encoding is performed. Finally, the corresponding digital twin city is generated according to the planar grid encoding and the height grid encoding. The method can improve the efficiency of generating digital twin cities. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 A flowchart of the digital twin city generation method based on grid split encoding in one embodiment;

[0039] Figure 2 A flowchart of the grid split encoding method for digital twin cities in one embodiment;

[0040] Figure 3Schematic diagram of two optional filling curves for the second-level segmentation in one embodiment;

[0041] Figure 4 A schematic diagram of the assignment position of a tilted template in one embodiment;

[0042] Figure 5 Schematic diagram of the second-level segmentation encoding result in one embodiment;

[0043] Figure 6 A schematic diagram of the segmentation from level 2 to level 3 in one embodiment. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0045] In this application, if Figure 1 As shown in FIG, a method for generating a digital twin city based on grid segmentation coding is provided, which specifically includes the following steps:

[0046] Step S100: Acquire the target space area and its size information.

[0047] Step S110 : obtaining the maximum number of segmentation levels according to the size information and the preset minimum segmentation distance.

[0048] Step S120 , the planar area of ​​the target space area is divided into multiple grids in sequence. When performing the second-level grid division, the encoding method of the grid after division is selected according to the horizontal and tilt information, and the second-level grid is encoded using the selected grid encoding method.

[0049] Step S130: When performing grid segmentation at a level greater than level 2, fill the upper left corner area of ​​the current segmentation grid with the grid code of the previous level, and at the same time determine the coding order of the remaining sub-grids of the current segmentation grid according to the distance between the sub-grid where the last code of the area is located and the sub-grids at the upper right corner and the lower left corner of the current segmentation grid, and encode the remaining sub-grids according to the determined order.

[0050] Step S140 , until the maximum number of segmentation levels is reached, the grid segmentation and encoding of the plane region in the target space region are completed to obtain the plane grid encoding.

[0051] Step S150 , performing highly non-uniform segmentation coding in the target space region according to the size information to obtain a highly grid-coded image.

[0052] Step S160: Obtain a four-dimensional vector grid code of the target space area according to the plane grid code and the height grid code, and generate a corresponding digital twin city based on the four-dimensional vector grid code.

[0053] Grid segmentation and coding is the most basic and most critical step for the generation of digital twin cities. It is one of the core technologies for realizing the construction of large-scale urban three-dimensional models and real-time dynamic operation. Through reasonable grid segmentation and coding methods, the constructed digital twin city can process massive data more efficiently, realize refined management and real-time monitoring, and improve the overall performance and function of the digital twin city. In this method, a grid segmentation and coding method is proposed, which specifically includes the plane grid coding part in steps S110 to S140, and the height grid coding part in step S150. These two parts can be processed simultaneously during the actual operation process, such as Figure 2 As shown, they can also be processed sequentially.

[0054] In this method, the plane area is first evenly divided into four sub-grids of equal area. Then, the appropriate filling curve is selected for encoding using information such as horizontality and tilt. Subsequent segmentation and encoding are performed on the basis of the previous level, and the plane encoding results of all segmentation levels are obtained in turn. Then, the height is non-uniformly divided according to certain rules and height grid encoding is performed. Finally, the plane grid code and the height grid code are combined to form a four-dimensional vector, which is the result of the entire grid encoding.

[0055] Specifically, in step S100, the target spatial region to be grid-coded and various size data of the region are first obtained, including the highest segmentation height of the spatial region, the size of the plane region, the minimum segmentation distance, etc.

[0056] In step S110, before obtaining the maximum number of segmentation levels based on the size information and the preset minimum segmentation distance, if the plane area shape of the target spatial area is not in the positive direction, the plane area is expanded outward to obtain a new square plane area, and grid segmentation and encoding are performed based on the new plane area.

[0057] Specifically, an area to be grid-coded is selected, i.e., a plane area in the target space area. If it is not a square area, it is expanded outward to obtain a square area, i.e., a new plane area, denoted as F(x, y), with an area size of W×W.

[0058] Furthermore, let the maximum number of segmentation levels Num1, set the minimum segmentation distance to th1∈[10,20], and use an evenly spaced segmentation method, then It can be calculated that Num1 = [W / th1], where [·] is a rounding operator.

[0059] In step S120, after the first level of segmentation of the new plane area, the result is still F(x,y). Next, the new plane area F(x,y) is segmented into a 2x2 grid. When encoding this grid, the appropriate segmentation encoding method is selected based on the horizontal and tilt information to encode each sub-grid.

[0060] In this embodiment, when performing the second-level grid segmentation, there are two optional encoding methods: the first is to encode each sub-grid in a clockwise order starting from the sub-grid at the upper left corner, that is, Figure 3 The second method is to encode each subgrid in sequence along a "Z"-shaped path starting from the subgrid at the upper left corner, that is, Figure 3 Curve 2 in .

[0061] In this embodiment, the encoding method of the grid after segmentation is selected as the first or second method according to the horizontal and tilt information, including: first, each sub-grid in the new plane area after the second-level grid segmentation is represented by its center point coordinates, and the mean and variance of the new plane area are calculated according to the center point coordinates of each sub-grid, and the distribution coefficient and template size coefficient of the new plane area are calculated according to the mean and method, and a horizontal template, a tilt template and a weight template are constructed according to the distribution coefficient and the template size coefficient, and the horizontal template and the tilt template are used respectively to perform a convolution operation on each sub-grid in the new plane area with the weight template to obtain the convolution results of each sub-grid corresponding to the horizontal template and the tilt template, and finally compare the sizes of the two convolution results on each sub-grid, and determine the encoding method according to the comparison results on all sub-grids.

[0062] Specifically, first calculate the mean μ and variance σ of the four sub-grids F(x,y) with equal areas after the second level segmentation 2 , using the following formula:

[0063]

[0064] In formula (1), W represents the side length of the new plane area.

[0065] Next, use the mean and variance to calculate the distribution coefficient λ and template size coefficient d of F(x,y) using the following formula:

[0066]

[0067] In formula (2), [·] represents a rounding operator.

[0068] In this embodiment, constructing a horizontal template, an inclined template, and a weighted template based on a distribution coefficient and a template size coefficient includes: constructing an initial horizontal template and an initial inclined template of a square grid based on the template size coefficient, wherein the initial value of each grid in the initial horizontal template and the initial inclined template is 0; constructing a first vector having a length equal to the template size coefficient and whose elements include the distribution coefficient; and assigning values ​​to the initial horizontal template based on the first vector and the reverse vector of the first vector to obtain a horizontal template. Next, constructing a second vector having a length equal to the template size coefficient minus 1 and whose elements include the distribution coefficient; and assigning values ​​to the initial inclined template based on two inclined line segments preset in the initial inclined template, a second vector, and the reverse vector of the second vector to obtain a inclined template. Finally, constructing the weighted template based on pre-set parameters, the template size coefficient, and the distribution coefficient.

[0069] Specifically, a d×d initial horizontal template D1 and a d×d initial tilted template D2 are first defined, and their initial values ​​are both 0.

[0070] Furthermore, define a first vector vec1=[1,…,λ,λ+1,λ,…,1] with a length of d, and then according to The initial horizontal template D1 is assigned a value to obtain a horizontal template.

[0071] At the same time, define a second vector vec2 = [1,…,λ,λ,…,1] with a length of d-1, and assign values ​​to the inclined template D2 according to the preset line segments, where line segments 1 and 2 are parallel to the diagonal lines connecting the upper right corner and the lower left corner of the inclined template D2, and process the diagonal lines on both sides as follows: Figure 4 As shown, let vec2 be used to assign the position of line segment 1, and -vec2 be used to assign the position of line segment 2, and we will get the tilted template.

[0072] Next, construct a d×d weight template D3 using the following formula:

[0073] D3(x,y)=exp{1-α1(x-λ-1) 2 -α2(y-λ-1) 2} (3)

[0074] In formula (3), α1 and α2 represent pre-set parameters. From the constructed weight template D3, it can be seen that the closer the distance to the template center (λ+1,λ+1), the greater the weight, and vice versa.

[0075] Furthermore, convolution operations are performed on each subgrid in F(x,y) using the horizontal template D1 and the tilted template D2 to obtain DF1 and DF2, respectively. The formulas are as follows:

[0076]

[0077] Next, compare the component values ​​of DF1 and DF2 in the same subgrid. The formula is as follows:

[0078]

[0079] In this embodiment, if s1>s2, curve 1 is selected; otherwise, curve 2 is selected.

[0080] Specifically, the second-level segmentation grid is encoded according to the selected curve. If curve 1 is selected, the encoding result is as follows: Figure 5 As shown in (a), if curve 2 is selected, the encoding result is as follows Figure 5 (b) shown.

[0081] Furthermore, the code represents a two-dimensional vector, where the first component represents the number of segmentation levels and the second component represents the coding order.

[0082] In step S130, when determining the coding order of the remaining subgrids of the current level grid based on the distances between the subgrid where the last code is located and the subgrids at the upper right corner and the lower left corner of the current level grid: if the distance between the subgrid where the last code is located and the subgrid at the upper right corner of the current level grid is greater than the distance between the subgrid where the last code is located and the subgrid at the lower left corner of the current level grid, then the remaining subgrids are coded sequentially along the broken line starting from the subgrid at the upper right corner of the current level grid; otherwise, the remaining subgrids are coded sequentially along the broken line starting from the subgrid at the lower left corner of the current level grid. If the distance between the subgrid where the last code is located and the subgrid at the upper right corner of the current level grid is equal to the distance between the subgrid where the last code is located and the subgrid at the lower left corner of the current level grid, then the starting subgrid for coding is determined based on the similarity between the subgrid where the last code is located and the two subgrids.

[0083] Specifically, when performing the nth (3≤n≤Num1) level segmentation of F(x,y), first segment F(x,y) into n×n subgrids of equal area. After the nth level segmentation, the (n-1)×(n-1) subgrid in the upper left corner of the grid continues the coding order of the previous segmentation level, except that the segmentation level information is incremented by 1. The subgrid corresponding to the last coding is denoted as k0. The remaining uncoded subgrids are denoted as k1 for the upper right subgrid and k2 for the lower left subgrid.

[0084] like Figure 6 As shown, the grid is divided from level 2 to level 3, and the division result in the upper left corner and k0, k1, k2 are as follows Figure 5 As shown, the remaining sub-blocks are encoded in sequence along the broken line, and it is only necessary to determine whether the starting point is k1 or k2.

[0085] In this embodiment, the distances from k0 to k1 and k2 are calculated, denoted as dt1 and dt2, respectively, using the following formulas:

[0086]

[0087] In formula (6), (x0, y0) is the coordinate of the center point of k0 on F(x, y), (x1, y1) is the coordinate of the center point of k1 on F(x, y), and (x2, y2) is the coordinate of the center point of k2 on F(x, y).

[0088] Specifically, if dt1>dt2, the encoding sequence after k0 starts from k2 and ends at k1; if dt1<dt2, the encoding sequence after k0 starts from k1 and ends at k2.

[0089] Furthermore, if dt1=dt2, we need to calculate the similarity between k0 and the two sub-blocks, denoted as ds1 and ds2, using the following formula:

[0090]

[0091] In formula (7), α3 and α4 are preset parameters.

[0092] When ds1≥ds2, the encoding sequence after k0 starts from k1 and ends at k2; otherwise, the encoding sequence after k0 starts from k2 and ends at k1.

[0093] In step S150, when height segmentation encoding is performed in the target space area according to the size information, the initial height segmentation coefficient is calculated according to the preset parameters, and the calculated initial height segmentation coefficient is normalized to obtain the final segmentation coefficient. According to the final segmentation coefficient, the highest height that needs to be segmented in the target space area is segmented in order from bottom to top, such as the order of the lowest height sub-block is 1, and the order of the next height sub-block is 2, to obtain the height sub-block, and the height segmentation level and the order of the height sub-block are combined into a two-dimensional vector as the height grid code.

[0094] Specifically, the height is segmented, and the maximum height value that needs to be segmented is recorded as H. After the first level of segmentation, the result is still H.

[0095] Specifically, the height is divided into h (2≤h≤Num1) levels, and the entire height H is divided into h sub-blocks according to a certain rule. The initial division coefficient G1(x) is first calculated using the following formula:

[0096] G1(x)=ln{1+α5(x+1) 2} (8)

[0097] In formula (8), x∈{1,2,…,h}, α5 represents a preset parameter.

[0098] Next, the initial segmentation coefficient G1(x) is normalized to obtain the final segmentation coefficient G2(x) using the following formula:

[0099]

[0100] According to the final partitioning coefficient G2(x), the entire height H is partitioned from bottom to top. The height of each sub-block is G2(x)×H. That is, the height range of the first sub-block is [0, G2(1)×H), the height range of the second sub-block is [G2(1)×H, (G2(1)+G2(2))×H), and so on. The two-dimensional vector consisting of the partitioning level and the order of the sub-blocks is used as the height grid code.

[0101] Finally, in step S160, the plane grid code and the height grid code are combined to form a four-dimensional vector, which is the result of the entire grid coding. Then, a digital twin city is generated based on the result of the entire grid coding.

[0102] In this embodiment, the generation of a digital twin city based on the results of the entire grid coding includes, but is not limited to, spatial grid coding and compression algorithms, multi-scale modeling and layered processing, BIM and GIS integration, and 3D reconstruction technology. The specific implementation steps will not be repeated here.

[0103] In the aforementioned grid-segmentation coding method for generating digital twin cities, the planar area is first uniformly divided into four equal-sized sub-blocks. Next, an appropriate filling curve is selected for encoding using information such as horizontal and tilt information. Subsequent segmentation and encoding are performed based on the previous level, sequentially obtaining plane encoding results for all segmentation levels. Height is then non-uniformly segmented according to specific rules and grid-encoded for height. Finally, the plane grid code and height grid code are combined to form a four-dimensional vector, representing the overall grid encoding result. Finally, the digital twin city is generated based on this grid encoding. The proposed grid segmentation coding method for digital twin cities can select appropriate filling curves based on physical information. This encoding method has low redundancy and high accuracy, and has great practical value in the field of geographic information science.

[0104] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0105] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0106] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0107] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A method for generating a digital twin city based on grid segmentation coding, characterized in that: The method comprises: Get the target space area and its size information; Obtaining a maximum number of cutting levels according to the size information and a preset minimum cutting distance; The plane area of ​​the target space area is grid-segmented multiple times in sequence. When performing the second-level grid segmentation, an encoding method of the grid after segmentation is selected according to the horizontal and tilt information, and the second-level segmented grid is encoded using the selected grid encoding method. The encoding method of the grid after segmentation is selected according to the horizontal and tilt information, wherein the encoding method includes: representing each sub-grid in the new plane area after the second-level grid segmentation using the coordinates of its center point, calculating the mean and variance of the new plane area according to the coordinates of the center points of each sub-grid, and calculating the distribution coefficient and template size coefficient of the new plane area according to the mean and variance, constructing a horizontal template, a tilt template and a weight template according to the distribution coefficient and the template size coefficient, using the horizontal template and the tilt template and the weight template to perform a convolution operation on each sub-grid in the new plane area, respectively, to obtain a convolution result of each sub-grid corresponding to the horizontal template and the tilt template, respectively, comparing the sizes of the two convolution results on each sub-grid, and determining the encoding method according to the comparison results on all sub-grids; When performing grid segmentation at a level greater than level 2, fill the upper left corner area of ​​the current level grid with the code of the previous level grid. At the same time, determine the coding order of the remaining subgrids of the current level grid based on the distance between the subgrid where the last code of the area is located and the subgrids at the upper right corner and lower left corner of the current level grid, and then code the remaining subgrids according to the determined order. Until the maximum number of segmentation levels is reached, the grid segmentation and encoding of the plane region in the target space region are completed to obtain the plane grid encoding; Performing highly uneven segmentation coding in the target space region according to the size information to obtain a highly grid-coded image; A four-dimensional vector grid code of the target space area is obtained according to the plane grid code and the height grid code, and a corresponding digital twin city is generated based on the four-dimensional vector grid code.

2. The method for generating a digital twin city according to claim 1, characterized in that: Before obtaining the maximum number of segmentation levels based on the size information and the preset minimum segmentation distance, if the plane area shape of the target space area is not a square, the plane area is expanded outward to obtain a new square plane area, and grid segmentation and encoding are performed based on the new plane area.

3. The method for generating a digital twin city according to claim 2, characterized in that: When performing the second-level grid segmentation, there are two encoding methods that can be selected: The first method is to encode each subgrid in a clockwise order starting from the subgrid in the upper left corner; The second method is to encode each sub-grid in sequence along a "Z"-shaped path starting from the sub-grid located in the upper left corner.

4. The method for generating a digital twin city according to claim 3, characterized in that: The step of constructing a horizontal template, a tilt template, and a weight template according to the distribution coefficient and the template size coefficient includes: According to the template size coefficient, constructing an initial horizontal template and an initial tilted template of a square grid respectively, wherein the initial value of each grid in the initial horizontal template and the initial tilted template is 0; Constructing a first vector whose length is the template size coefficient and whose elements include distribution coefficients, and assigning values ​​to the initial horizontal template according to the first vector and the reverse vector of the first vector to obtain the horizontal template; Constructing a second vector whose length is the template size coefficient minus 1 and whose elements include the distribution coefficient, and assigning values ​​to the initial tilted template according to two tilted line segments preset in the initial tilted template, the second vector, and the reverse vector of the second vector to obtain the tilted template; The weight template is constructed according to pre-set parameters, the template size coefficient, and the distribution coefficient.

5. The method for generating a digital twin city according to claim 4, characterized in that: When determining the coding order of the remaining subgrids of the current level segmentation grid based on the distances between the subgrid where the last coding of the region is located and the subgrids at the upper right corner and the lower left corner of the current level segmentation grid: If the distance between the last coded subgrid and the subgrid at the upper right corner of the current level is greater than the distance between the last coded subgrid and the subgrid at the lower left corner of the current level, the remaining subgrids are coded in sequence along the broken line starting from the subgrid at the upper right corner of the current level. Otherwise, the remaining sub-grids are encoded in sequence along the broken line starting from the sub-grid at the lower left corner of the current level split grid; If the distance between the sub-grid where the last code is located and the sub-grid at the upper right corner of the current level split grid is equal to the distance between the sub-grid where the last code is located and the sub-grid at the lower left corner of the current level split grid, the starting sub-grid for coding is determined based on the similarity between the sub-grid where the last code is located and the two sub-grids.

6. The method for generating a digital twin city according to claim 5, characterized in that: When highly uneven segmentation encoding is performed in the target space region according to the size information: Calculate the initial height slicing coefficient according to the preset parameters, normalize the calculated initial height slicing coefficient, and obtain the final slicing coefficient; According to the final segmentation coefficient, the highest height that needs to be segmented in the target space area is segmented in order from bottom to top to obtain height sub-blocks, and the current order is assigned to the current height sub-block; The number of height segmentation levels and the order of height sub-blocks are combined into a two-dimensional vector as the height grid code.

Citation Information

Patent Citations

  • Digital twin city multi-scale space grid coding method and device

    CN110825831A

  • Geographic information gridding coding method, device and equipment based on adaptive segmentation

    CN118260371A