Map editing method and device
Patent Information
- Application Number
- CN202211475742.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-11-23
AI Technical Summary
[0003]现有技术中,目标对象在数字地图中的位置主要是基于人工确定的,这样的确定方式在数字地图的地图规模较小的情况下,是比较容易确定
[0011]本申请提供的地图编辑方法,获取初始地图对应的网格和对象创建请求,其中,网格中的网格单元记录有地理要素标识,对象创建请求携带目标对象与目标地理要素的预设关系,根据各网格单元的地理要素标识,以满足预设关系为探测目标,从随机网格单元开始进行探测,确定目标网格单元,其中,目标网格单元指示目标对象在初始地图中的创建位置。采用了网格单元随机探测的方法,自动确定了目标对象在初始地图中的创建位置,相比于人工确定的方法,提升了地图编辑效率并降低了地图编辑的成本;获取反映社会性的目标对象和目标地理要素之间的预设关系,并以满足预设关系为探测目标,进行探测,使得得到的目标网格单元具有与初始地图中的地理要素之间的社会性,更真实准确实现了对地图的编辑。
Smart Images

Figure CN115908636B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map data processing technology, and in particular to a map editing method. This application also relates to a map editing apparatus, a computing device, and a computer-readable storage medium. Background Technology
[0002] With the development of internet technology, more and more digital maps are being used, such as in game map scene building, and digital maps applied to logistics, construction engineering, and geographical science. These digital maps play an important role in people's production and life. Among them, accurately determining the location of the target object in the digital map has a significant impact on the editing and generation of the digital map.
[0003] In existing technologies, the location of a target object in a digital map is mainly determined manually. This method is relatively easy to use when the digital map is small in scale.
[0004] However, as the scale of digital maps grows, manual determination methods have led to inefficiencies and increased costs. Correspondingly, existing automatic determination methods, due to the high degree of randomness in their results, may fail to accurately reflect the social nature of target objects in scenarios with certain social requirements, such as rural towns and building clusters. Summary of the Invention
[0005] In view of this, embodiments of this application provide a map editing method to address the technical deficiencies in the prior art. Embodiments of this application also provide a map editing apparatus, a computing device, and a computer-readable storage medium.
[0006] According to a first aspect of the embodiments of this application, a map editing method is provided, including: Obtain the grid and object creation request corresponding to the initial map. The grid cells in the grid record geographic feature identifiers, and the object creation request carries the preset relationship between the target object and the target geographic feature. Based on the geographic feature identifiers of each grid cell, and with the preset relationship as the detection target, the detection starts from random grid cells to determine the target grid cell, where the target grid cell indicates the creation location of the target object in the initial map.
[0007] According to a second aspect of the embodiments of this application, a map editing apparatus is provided, comprising: The acquisition module is configured to acquire the grid and object creation request corresponding to the initial map. The grid cells in the grid record geographic feature identifiers, and the object creation request carries the preset relationship between the target object and the target geographic feature. The detection module is configured to detect targets based on the geographic feature identifiers of each grid cell and to start from random grid cells to determine the target grid cell, wherein the target grid cell indicates the creation location of the target object in the initial map.
[0008] According to a third aspect of the embodiments of this application, a computing device is provided, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions to implement the steps of the map editing method.
[0009] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the map editing method.
[0010] According to a fifth aspect of the present application, a chip is provided that stores a computer program, which, when executed by the chip, implements the steps of the map editing method.
[0011] The map editing method provided in this application obtains the grid and object creation request corresponding to the initial map. The grid cells record geographic feature identifiers, and the object creation request carries a preset relationship between the target object and the target geographic feature. Based on the geographic feature identifiers of each grid cell, and using the preset relationship as the detection target, probing begins from random grid cells to determine the target grid cell. The target grid cell indicates the creation location of the target object in the initial map. This method of random grid cell probing automatically determines the creation location of the target object in the initial map, improving map editing efficiency and reducing costs compared to manual determination. Furthermore, by obtaining the preset relationship between the target object and the target geographic feature, which reflects social dynamics, and using the preset relationship as the detection target, the resulting target grid cell possesses a social relationship with the geographic features in the initial map, achieving more realistic and accurate map editing. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the structure of a map editing system provided in one embodiment of this application; Figure 2 This is a flowchart of a map editing method provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a map editing method for virtual buildings in a game map, provided in one embodiment of this application. Figure 4This is a flowchart of a model generation method in a map editing method for virtual building settlements provided in an embodiment of this application; Figure 5 This is a flowchart illustrating a map editing method applied to virtual building settlements, provided in one embodiment of this application. Figure 6 This is a front-end display schematic diagram of a map editing method applied to virtual building settlements provided in an embodiment of this application; Figure 7 This is a flowchart illustrating a map editing method for virtual buildings, provided in one embodiment of this application. Figure 8 This is a schematic diagram of the structure of a map editing device provided in one embodiment of this application; Figure 9 This is a structural block diagram of a computing device provided in one embodiment of this application. Detailed Implementation
[0013] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0014] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.
[0015] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first.
[0016] This application provides a map editing method. This application also relates to a map editing apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0017] See Figure 1 , Figure 1The diagram illustrates the structure of a map editing system according to an embodiment of this application. The system may include a server 102 and multiple terminals 104. Communication connections can be established between the multiple terminals 104 via the server 102. In an online interactive scenario, the server 102 provides map editing services between the multiple terminals 104, which can act as either senders or receivers, achieving real-time communication through the server 102.
[0018] Users can interact with server 102 through terminal 104 to receive data sent by other terminals 204, or send data to other terminals 104, etc. In online interaction scenarios, users can send object creation requests to server 102 through terminal 104, and server 102 can return the target map after map editing to the client.
[0019] In this system, terminal 104 and server 102 establish a connection via a network. The network provides the medium for communication between the terminal and the server. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. The data transmitted by terminal 104 may need to undergo encoding, transcoding, compression, or other processing before being published to server 102.
[0020] Terminal 104 can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. Terminal 104 can be developed based on the corresponding service SDK (Software Development Kit) provided by the server, such as based on the RTC (Real-Time Communication) SDK. Terminal 104 can be deployed in electronic devices and depends on the device to run or on certain apps within the device. Electronic devices may have displays and support information browsing, such as personal mobile terminals like mobile phones, tablets, and personal computers. Various other types of applications can also be configured in electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email terminals, and social media platform software.
[0021] Server 102 may include servers that provide various services, such as servers that provide map editing services for multiple terminals, or servers that provide support for background map editing used on terminals.
[0022] It should be noted that server 102 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. Furthermore, the server can be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0023] It is worth noting that the methods provided in the embodiments of this application are generally executed by a server. However, in other embodiments of this application, the terminal may also have similar functions to the server, thereby executing the map editing method provided in the embodiments of this application. In other embodiments, the map editing method provided in the embodiments of this application may also be executed jointly by the terminal and the server.
[0024] Figure 2 The flowchart of a map editing method according to an embodiment of this application is shown, which specifically includes the following steps: Step S202: Obtain the grid and object creation request corresponding to the initial map. The grid cells in the grid record geographic feature identifiers, and the object creation request carries the preset relationship between the target object and the target geographic feature.
[0025] The embodiments of this application are applied to clients or servers with map editing functions. The embodiments of this application are applied to scenarios of game digital map editing, real digital map editing, and virtual map generation, and are not limited here.
[0026] The initial map is a digital map containing geographical features. It can be a two-dimensional digital map or a three-dimensional digital map. For example, it can be a pre-drawn game terrain map, a satellite map of a certain region, or a pre-created engineering planning terrain map. Geographical features are specific terrain features in the map. For example, mountainous areas, plains, and water areas in the game terrain map, mountainous areas, plains, and water areas in a satellite map of a certain region, and residential areas, commercial areas, and public facility areas in an engineering planning terrain map.
[0027] The grid corresponding to the initial map is the map grid obtained after dividing the initial map into grids. The division method can be uniform or non-uniform; no limitation is made here. Corresponding to the initial map, the grid division can be two-dimensional or three-dimensional. A grid consists of multiple grid cells, each with a specific location and geographic feature identifier. Each grid cell has unique location information within the grid, and any grid can record multiple geographic feature identifiers. For example, a satellite map of a certain region (latitude and longitude 120-123 degrees East, latitude and longitude 36-38 degrees North), divided into grids according to latitude and longitude in units of 0.01 degrees, yields 300 grids. There are 200 grid cells. For a grid cell with location information (176, 134), it records three geographic feature identifiers: (mountain, forest, and water). Optionally, when the grid is a two-dimensional grid, a corresponding two-dimensional mapping array is created to store the grid corresponding to the initial map; when the grid is a three-dimensional grid, a corresponding three-dimensional mapping array is created to store the grid corresponding to the initial map.
[0028] An object creation request is a user-sent request to create a target object on an initial map. The target object is a human geographical object to be created on the digital map, such as buildings in a game map, road infrastructure in a satellite map, or the foundation of an engineering planning topographic map. Target geographic features are geographic features that have a locational relationship with the target object; for example, a plain area for creating buildings in a game map, a mountainous area for creating wind power facilities in a satellite map, or a commercial area for creating a large shopping mall in an engineering planning topographic map. The preset relationship between the target object and the target geographic feature represents the locational relationship between them. For example, if the target object is a sewage treatment plant and the target geographic feature is a river, the sewage treatment plant has a locational relationship with the river: the sewage treatment plant is adjacent to the river. Preset relationships can reflect the social nature of the target object.
[0029] To obtain the grid corresponding to the initial map, specifically, obtain the grid corresponding to the initial map after it has been divided into grids.
[0030] To obtain the object creation request, specifically, obtain the object creation request sent by the user.
[0031] For example, the initial map is a pre-drawn game terrain map, and the game terrain map is subjected to 1000... The game terrain map is obtained by dividing it into 1000 grids. It consists of 1000 grid cells, each with specific location information {(Xi, Yi)1} i 1000} and geographic feature identifiers (mountain-0, plain-1, water-2, woodland-3, grassland-4), obtain the object creation request Build_Request sent by the user: {Target Item: village building; Target Geo-Ele: 1 & 2; Relation: "village building is located in a plain area and adjacent to a water area"}.
[0032] The system retrieves the grid and object creation requests corresponding to the initial map. The grid cells record geographic feature identifiers, and the object creation requests carry the preset relationship between the target object and the target geographic feature. This provides the foundation for subsequent random exploration of grid cells, including the basis for the exploration objects, the exploration index, and the exploration targets.
[0033] Step S204: Based on the geographic feature identifiers of each grid cell, and with the preset relationship as the detection target, start the detection from random grid cells to determine the target grid cell, wherein the target grid cell indicates the creation location of the target object in the initial map.
[0034] Based on the geographic feature identifiers of each grid cell, and with the preset relationship as the detection target, the detection starts from random grid cells. Specifically, the geographic feature identifiers of each grid cell are determined as the detection index, the corresponding location judgment conditions are determined according to the preset relationship, the detection starts from random grid cells, and the grid cells that meet the location judgment conditions are determined as the target grid cells.
[0035] For example, the geographic feature identifiers (mountain-0, plain-1, water-2, forest-3, grassland-4) of each grid cell are determined as the detection index. The corresponding location judgment condition is determined based on the preset relationship "villages are built in plain areas and adjacent to water areas": the geographic feature identifier of the target grid cell is 1, and the geographic feature identifier is 2 recorded in M network cells at a distance from the target cell. From the random grid cell Rand{(Xi, Yi)1 i 1000} begins probing, identifying the grid cell (Xt, Yt) that meets the location judgment conditions as the target grid cell.
[0036] In this embodiment, the grid and object creation request corresponding to the initial map are obtained. The grid cells record geographic feature identifiers, and the object creation request carries a preset relationship between the target object and the target geographic feature. Based on the geographic feature identifiers of each grid cell, and using the preset relationship as the detection target, detection begins from random grid cells to determine the target grid cell. The target grid cell indicates the creation location of the target object in the initial map. This method of random grid cell detection automatically determines the creation location of the target object in the initial map, improving map editing efficiency and reducing costs compared to manual determination. Furthermore, by obtaining the preset relationship between the target object and the target geographic feature, reflecting social dynamics, and using the preset relationship as the detection target, the obtained target grid cell possesses a social relationship with the geographic features in the initial map, resulting in more realistic and accurate map editing.
[0037] Optionally, obtaining the grid corresponding to the initial map in step S202 includes the following specific steps: Get the initial map; Create the initial grid corresponding to the initial map; Mark the geographic features on the initial map to obtain the geographic feature identifiers for each geographic feature; Map each geographic feature identifier to its corresponding grid cell in the initial grid.
[0038] The initial grid corresponding to the initial map is a grid obtained by simply dividing the initial map into grids. No geographic feature identifiers are recorded in the map grid cells of the initial grid.
[0039] Obtaining the initial map can be done by retrieving it from a remote database, retrieving it from a pre-created database, or receiving an initial map sent by the user; there is no specific limitation here.
[0040] To create the initial grid corresponding to the initial map, the initial map is divided into grids according to its size, resulting in the initial grid corresponding to the size of the initial map.
[0041] The geographic features on the initial map are marked to obtain the geographic feature identifiers of each geographic feature. Specifically, the geographic features on the initial map are marked according to the preset marking rules to obtain the geographic feature identifiers of each geographic feature.
[0042] The geographic feature identifiers are mapped to the corresponding grid cells in the initial grid. Specifically, the initial map and the initial grid are aligned, and the geographic feature identifiers are mapped to the corresponding grid cells in the initial grid.
[0043] For example, a pre-drawn game terrain map is retrieved from a remote game map database, based on the map size of 10000. 10000, adjust the game map by 1000. A grid of 1000 results in a map of size 10000. An initial grid of 10000, the initial grid is composed of 1000 It consists of 1000 grid cells. According to the preset marking rules: mountains-0, plains-1, water areas-2, woodlands-3, grasslands-4, the geographical features (mountains, plains, water areas, woodlands, grasslands) on the game's terrain map are marked to obtain the geographical feature identifiers of each geographical feature: (X1, Y1, 1), (X1, Y2, 0), (X1, Y3, 4)...(X1000, Y1000, 2).
[0044] The process involves acquiring an initial map, creating an initial grid corresponding to the initial map, marking geographic features on the initial map, obtaining geographic feature identifiers for each geographic feature, and mapping each geographic feature identifier to its corresponding grid cell in the initial grid. This provides a more accurate basis for subsequent random exploration of grid cells, including the basis for the exploration objects, the exploration index, and the exploration targets, ensuring the accuracy of subsequent exploration and improving the accuracy of identifying target grid cells.
[0045] Optionally, step S204 includes the following specific steps: Motion detection is performed using random grid cells as the detection starting point, according to preset motion parameters. Based on the geographic feature identifiers of the current grid cell detected, the fitness of the current grid cell is calculated using the fitness function corresponding to the preset relationship. Adjust the exercise parameters according to the fitness level; According to the adjusted motion parameters, motion detection is performed with the current grid cell as the detection starting point. Then, the process returns to the step of calculating the fitness of the current grid cell based on the geographic feature identifier of the current grid cell and using the fitness function corresponding to the preset relationship. When the detection target meets the preset relationship, the target network unit is obtained.
[0046] Motion parameters are parameters used for motion detection within the grid corresponding to the initial map. These can be motion speed, including direction and / or rate of motion, motion acceleration, including direction and / or magnitude of acceleration, or vibration frequency, etc., and are not limited here. In this embodiment, motion speed is used as an example for illustration.
[0047] Fitness is a reference value used to determine the locational relationship between a grid object and a target geographic feature. Fitness characterizes the degree of social interaction between the grid cell and the target geographic feature. For example, if the target object is a sewage treatment plant and the target geographic feature is a river, and the first grid cell is (X8, Y8), with three river grid cells as its neighbors, and the second grid cell is (X10, Y8), with one river grid cell as its neighbors, then the fitness of the first grid cell is higher than that of the second grid cell, indicating that the first grid cell has a higher degree of social interaction than the second. The fitness function is constructed based on the pre-defined relationship between the target object and the target geographic feature, and it is a function that calculates fitness based on the current grid cell's location.
[0048] The detection target is a pre-set detection termination condition corresponding to a preset relationship. This condition can be the number of times the motion parameters are adjusted, the fitness threshold, or the condition for detecting the distribution of grid cells. No restrictions are imposed here.
[0049] According to the preset motion parameters, motion detection is carried out with random grid cells as the detection starting point. Specifically, a particle swarm is generated, and each particle in the particle swarm is assigned preset motion parameters and random grid cells as the detection starting point. The particle swarm is then run to perform motion detection based on the motion parameters.
[0050] Based on the geographic feature identifier of the current grid cell detected by each particle, the fitness of the current grid cell is calculated using the fitness function corresponding to the preset relationship. Specifically, based on the geographic feature identifier of the current grid cell detected by each particle, the fitness of the current grid cell detected by each particle is calculated using the fitness function corresponding to the preset relationship.
[0051] Based on fitness, the motion parameters are adjusted. Specifically, the motion parameters of each particle are adjusted according to fitness so that the fitness of the grid cells detected by each particle is improved.
[0052] For example, a particle swarm (P1-Pn) is generated, and each particle Pi in the swarm is assigned preset motion parameters {motion direction (Xvi_1, Yvi_1) and motion speed vi_1} and a random grid cell (Xi, Yi) as the detection starting point. The particle swarm (P1-Pn) is run to detect motion based on the motion parameters {motion direction (Xvi_1, Yvi_1) and motion speed vi_1}. Based on the geographic feature identifier of the current grid cell (Xi_1, Yi_1) detected by each particle Pi, the fitness function F(Xi_1, Yi_1) corresponding to the preset relationship is used to calculate the fitness Ai_1 of the current grid cell detected by each particle swarm. Based on the fitness Ai_1, the motion parameters {motion direction (Xvi_1, Yvi_1) and motion speed vi_1} of each particle are adjusted, and the current grid cell (Xvi_1, Yvi_1) is set to the next specified value. i_1, Yi_1) are set as the detection starting point. The particle swarm is run to detect motion according to the motion parameters {motion direction (Xvi_2, Yvi_2) and motion speed vi_2}. The above steps are repeated. When the fitness At of the current grid cell (Xt, Yt) detected by each particle satisfies the preset fitness threshold Ex (At), the target grid cell (Xt, Yt) is obtained.
[0053] According to preset motion parameters, motion detection is performed starting from random grid cells. Based on the geographic feature identifier of the currently detected grid cell, the fitness of the current grid cell is calculated using the fitness function corresponding to the preset relationship. Based on the fitness, the motion parameters are adjusted. Motion detection is then performed again starting from the current grid cell, following the adjusted motion parameters. The process returns to the previous step of calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell using the fitness function corresponding to the preset relationship. When the detection target that satisfies the preset relationship is achieved, the target network cell is obtained. This method of random motion detection of grid cells automatically determines the creation location of the target object in the initial map. Compared with manual determination methods, this not only improves map editing efficiency and reduces map editing costs, but also provides greater randomness and traceability. Adjusting the motion parameters based on fitness ensures that the obtained target grid cells can more accurately represent the preset relationship between the target object and the target geographic features. The resulting target grid cells possess a social relationship with the geographic features in the initial map, achieving more realistic and accurate map editing.
[0054] Optionally, the number of random grid cells can be multiple; Correspondingly, the motion parameters are adjusted according to fitness, including the following specific steps: Based on the fitness of each grid cell on the first detection path, a local reference grid cell whose fitness reaches the first fitness threshold is determined, wherein the first detection path is a path composed of grid cells detected from any random grid cell. Based on the fitness of the local reference grid cells on each detection path, determine the global reference grid cells whose fitness reaches the second fitness threshold; Adjust motion parameters based on the position information of the current grid cell, the position information of the local reference grid cell, and the position information of the global reference grid cell.
[0055] In this embodiment, motion detection can be started from multiple random grid cells, which improves the efficiency of detection.
[0056] A detection path is a path consisting of the detected grid cells starting from a random grid cell. The first detection path is a path consisting of the detected grid cells starting from any random grid cell. For example, if the detected grid cells starting from random grid cell (X102, Y37) are {(X104, Y40), (X105, Y41), (X108, Y44) ... (X118, Y57)}, then the first detection path is (X104, Y40) - (X105, Y41) - (X108, Y44) ... - (X118, Y57). Optionally, a local result array can be created to store the grid cells on each detection path, with a separate local result array created for each detection path.
[0057] The first fitness threshold is a pre-set fitness threshold for each grid cell on the first detection path. A grid cell that reaches the first fitness threshold indicates that it has high social interaction with the target geographic feature. The second fitness threshold is a pre-set fitness threshold for each grid cell detected on each detection path. A grid cell that reaches the second fitness threshold indicates that it has high social interaction with the target geographic feature. The second fitness threshold is higher than the first fitness threshold. The first fitness threshold can be a fitness-specific threshold or the number of grid cells arranged from highest to lowest fitness. The second fitness threshold can also be a fitness-specific threshold or the number of grid cells arranged from highest to lowest fitness.
[0058] The local reference grid cell is the detected grid cell on the first detection path that has reached the first fitness threshold. There can be one or more local reference grid cells. The global reference grid cell is the detected grid cell on each detection path that has reached the second fitness threshold. There can be one or more global reference grid cells. Optionally, a corresponding global result array is created to store the global reference network.
[0059] Based on the position information of the current grid cell, the local reference grid cell, and the global reference grid cell, motion parameters are adjusted. Specifically, local adjustment factors are determined based on the position information of the current grid cell and the local reference grid cell, and global adjustment factors are determined based on the position information of the current grid cell and the global reference grid cell. Motion parameters are then adjusted based on both local and global adjustment factors. Local adjustment factors ensure that the first detection path retains more of its local characteristics in subsequent motion detection, while global adjustment factors ensure that the first detection path references more of the global characteristics of each detection path in subsequent motion detection. The significant effect of local adjustment factors makes subsequent detection paths more discrete, while the significant effect of global adjustment factors makes subsequent detection paths more clustered around the global reference grid cell. Furthermore, the adjustment of motion parameters based on local and global adjustment factors is performed according to Formula 1. Formula 1 is as follows.
[0060] Formula 1 in, This indicates the adjusted motion parameters. This indicates the motion parameters before adjustment. This indicates the location information of the local reference mesh cell. This indicates the position information of the global reference grid cells. Indicates the position information of the current grid cell. Indicates local adjustment factors. This indicates factors that influence overall adjustments.
[0061] For example, based on the fitness of each grid cell on the first detection path, a local reference grid cell Pbest with a fitness level reaching a first fitness threshold is determined; based on the fitness of the local reference grid cells on each detection path, a global reference grid cell Gbest with a fitness level reaching a second fitness threshold is determined; and based on the position information of the current grid cell... and the location information of local reference grid cells Determine local adjustment factors Based on the current grid cell location information and the position information of the global reference grid cells Determine global adjustment factors Using Formula 1, based on local adjustment factors and global adjustment factors Adjust the motion parameter V.
[0062] Based on the fitness of each grid cell along the first detection path, local reference grid cells whose fitness reaches a first fitness threshold are determined. The first detection path is a path composed of grid cells detected starting from any random grid cell. Based on the fitness of the local reference grid cells along each detection path, global reference grid cells whose fitness reaches a second fitness threshold are determined. Motion parameters are adjusted based on the position information of the current grid cell, the local reference grid cells, and the global reference grid cells. This adjustment of motion parameters considers global features while retaining the local features of the detection trajectory itself, allowing motion detection to more realistically and accurately represent social aspects. The resulting target grid map better reflects the social relationships between the target and the geographic elements in the initial map, thus enabling more realistic and accurate map editing.
[0063] Optionally, before adjusting the motion parameters based on the position information of the current mesh cell, the position information of the local reference mesh cell, and the position information of the global reference mesh cell, the following specific steps are also included: Set and adjust weights based on the pre-defined distribution sparsity for the target object; Correspondingly, based on the position information of the current grid cell, the position information of the local reference grid cell, and the position information of the global reference grid cell, the motion parameters are adjusted, including the following specific steps: Based on the position information of the current grid cell, the position information of the local reference grid cell, and the position information of the global reference grid cell, the motion parameters are adjusted according to the adjustment weights.
[0064] The target object distribution sparsity is the degree of sparseness among the locations where the target objects are created on the initial map. For example, if the target object is a village of 10 households within 40 grid cells, its distribution sparsity is 0.25 target objects per grid cell.
[0065] The adjustment weight is the weight used to adjust the motion parameters, including local adjustment weight and global adjustment weight. Optionally, the adjustment weight also includes inertial adjustment weight, which is the adjustment weight of the motion parameters. By setting the corresponding inertial adjustment weight, the motion characteristics of the motion detection before adjustment can be preserved.
[0066] Based on the location information of the current grid cell, the local reference grid cell, and the global reference grid cell, the motion parameters are adjusted according to the adjustment weights. Specifically, local adjustment factors are determined based on the location information of the current grid cell and the local reference grid cell; global adjustment factors are determined based on the location information of the current grid cell and the global reference grid cell; and the motion parameters are adjusted based on the local adjustment factors and their weights, as well as the global adjustment factors and their weights. The adjustment of the motion parameters based on the local adjustment factors and their weights, as well as the global adjustment factors and their weights, is performed according to Formula 2. Formula 2 is as follows.
[0067] Formula 2 Among them, among them, This indicates the adjusted motion parameters. This indicates the motion parameters before adjustment. This indicates the location information of the local reference mesh cell. This indicates the position information of the global reference grid cells. Indicates the position information of the current grid cell. Indicates local adjustment factors. Indicates global adjustment factors. This indicates a local adjustment of the weights. This indicates a global adjustment of weights.
[0068] Furthermore, the motion parameters are adjusted based on local adjustment factors and weights, global adjustment factors and weights, and inertial adjustment weights. This adjustment of motion parameters, based on formula 3, is as follows.
[0069] Formula 3 Among them, among them, This indicates the adjusted motion parameters. This indicates the motion parameters before adjustment. This indicates the location information of the local reference mesh cell. This indicates the position information of the global reference grid cells. Indicates the position information of the current grid cell. Indicates local adjustment factors. Indicates global adjustment factors. This indicates a local adjustment of the weights. This indicates a global adjustment of weights. This indicates the inertia adjustment weight.
[0070] In this embodiment, the motion parameter is essentially a velocity vector, and Formulas 2 and 3 are essentially composite formulas of multiple velocity vectors with specific directions. By considering the corresponding characteristics of the local reference grid cells of the first detection path and the global reference grid cells of each detection path, the adjusted velocity vector can represent both local and global features, enabling motion detection to more realistically and accurately represent social characteristics. This makes the obtained target grid map more socially relevant to the geographical elements in the initial map, and more realistically and accurately realizes map editing. At the same time, the adjustment weight is set according to the distribution sparsity to make the motion detection load the distribution requirements of the target grid cells.
[0071] For example, based on a preset distribution density for the target objects: 0.3 target objects are distributed in each grid cell, the local adjustment weight is set to 0.3, the global adjustment weight is 0.4, and the inertial adjustment weight is 0.3, based on local adjustment factors. Local adjustment weight 0.3, global adjustment factor With a global adjustment weight of 0.4 and an inertial adjustment weight of 0.3, the motion parameter V is adjusted using Formula 3.
[0072] Based on the preset distribution sparsity for the target object, adjustment weights are set. Motion parameters are then adjusted according to the location information of the current grid cell, the local reference grid cell, and the global reference grid cell, following these weights. This allows motion detection to more realistically and accurately represent social aspects, resulting in a target grid map that better reflects the social relationships between geographic elements and the initial map. This enables more realistic and accurate map editing. Furthermore, setting adjustment weights based on distribution sparsity ensures that motion detection is tailored to the distribution requirements of the target grid cells, improving the adaptability and specificity of the target grid cells.
[0073] Optionally, after determining the global reference grid cells whose fitness reaches the second fitness threshold based on the fitness of the local reference grid cells on each detection path, the following specific steps are also included: Output global reference mesh cells.
[0074] Since the global reference grid cell is a grid cell determined from each probe path based on a second fitness threshold, it can represent the grid cell in the initial map that best satisfies the preset relationship. However, if motion parameters are adjusted solely based on the positional information of the global reference grid cell, all probe paths will rapidly converge towards the global reference grid cell, failing to fully represent the social relationships with geographic features in the initial map. Nevertheless, it can determine the central target object to be placed. For example, if the target object is a town, and the central target object is a town activity square, the town activity square can be positioned within the global reference grid cell. Furthermore, if multiple global reference grid cells exist, the positional relationships between neighboring target grid cells can be represented through the positional relationships between the global reference grid cells.
[0075] Optionally, motion detection is performed using random grid cells as the detection starting point according to preset motion parameters, including the following specific steps: Motion detection is performed using random grid cells as the detection starting point, based on preset motion parameters and preset detection range. Based on the geographic feature identifiers of the current grid cell, the fitness of the current grid cell is calculated using the fitness function corresponding to the preset relationship, including the following specific steps: Based on the geographic feature identifiers of the current grid cell and the geographic feature identifiers of neighboring grid cells, the grid cell corresponding to the target geographic feature is determined, where the neighboring grid cells are grid cells within the preset detection range of the current grid cell. The fitness of the current grid cell is determined based on the number of grid cells corresponding to the target geographic feature, and the total number of the current grid cell and its neighboring grid cells.
[0076] The detection range is a pre-defined range for motion detection of neighboring grid cells of the current grid cell. For example, if the current grid cell is (X100, Y100) and the detection range is 10, then during motion detection, a total of 100 grid cells from (X90, Y90) to (X110, Y110) will be detected.
[0077] The fitness of the current grid cell is determined based on the number of grid cells corresponding to the target geographic feature and the total number of the current grid cell and its neighboring grid cells. Specifically, the fitness of the current grid cell is determined by the ratio between the number of grid cells corresponding to the target geographic feature and the total number of the current grid cell and its neighboring grid cells. Furthermore, the fitness of the current grid cell is defined as the ratio between the number of grid cells corresponding to the target geographic feature and the total number of the current grid cell and its neighboring grid cells.
[0078] For example, the target geographic feature is water area-2, and according to preset motion parameters and preset detection range: 10, it is detected using random grid cells Rand{(Xi, Yi)1 i Motion detection is performed starting from 1000, based on the geographic feature identifier of the current grid cell (Xi, Yi) and the neighboring grid cells (Xi). Yi The geographic feature identifier is used to determine the grid cell corresponding to the target geographic feature (water area-2). The number of grid cells corresponding to the target geographic feature (water area-2), 34, is then compared with the current grid cell (Xi, Yi) and the neighboring grid cells (Xi). Yi The ratio of 0.34 between the total number of 100 cells is determined as the fitness of the current grid cell (Xi, Yi).
[0079] Based on preset motion parameters and a preset detection range, motion detection is performed starting from random grid cells. The grid cell corresponding to the target geographic feature is determined based on the geographic feature identifiers of the currently detected grid cell and neighboring grid cells. Neighboring grid cells are those within the preset detection range of the current grid cell. The fitness of the current grid cell is determined based on the number of grid cells corresponding to the target geographic feature, and the total number of the current and neighboring grid cells. Accurately obtaining the fitness ensures the accuracy of adjusting the motion parameters and, consequently, the accuracy of subsequently obtained target grid cells.
[0080] Optionally, after obtaining the target network unit when a detection target satisfying a preset relationship is reached, the process further includes: Adjust the preset motion parameters and preset detection range, and return to execute the steps of motion detection based on the preset motion parameters and preset detection range, with random grid cells as the detection starting point.
[0081] If the detection range is set too small, the current grid cell needs to be close enough to the target geographic feature, resulting in high adaptability. However, excessive adjustment of motion parameters leads to overly clustered target grid cells. Conversely, if the detection range is set too large, the current grid cell needs to be close enough to the target geographic feature, resulting in low adaptability. This makes it difficult to adjust motion parameters, leading to overly dispersed target grid cells.
[0082] Since the detection range setting determines the location of the target grid cells obtained subsequently, it is difficult to guarantee that a single motion detection can obtain target grid cells that accurately represent the social relationship between the target grid cells and the geographic elements in the initial map. It is necessary to adjust the preset motion parameters and preset detection range to conduct multiple detections so that the obtained target grid cells accurately represent the social relationship between the target grid cells and the geographic elements in the initial map, thus achieving more realistic and accurate map editing.
[0083] Optionally, step S204 includes the following specific steps: According to the preset number of iterations, based on the geographic feature identifiers of each grid cell and with the preset relationship as the detection target, the detection starts from random grid cells and obtains the target grid cells obtained in each iteration; The target mesh cells obtained in each iteration are integrated.
[0084] By setting a preset number of iterations, the target grid cells obtained in each iteration can be obtained and integrated, making it possible to obtain more complete grid cells from random grid cell detection. This increases the number of target grid cells determined subsequently, thereby improving the adaptability and efficiency of map editing.
[0085] The preset number of iterations is the number of iterations to be detected in advance.
[0086] The target grid cells obtained in each iteration are integrated. Specifically, the target grid cells obtained in each iteration are integrated according to preset integration conditions. After multiple iterations, the target grid cells detected in later iterations have a higher social relevance to the map features in the initial map. By integrating multiple target grid cells with later iterations according to preset integration conditions, the number and social relevance of target grid cells are increased.
[0087] For example, following a preset iteration count of 5, based on the geographic feature identifiers of each grid cell and using a preset relationship as the detection target, detection begins from a random grid cell (Xi, Yi), obtaining the target grid cells {(X524, Y478), (X547, Y495), (X571, Y506), (X589, Y514), (X597, Y526)} and {(X186, Y247), (X348, Y412), (X436, Y477), (X549, Y504), ... {(X588, Y520)}; {(X89, Y742), (X360, Y678), (X485, Y609), (X536, Y541), (X577, Y511)}, according to the preset integration conditions: the latter two target mesh units, the target mesh units obtained in each iteration are integrated to obtain the target mesh units: (X589, Y514), (X597, Y526), (X549, Y504), (X588, Y520), (X536, Y541), (X577, Y511).
[0088] Following a preset number of iterations, and based on the geographic feature identifiers of each grid cell, the system probes from random grid cells, targeting pre-defined relationships. This process obtains the target grid cells for each iteration and then integrates them. This increases the number of target grid cells and their social relationship with geographic features in the initial map.
[0089] Optionally, the target mesh cells obtained in each iteration are integrated, including the following specific steps: Determine the target extraction quantity based on the target object's attribute information; Extract multiple target grid cells that meet the target extraction quantity on each detection path obtained in each iteration. The detection path consists of grid cells detected starting from random grid cells. The extracted target mesh cells are deduplicated.
[0090] The attribute information of the target object is its location distribution attribute information. For example, if the target object is a village, the location distribution attribute information of the target village is: diameter 3 grid cells. The target extraction quantity is the number of target grid cells extracted from the integrated target.
[0091] The number of targets to be extracted is determined based on the attribute information of the target object. Specifically, the number of targets to be extracted is determined based on the location distribution attribute information of the target object.
[0092] The extracted target mesh cells are deduplicated. Specifically, the deduplication process is performed on the target mesh cells based on their location information.
[0093] For example, based on the target object's location distribution attribute information: diameter 3 grid cells, the target extraction quantity is determined to be 3. The 3 target grid cells that meet the target extraction quantity on each detection path obtained in each iteration are extracted, and the location information of the 3 target grid cells is compared to remove target grid cells with duplicate location information.
[0094] Based on the target object's attribute information, the target extraction quantity is determined. Multiple target grid cells satisfying this quantity are extracted from each detection path obtained in each iteration. The detection path consists of grid cells detected starting from random grid cells. The extracted target grid cells are then deduplicated. This process better corresponds to the target object's attribute information, extracts a specific number of target grid cells, and thus more accurately represents the social relationship between the target and geographical features in the initial map.
[0095] Optionally, after step S204, the following specific steps are also included: Obtain the model data of the target object; Based on the target grid cell, determine the corresponding target rendering location in the initial map; Based on the model data, the target object is rendered at the target rendering location of the initial map to obtain the target map.
[0096] The target object's model data consists of a pre-built visualization of the target object on the initial map. This model data includes the model's dimensions, texture data, and more.
[0097] The target rendering location is the location in the initial map corresponding to the target grid cell.
[0098] Obtaining model data for a target object can be done by retrieving it from a remote model database or by retrieving it from a local model database.
[0099] Based on the model data, the target object is rendered at the target rendering location of the initial map to obtain the target map. Specifically, based on the model data, the renderer is used to render the target object at the target rendering location of the initial map to obtain the target map.
[0100] Based on the model data, the target object is rendered at the target rendering location of the initial map to obtain the target map. Specifically, based on the model data, the renderer is used to render the target object at the target rendering location of the initial map to obtain the target map.
[0101] For example, the initial map is a pre-drawn game terrain map, the target object is village buildings, the model data of village buildings is obtained from the local model database, and the village buildings are rendered at the target rendering location of the game terrain map to obtain the game map.
[0102] The process involves acquiring model data of the target object, determining its corresponding rendering location on the initial map based on the target grid cells, and then rendering the target object at that location on the initial map using the model data to obtain the target map. This approach imbues the rendered target object model with a social relationship with the geographic features on the map, enabling more accurate map editing and improving its efficiency.
[0103] The following is in conjunction with the appendix Figure 3 Taking the application of the map editing method provided in this application to virtual buildings in a game map as an example, the map editing method will be further explained. Among other things, Figure 3 This application provides a flowchart illustrating a map editing method for virtual buildings in a game map, according to an embodiment of the present application. The method specifically includes the following steps: Step S302: Obtain a pre-drawn game terrain map and create an initial grid corresponding to the game terrain map; The game's terrain map includes geographical features such as water and plain areas, and its size is 16. 16. The initial grid contains the number of grid cells corresponding to the size of the game terrain map.
[0104] Step S304: Mark the geographic features on the game terrain map, obtain the geographic feature identifiers of each geographic feature, and map each geographic feature identifier to the corresponding grid cell in the initial grid; Step S306: Receive a virtual building creation request input by the user, wherein the virtual building creation request carries a preset relationship between the virtual building and the target geographic feature; The default relationship between virtual buildings and target geographic features is "generate virtual buildings on plains areas near water areas".
[0105] Step S308: Determine the corresponding position judgment conditions according to the preset relationship, and generate a fitness function based on the position judgment conditions; The location determination criteria are: the grid cell records the geographic feature identifiers of the plain area, and the grid cell has the geographic feature identifiers of the water area within n neighboring grid cells.
[0106] Step S310: Perform motion detection using random grid cells as the detection starting point, according to the preset number of iterations, speed, and detection range; The preset number of iterations is 3, the preset speed is 0, and the detection range is n.
[0107] Step S312: Determine the grid cell corresponding to the target geographic feature based on the geographic feature identifier of the current grid cell and the geographic feature identifiers of neighboring grid cells. Step S314: Determine the fitness of the current grid cell based on the number of grid cells corresponding to the target geographic feature and the total number of the current grid cell and neighboring grid cells; Step S316: Determine the target extraction quantity based on the attribute information of the virtual building; The maximum diameter of the virtual building is 3, which corresponds to the number of targets to be extracted being 3.
[0108] Step S318: Adjust the motion parameters and reduce the detection range, then return to the step of motion detection with random grid cells as the detection starting point according to the preset number of iterations, speed and detection range. Extract multiple target grid cells that meet the target extraction requirements on each detection path obtained in each iteration. Step S320: Perform deduplication on the extracted target mesh cells to obtain the target mesh cells; Step S322: Obtain the model data of the virtual building; Step S324: Determine the corresponding target rendering location in the initial map based on the target grid cell; Step S326: Based on the model data of the virtual building, render the virtual building at the target rendering location of the initial map to obtain the game map.
[0109] In this embodiment, a grid cell random detection method is used to automatically determine the creation location of virtual buildings on the game terrain map. Compared with the manual determination method, this improves map editing efficiency and reduces map editing costs. The method obtains the preset relationship between virtual buildings that reflect social relationships and target geographic elements, and uses the preset relationship as the detection target to perform detection. This makes the obtained target grid cells have social relationships with geographic elements in the game terrain map, and more realistically and accurately realizes the editing of the game map.
[0110] Figure 4 The flowchart illustrates a model generation method in a map editing method for virtual building settlements provided in an embodiment of this application.
[0111] like Figure 4 As shown, the process first generates a grid corresponding to the initial map, then preprocesses the initial map, marks and stores geographic features, then generates a particle swarm and a fitness function, then inputs the fitness function into the particle swarm, then inputs motion parameters and adjusts weights into the particle swarm, and finally runs the particle swarm.
[0112] Figure 5A flowchart illustrating a map editing method for virtual building settlements provided in an embodiment of this application is shown.
[0113] like Figure 5 As shown, first, the model data of the target object is obtained, then the grid with geographic feature identifiers is obtained, then the grid with geographic feature identifiers is input into the model data, and finally the model data is run to generate the target map.
[0114] Figure 6 This illustration shows a front-end display diagram of a map editing method applied to virtual building settlements according to an embodiment of this application; like Figure 6 As shown, in the grid corresponding to the initial map, the grid cell marked "2" is the grid cell in the grid corresponding to the initial map whose geographic feature is identified as 2 (water area); the grid cell marked "A" is the target grid cell determined from the exploration path of the first iteration, and the grid cell marked "A*" is the global reference grid cell with the best fitness determined from the exploration path of the first iteration; the grid cell marked "B" is the target grid cell determined from the exploration path of the second iteration, and the grid cell marked "B*" is the global reference grid cell with the best fitness determined from the exploration path of the second iteration; the grid cell marked "C" is the target grid cell determined from the exploration path of the third iteration, and the grid cell marked "C*" is the global reference grid cell with the best fitness determined from the exploration path of the third iteration.
[0115] Figure 7 A flowchart illustrating a map editing method for virtual buildings according to an embodiment of this application is shown. like Figure 7 As shown, after starting, prepare the initial map, create a two-dimensional mapping array of geographic feature mapping grids, then collect map water and land information and create markers, store the markers in the two-dimensional mapping array, create a particle swarm, set the fitness function and number of iterations, set parameter combinations, run the particle swarm, obtain the position of each particle and store it in a local result array (local result array 1, local result array 2, ..., local result data n), after convergence, obtain the global result and store it in the global result array, adjust the original fitness function, gradually reduce the number of n until the preset number of iterations n>0 converges, check if the preset number of iterations n>0, if so, recreate the particle swarm and continue execution, if not, truncate, deduplicate and merge the results, modify the corresponding local result array, then map the local result array and store it in the two-dimensional mapping array, and end.
[0116] Corresponding to the above method embodiments, this application also provides a map editing device embodiment. Figure 8A schematic diagram of the structure of a map editing device according to an embodiment of this application is shown. Figure 8 As shown, the device includes: The acquisition module 802 is configured to acquire the grid and object creation request corresponding to the initial map. The grid cells in the grid record geographic feature identifiers, and the object creation request carries the preset relationship between the target object and the target geographic feature. The detection module 804 is configured to detect from random grid cells based on the geographic feature identifiers of each grid cell and to determine the target grid cell by satisfying a preset relationship. The target grid cell indicates the creation location of the target object in the initial map.
[0117] Optionally, the acquisition module 802 is further configured as follows: Obtain the initial map; create the initial grid corresponding to the initial map; mark the geographic features on the initial map to obtain the geographic feature identifiers of each geographic feature; map each geographic feature identifier to the corresponding grid cell in the initial grid.
[0118] Optionally, the detection module 804 is further configured as follows: According to preset motion parameters, motion detection is performed starting from random grid cells. Based on the geographic feature identifier of the current grid cell, the fitness of the current grid cell is calculated using the fitness function corresponding to the preset relationship. Based on the fitness, the motion parameters are adjusted. According to the adjusted motion parameters, motion detection is performed starting from the current grid cell, and the process returns to the step of calculating the fitness of the current grid cell based on the geographic feature identifier of the current grid cell using the fitness function corresponding to the preset relationship. If the detection target that satisfies the preset relationship is achieved, the target network cell is obtained.
[0119] Optionally, the number of random grid cells can be multiple; Correspondingly, the detection module 804 is further configured as follows: Based on the fitness of each grid cell on the first detection path, local reference grid cells whose fitness reaches the first fitness threshold are determined, wherein the first detection path is a path composed of grid cells detected from any random grid cell; based on the fitness of local reference grid cells on each detection path, global reference grid cells whose fitness reaches the second fitness threshold are determined; and motion parameters are adjusted based on the position information of the current grid cell, the position information of the local reference grid cells, and the position information of the global reference grid cells.
[0120] Optionally, the device further includes: The weight adjustment module is configured to set adjustment weights based on the preset distribution sparsity for the target object; Correspondingly, the detection module 804 is further configured as follows: Based on the position information of the current grid cell, the position information of the local reference grid cell, and the position information of the global reference grid cell, the motion parameters are adjusted according to the adjustment weights.
[0121] Optionally, the device further includes: The output module is configured to output global reference mesh elements.
[0122] Optionally, the detection module 804 is further configured as follows: According to preset motion parameters and preset detection range, motion detection is carried out with random grid cells as the detection starting point; based on the geographic feature identifiers of the current grid cell and the geographic feature identifiers of neighboring grid cells, the grid cell corresponding to the target geographic feature is determined, wherein the neighboring grid cells are grid cells within the preset detection range of the current grid cell; based on the number of grid cells corresponding to the target geographic feature, and the total number of the current grid cell and neighboring grid cells, the fitness of the current grid cell is determined.
[0123] Optionally, the device further includes: The repeat detection module is configured to adjust the preset motion parameters and preset detection range, and then return to execute the steps of motion detection with random grid cells as the detection starting point according to the preset motion parameters and preset detection range.
[0124] Optionally, the detection module 804 is further configured as follows: According to the preset number of iterations, based on the geographic feature identifiers of each grid unit and with the preset relationship as the detection target, the detection starts from random grid units to obtain the target grid units obtained in each iteration; and the target grid units obtained in each iteration are integrated.
[0125] Optionally, the detection module 804 is further configured as follows: Based on the attribute information of the target object, determine the number of targets to be extracted; extract multiple target grid cells that meet the target extraction number on each detection path obtained in each iteration, wherein the detection path consists of grid cells detected from random grid cells; and perform deduplication processing on the multiple extracted target grid cells.
[0126] Optionally, the device further includes: The rendering module is configured to acquire the model data of the target object; determine the corresponding target rendering position in the initial map based on the target grid cells; and render the target object at the target rendering position in the initial map based on the model data to obtain the target map.
[0127] In this embodiment, the grid and object creation request corresponding to the initial map are obtained. The grid cells record geographic feature identifiers, and the object creation request carries a preset relationship between the target object and the target geographic feature. Based on the geographic feature identifiers of each grid cell, and using the preset relationship as the detection target, detection begins from random grid cells to determine the target grid cell. The target grid cell indicates the creation location of the target object in the initial map. This method of random grid cell detection automatically determines the creation location of the target object in the initial map, improving map editing efficiency and reducing costs compared to manual determination. Furthermore, by obtaining the preset relationship between the target object and the target geographic feature, reflecting social dynamics, and using the preset relationship as the detection target, the obtained target grid cell possesses a social relationship with the geographic features in the initial map, resulting in more realistic and accurate map editing.
[0128] The above is a schematic scheme of a map editing device according to this embodiment. It should be noted that the technical solution of this map editing device and the technical solution of the map editing method described above belong to the same concept. Details not described in detail in the technical solution of the map editing device can be found in the description of the technical solution of the map editing method described above. Furthermore, the components in the device embodiment should be understood as functional modules necessary to implement each step of the program flow or each step of the method; these functional modules are not actual functional divisions or separations. The device claim defined by such a set of functional modules should be understood as a functional module architecture that primarily implements the solution through the computer program described in the specification, and should not be understood as a physical device that primarily implements the solution through hardware.
[0129] Figure 9 This diagram illustrates a structural block diagram of a computing device according to an embodiment of this application. The components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.
[0130] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 940 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0131] In one embodiment of this application, the aforementioned components of the computing device 900 and Figure 9 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 9 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0132] The computing device 900 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs (Personal Computers). The computing device 900 can also be a mobile or stationary server.
[0133] The processor 920 is used to execute computer-executable instructions for the map editing method.
[0134] The above is a schematic representation of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the map editing method described above belong to the same concept. Details not described in detail in the technical solution of the computing device can be found in the description of the technical solution of the map editing method described above.
[0135] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used for a map editing method.
[0136] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the map editing method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the map editing method described above.
[0137] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0138] One embodiment of this application also provides a chip that stores a computer program, which, when executed by the chip, implements the steps of the map editing method.
[0139] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0141] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A map editing method, characterized in that, include: Obtain the grid and object creation request corresponding to the initial map, wherein the grid cells in the grid record geographic feature identifiers, and the object creation request carries a preset relationship between the target object and the target geographic feature; Based on the geographic feature identifiers of each grid cell, and taking the preset relationship as the detection target, detection begins from random grid cells to determine the target grid cell. The method for determining the target grid cell includes: performing motion detection starting from random grid cells according to preset motion parameters; calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell using the fitness function corresponding to the preset relationship; adjusting the motion parameters based on the fitness; performing motion detection starting from the current grid cell according to the adjusted motion parameters; and returning to the previous step of calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell using the fitness function corresponding to the preset relationship. The fitness step of the previous grid cell involves obtaining a target grid cell when a detection target that satisfies the preset relationship is reached. The target grid cell indicates the creation position of the target object in the initial map. The number of random grid cells is multiple. The step of adjusting the motion parameters according to the fitness includes: determining local reference grid cells whose fitness reaches a first fitness threshold based on the fitness of each grid cell on the first detection path; determining global reference grid cells whose fitness reaches a second fitness threshold based on the fitness of local reference grid cells on each detection path; and adjusting the motion parameters based on the position information of the current grid cell, the position information of the local reference grid cells, and the position information of the global reference grid cells.
2. The method according to claim 1, characterized in that, The step of obtaining the grid corresponding to the initial map includes: Get the initial map; Create the initial grid corresponding to the initial map; The geographic features on the initial map are marked to obtain the geographic feature identifiers of each geographic feature; Each of the geographic feature identifiers is mapped to the corresponding grid cell in the initial grid.
3. The method according to claim 1, characterized in that, The first detection path is a path composed of grid cells that have been detected starting from any random grid cell.
4. The method according to claim 3, characterized in that, Before adjusting the motion parameters based on the position information of the current mesh cell, the position information of the local reference mesh cell, and the position information of the global reference mesh cell, the method further includes: Adjustment weights are set based on the preset distribution sparsity for the target object; The step of adjusting the motion parameters based on the position information of the current mesh cell, the position information of the local reference mesh cell, and the position information of the global reference mesh cell includes: Based on the position information of the current grid cell, the position information of the local reference grid cell, and the position information of the global reference grid cell, the motion parameters are adjusted according to the adjustment weights.
5. The method according to claim 3, characterized in that, After determining the global reference grid cells whose fitness reaches the second fitness threshold based on the fitness of the local reference grid cells on each detection path, the method further includes: Output the global reference mesh cells.
6. The method according to claim 1, characterized in that, The motion detection, performed according to preset motion parameters and using random grid cells as the detection starting point, includes: Motion detection is performed using random grid cells as the detection starting point, based on preset motion parameters and preset detection range. The step of calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell and using the fitness function corresponding to the preset relationship includes: Based on the geographic feature identifier of the current grid cell and the geographic feature identifier of the neighboring grid cells, the grid cell corresponding to the target geographic feature is determined, wherein the neighboring grid cells are grid cells within the preset detection range of the current grid cell; The fitness of the current grid cell is determined based on the number of grid cells corresponding to the target geographic feature and the total number of the current grid cell and the neighboring grid cells.
7. The method according to claim 6, characterized in that, After obtaining the target network unit when the detection target satisfies the preset relationship, the method further includes: Adjust the preset motion parameters and the preset detection range, and return to execute the step of performing motion detection with random grid cells as the detection starting point according to the preset motion parameters and the preset detection range.
8. The method according to any one of claims 1-7, characterized in that, The step of determining the target grid cell by probing from random grid cells based on the geographic feature identifiers of each grid cell and satisfying the preset relationship as the detection target includes: According to the preset number of iterations, based on the geographic feature identifiers of each grid cell, and taking the preset relationship as the detection target, the detection starts from random grid cells to obtain the target grid cells obtained in each iteration; The target mesh cells obtained in each iteration are integrated.
9. The method according to claim 8, characterized in that, The process of integrating the target mesh cells obtained in each iteration includes: The number of targets to be extracted is determined based on the attribute information of the target object; Extract multiple target grid cells that satisfy the target extraction quantity on each detection path obtained in each iteration, wherein the detection path consists of grid cells detected starting from random grid cells; The extracted target mesh cells are deduplicated.
10. The method according to any one of claims 1-7, characterized in that, After determining the target grid cell by starting the detection from random grid cells based on the geographic feature identifiers of each grid cell and using the preset relationship as the detection target, the process further includes: Obtain the model data of the target object; Based on the target grid cell, determine the corresponding target rendering location in the initial map; Based on the model data, the target object is rendered at the target rendering location of the initial map to obtain the target map.
11. A map editing device, characterized in that, include: The acquisition module is configured to acquire the grid and object creation request corresponding to the initial map, wherein the grid cells in the grid record geographic feature identifiers, and the object creation request carries a preset relationship between the target object and the target geographic feature; The detection module is configured to perform detection starting from random grid cells based on the geographic feature identifiers of each grid cell, with the preset relationship as the detection target, to determine the target grid cell. The method for determining the target grid cell includes: performing motion detection starting from random grid cells according to preset motion parameters; calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell using the fitness function corresponding to the preset relationship; adjusting the motion parameters based on the fitness; performing motion detection starting from the current grid cell according to the adjusted motion parameters; and returning to execute the step of calculating the fitness of the current grid cell based on the geographic feature identifier of the currently detected grid cell using the fitness function corresponding to the preset relationship. The step of calculating the fitness of the current grid cell involves obtaining a target grid cell when a detection target that satisfies the preset relationship is reached. The target grid cell indicates the creation location of the target object in the initial map. The number of random grid cells is multiple. The step of adjusting the motion parameters based on the fitness includes: determining local reference grid cells whose fitness reaches a first fitness threshold based on the fitness of each grid cell on the first detection path; determining global reference grid cells whose fitness reaches a second fitness threshold based on the fitness of local reference grid cells on each detection path; and adjusting the motion parameters based on the position information of the current grid cell, the position information of the local reference grid cells, and the position information of the global reference grid cells.
12. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the map editing method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the map editing method according to any one of claims 1 to 10.
Citation Information
Patent Citations
System and method for automated map creation and computer program for the same
KR102017605B1
Link-node maps based on open area maps
US20100299065A1