Grid segmentation coding-based digital twin city generation method

By using multiple grid segmentation and encoding methods in the generation of digital twin cities, selecting the appropriate encoding method and encoding sequence, the problems of high encoding complexity and redundancy in the existing technology are solved, and efficient data processing and Urban management.

CN119322811AActive Publication Date: 2025-01-17HUNAN INST OF ADVANCED TECH
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing grid segmentation encoding method has problems such as high encoding calculation complexity and redundancy in the generation of digital twin cities, resulting in low data indexing and query efficiency, and it is impossible to effectively process the spatial and temporal description diversity and data distribution of urban spatial data. spatial differences.

Method used

By obtaining the size information of the target space area, the maximum number of slicing stages is calculated based on the preset minimum slicing distance, multiple grid slicing and encoding methods are used to select the appropriate encoding method to encode the grid, and according to the distance and similarity Determine the encoding order of the sub-grid and generate four-dimensional vector grid encoding to improve efficiency.

Benefits of technology

It improves the efficiency of digital twin cities generation, can process massive data more efficiently, realizes refined management and real-time monitoring, and improves the overall performance and functions of digital twin cities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322811A_ABST
    Figure CN119322811A_ABST
Patent Text Reader

Abstract

The invention relates to a grid segmentation coding-based digital twin city generation method, device and equipment, and the method comprises the steps: obtaining a maximum segmentation level number according to size information and a preset minimum segmentation distance, and carrying out the second-level grid segmentation of a plane region of a target space region, selecting a coding mode of the segmented grids according to horizontal and inclined information to code the second-level segmented grids, and when grid segmentation is carried out on the level number larger than the second level, filling the upper left corner area of the current-level segmented grids with the codes of the upper-level grids, meanwhile, the coding sequence is determined according to the distances between the sub-grid where the last code of the region is located and the sub-grids located at the two vertex angles of the current-level segmentation grid respectively, the remaining sub-grids are coded until plane grid codes are obtained, height segmentation coding is carried out at the same time, and the coding sequence is determined according to the distance between the sub-grid where the last code of the region is located and the current-level segmentation grid. And finally, generating a corresponding digital twinborn city according to the plane grid codes and the height grid codes. By adopting the method, the digital twin city generation efficiency can be improved.
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] Digital twin city is the widespread application of digital twin technology at the city level. It uses data such as physical models, sensors, and operation history to integrate the entire simulation process of multiple disciplines, multiple physical quantities, multiple scales, and multiple probabilities, completes the mapping in the virtual space, and then reflects the entire life cycle of the corresponding physical equipment. By collecting, analyzing, and processing urban data, and using virtual simulation and 3D modeling technology to establish a digital twin city in the virtual space that corresponds to the physical city one by one and maps to each other, city managers can analyze urban problems more accurately and develop more targeted solutions, thereby providing more efficient and convenient public services to urban residents and comprehensively improving the quality of urban management.

[0003] However, in the practice of digital twin cities, the difficulty of urban data integration, association, and calculation has become a key technical bottleneck restricting development. Urban spatial data itself has the problem of spatiotemporal description diversity, and the existing CIS, BIM data and various human geography data are difficult to integrate and unify. The data on the activities of various objects and things in the city are even more complex, with a wide range of sources and diverse description formats. At present, urban grid management is the mainstream development direction for solving GIS spatial positioning, spatial retrieval mechanisms, etc. According to the idea of ​​multi-level grids of spatial information, the urban space is divided into grid units of a certain size according to certain rules to form multi-level grids of different levels, among which grid segmentation coding is the core technology.

[0004] Grid segmentation coding method is the basis and key to data indexing, querying and other calculations based on grid models. However, the existing coding methods have high coding calculation complexity, which is not conducive to the efficient indexing and querying of data, or do not consider the spatial differences in data distribution. As a result, a large amount of coding redundancy is usually generated when filling the space, which reduces the 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] According to the size information and the preset minimum segmentation distance, a maximum number of segmentation levels is obtained;

[0009] The plane area of ​​the target space area is divided into multiple grids in sequence, and when performing the second-level grid division, an encoding method of the grid after the division is selected according to the horizontal and tilt information, and the second-level grid division is encoded 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 segmentation grid with the previous level grid code, and determine the coding order of the remaining subgrids of the current level segmentation grid according to the distance between the subgrid where the last code of the area is located and the subgrids at the upper right corner and the lower left corner of the current level segmentation grid, and encode 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 area in the target space area 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 sub-grid in a clockwise order starting from the sub-grid located 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 of the grid after segmentation 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 a horizontal template, a tilted template, and a weighted template according to the distribution coefficient and the template size coefficient;

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

[0023] The sizes of the two convolution results on each sub-grid are compared, and the encoding method is determined according to the comparison results on all sub-grids.

[0024] In one embodiment, constructing a horizontal template, a tilted template, and a weighted template according to the distribution coefficient and the template size coefficient includes:

[0025] According to the template size coefficient, construct 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 the distribution coefficient, 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, 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 the preset 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 according to the distances between the subgrid where the last coding of the region is located and the subgrids located at the upper right corner and the lower left corner of the current level segmentation grid respectively:

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

[0031] Otherwise, the remaining sub-grids are encoded in sequence along the broken lines starting from the sub-grid at the lower left corner of the current level segmentation grid;

[0032] 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 segmentation 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 segmentation 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.

[0033] In one embodiment, when highly uneven segmentation encoding is performed in the target space region according to the size information:

[0034] 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;

[0035] According to the final segmentation coefficient, the highest height to be segmented in the target space region 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;

[0036] 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.

[0037] The above-mentioned digital twin city generation method based on grid segmentation coding obtains the maximum segmentation level according to the size information and the preset minimum segmentation distance. When the plane area of ​​the target space area is segmented into the second level grid, the second level segmentation grid is encoded according to the encoding method of the grid after segmentation selected by the horizontal and tilt information. When the grid segmentation is performed at a level greater than the second level, the previous level grid code is filled into the upper left corner area of ​​the current level segmentation grid. At the same time, the coding order of the remaining subgrids of the current level segmentation grid is determined according to the distance between the subgrid where the last code of the area is located and the subgrids located at the upper right corner and the lower left corner of the current level segmentation grid, and the remaining subgrids are encoded until the plane grid code is obtained, and the highly uneven segmentation coding is performed at the same time. Finally, the corresponding digital twin city is generated according to the plane grid code and the height grid code. The use of this method can improve the efficiency of generating digital twin cities. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of a process of generating a digital twin city based on grid segmentation coding in one embodiment;

[0039] Figure 2 A schematic diagram of a flow chart of a grid segmentation and encoding method for a digital twin city in an 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 A schematic diagram of the second-level segmentation encoding result in one embodiment;

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

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

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

[0046] Step S100, obtaining 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 meshed multiple times in sequence. When performing the second-level meshing, the encoding method of the mesh after the meshing is selected according to the horizontal and tilt information, and the second-level mesh is encoded using the selected mesh encoding method.

[0049] Step S130, when performing grid division at a level greater than level 2, fill the upper left corner area of ​​the current level 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 level 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 level 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 area in the target space area is completed to obtain the plane grid encoding.

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

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

[0053] Grid segmentation and coding is the most basic and critical step for the generation of digital twin cities, and 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 functions 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 in the actual operation process, such as Figure 2 As shown, they can also be processed sequentially.

[0054] In this method, the plane area is firstly evenly divided into four sub-grids of equal area, and then the appropriate filling curve is selected for encoding using information such as horizontality and inclination. 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 encoding and the height grid encoding are combined to form a four-dimensional vector, which is the result of the entire grid encoding.

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

[0056] In step S110, before obtaining the maximum number of segmentation levels according to 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.

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

[0058] Furthermore, let the maximum number of segmentation levels be Num1, the minimum segmentation distance be th1∈[10,20], and the segmentation be performed in an even manner. Then It can be calculated that Num1 = [W / th1], where [·] is a rounding operator.

[0059] In step S120, after the first level segmentation of the new plane area, the result is still F(x, y). Then the second level grid segmentation is performed on the new plane area F(x, y), that is, a 2x2 grid is obtained. When encoding it, a suitable 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 located in the upper left corner, that is, Figure 3 The second method is to encode each sub-grid in sequence along a "Z"-shaped path starting from the sub-grid 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, 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 tilted template and a weight template are constructed according to the distribution coefficient and the template size coefficient, and the horizontal template and the tilted template are used respectively, and the weight template is used to perform a convolution operation on each sub-grid in the new plane area to obtain the convolution results of each sub-grid corresponding to the horizontal template and the tilted template respectively, and finally the sizes of the two convolution results on each sub-grid are compared, and the encoding method is determined according to the comparison results on all sub-grids.

[0062] Specifically, we 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, the distribution coefficient λ and template size coefficient d of F(x,y) are calculated using the mean and variance 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 weight template according to the distribution coefficient and the template size coefficient includes: constructing an initial horizontal template and an initial inclined template of a square grid respectively according to the template size coefficient, the initial value of each grid in the initial horizontal template and the initial inclined template is 0, constructing a first vector with a length of the template size coefficient, whose elements include the distribution coefficient, and assigning the initial horizontal template according to the first vector and the reverse vector of the first vector to obtain a horizontal template. Then, constructing a second vector with a length of the template size coefficient minus 1, whose elements include the distribution coefficient, assigning the initial inclined template according to two inclined line segments preset in the initial inclined template, the second vector, and the reverse vector of the second vector to obtain the inclined template. Finally, constructing the weight template according to the 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 inclined template D2 are defined first, and their initial values ​​are both 0.

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

[0071] At the same time, a second vector vec2=[1,…,λ,λ,…,1] with a length of d-1 is defined, and the inclined template D2 is assigned a value according to the preset line segment, where line segment 1 and line segment 2 are parallel to the diagonal lines connecting the upper right corner and the lower left corner of the inclined template D2, and the two sides of the diagonal lines are processed 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 a 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. It can be seen from the constructed weight template D3 that the closer the distance to the template center (λ+1,λ+1) is, the greater the weight is, and vice versa.

[0075] Furthermore, the horizontal template D1 and the tilted template D2 are used to perform convolution operations on each subgrid in F(x,y) to obtain DF1 and DF2, and the formula is as follows:

[0076]

[0077] Next, compare the component values ​​of DF1 and DF2 in the same sub-grid. 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 Figure 5 (b) as shown.

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

[0082] In step S130, when determining the coding order of the remaining subgrids of the current level segmentation grid according to 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 respectively: if the distance between the subgrid where the last coding is located and the subgrid at the upper right corner of the current level segmentation grid is greater than the distance between the subgrid where the last coding is located and the subgrid at the lower left corner of the current level segmentation grid, then the remaining subgrids are coded in sequence according to the broken line starting from the subgrid at the upper right corner of the current level segmentation grid; otherwise, the remaining subgrids are coded in sequence according to the broken line starting from the subgrid at the lower left corner of the current level segmentation grid. If the distance between the subgrid where the last coding is located and the subgrid at the upper right corner of the current level segmentation grid is equal to the distance between the subgrid where the last coding is located and the subgrid at the lower left corner of the current level segmentation grid, then the starting subgrid for coding is determined according to the similarity between the subgrid where the last coding is located and the two subgrids.

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

[0084] like Figure 6 As shown, the grid segmentation from level 2 to level 3, the segmentation 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 according to 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 respectively, which are recorded as dt1 and dt2, and the formulas are as follows:

[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, it is necessary to calculate the similarity between k0 and the two sub-blocks, denoted as ds1 and ds2, and the formula is as follows:

[0090]

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

[0092] When ds1≥ds2, the encoding order after k0 starts from k1 and ends at k2, otherwise the encoding order 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 at the hth level (2≤h≤Num1), and the entire height H is divided into h sub-blocks according to a certain rule. The initial division coefficient G1(x) is calculated first, 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 segmentation coefficient G2(x), the entire height H is segmented from bottom to top, and 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 composed of the segmentation 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 into 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 result of the entire grid coding includes but is not limited to spatial grid coding and compression algorithms, multi-scale modeling and hierarchical processing, BIM and GIS integration, three-dimensional reconstruction technology, etc. The specific implementation steps will not be repeated here.

[0103] In the above-mentioned digital twin city generation method based on grid segmentation coding, the plane area is first evenly segmented to obtain four sub-blocks of equal area, and then the appropriate filling curve is selected for coding using information such as level and tilt. Subsequent segmentation coding is performed on the basis of the previous level, and the plane coding results of all segmentation levels are obtained in turn. Then, the height is non-uniformly segmented according to certain rules and the height grid coding is performed. Finally, the plane grid coding and the height grid coding are combined into a four-dimensional vector, which is the result of the entire grid coding. Finally, the digital twin city is generated based on the entire grid coding. In this method, the proposed grid segmentation coding method for digital twin cities can select the appropriate filling curve according to the physical information, and the coding method has low redundancy and high accuracy, which has good 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. Moreover, 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 can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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. As an illustration and not limitation, RAM is available in many 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 may 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-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached 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; According to the size information and the preset minimum segmentation distance, a maximum number of segmentation levels is obtained; The plane area of ​​the target space area is divided into multiple grids in sequence, and when performing the second-level grid division, an encoding method of the grid after the division is selected according to the horizontal and tilt information, and the second-level grid division is encoded using the selected grid encoding method; When performing grid segmentation at a level greater than level 2, fill the upper left corner area of ​​the current level segmentation grid with the previous level grid code, and determine the coding order of the remaining subgrids of the current level segmentation grid according to the distance between the subgrid where the last code of the area is located and the subgrids at the upper right corner and the lower left corner of the current level segmentation grid, and encode 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 area in the target space area 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 according to 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.

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 available: The first method is to encode each sub-grid in a clockwise order starting from the sub-grid located 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 encoding method of the segmented grid is selected as the first or second method according to the horizontal and tilt information, including: Each sub-grid in the new plane area after the second-level grid segmentation is represented by 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 subgrid, and calculating the distribution coefficient and template size coefficient of the new plane area according to the mean and method; Constructing a horizontal template, a tilted template, and a weighted template according to the distribution coefficient and the template size coefficient; Using the horizontal template and the tilted template and the weighted template to perform convolution operations on each subgrid in the new plane area, respectively, to obtain convolution results of each subgrid corresponding to the horizontal template and the tilted template; The sizes of the two convolution results on each sub-grid are compared, and the encoding method is determined according to the comparison results on all sub-grids.

5. The method for generating a digital twin city according to claim 4, characterized in that: The step of constructing a horizontal template, a tilted template, and a weighted template according to the distribution coefficient and the template size coefficient includes: According to the template size coefficient, construct 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 the distribution coefficient, 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, 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 the preset parameters, the template size coefficient, and the distribution coefficient.

6. The method for generating a digital twin city according to claim 5, characterized in that: When determining the coding order of the remaining subgrids of the current level segmentation grid according to 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 segmentation grid is greater than the distance between the last coded subgrid and the subgrid at the lower left corner of the current level segmentation grid, the remaining subgrids are encoded in sequence along the broken line starting from the subgrid at the upper right corner of the current level segmentation grid; Otherwise, the remaining sub-grids are encoded in sequence along the broken lines starting from the sub-grid at the lower left corner of the current level segmentation 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 segmentation 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 segmentation 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.

7. The method for generating a digital twin city according to claim 6, characterized in that: When highly uneven segmentation encoding is performed in the target space region 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 to be segmented in the target space region 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

  • Building information index construction method and equipment based on space grid

    CN114722047A

  • Construction method of digital twin system

    CN118171515A

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

    CN118260371A

  • System and method for geomodelling and pathfinding

    US20230015235A1