Movement control method and device, electronic equipment and storage medium

Through the segmentation and aggregation technology of multi-level grid maps, the moving path of the target object is quickly determined, which solves the problem of long-term time-consuming in the automatic pathfinding process and improves navigation fluency.

CN119633382APending Publication Date: 2025-03-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311206243.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

During the automatic road search process, due to the large search space of the map, it takes a long time to determine the moving path, which affects the smoothness of the navigation process.

Method used

By obtaining multiple grid maps at different levels, determining the initial start point grid and end point grid, and quickly determining the target grid in the grid map at the target level, thereby determining the moving subpath from the mapping range of the target grid in the grid map at the initial level, controlling the movement of the target object.

Benefits of technology

It effectively reduces the time spent determining the moving subpath, improves the fluency of the target object navigation process, and avoids main thread blockage by determining the moving subpath in different time shards, and further improves navigation fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119633382A_ABST
    Figure CN119633382A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a movement control method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining grid maps of a plurality of levels, determining an initial starting point grid and an initial end point grid, then determining a target grid in a grid map of a target level, and then determining a target grid in the grid map of the initial level, the moving sub-path is determined in the mapping range of the target grid, and the space searched for determining the moving sub-path is small, so that the time complexity can be effectively reduced, the time consumption for determining the moving sub-path is reduced, and the smoothness of the target object navigation process is improved; the at least two moving sub-paths are determined in different time fragments, namely, the determination actions of the at least two moving sub-paths are split, so that the blockage phenomenon of the main thread is avoided, the smoothness of the navigation process of the target object is further improved, and the navigation efficiency of the target object is improved. The method can be widely applied to scenes such as cloud technology, artificial intelligence, games and intelligent transportation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a mobile control method, device, electronic device and storage medium. Background Art

[0002] During the navigation process, automatic routing can be used to determine a path from the starting point to the end point in a specified area. Taking map navigation as an example, after selecting the starting point and end point of an object on the map, automatic routing can be used to determine a relatively short path from the starting point to the end point, and then the object can be controlled to move from the starting point to the end point along the path determined by automatic routing.

[0003] Related technology: When performing automatic path finding, since the search space of the map is usually very large, it takes a long time to determine the moving path, resulting in poor smoothness of the object's navigation process. Summary of the invention

[0004] The following is a summary of the subject matter described in detail in this application. This summary is not intended to limit the scope of the claims.

[0005] The embodiments of the present application provide a mobile control method, device, electronic device and storage medium, which can reduce the time consumption of determining a mobile sub-path, thereby improving the fluency of the target object navigation process.

[0006] On the one hand, an embodiment of the present application provides a movement control method, including:

[0007] Acquire grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of a later level is obtained by grid aggregation of the grid map of a previous level;

[0008] In the grid map of the initial level, determining an initial starting grid and an initial ending grid for the movement of the target object;

[0009] In the grid map of the target level, determining a target grid through which the target object moves, wherein in the grid map of a level after the target level, the initial starting grid and the initial ending grid are aggregated into the same grid;

[0010] In the grid map of the initial level, moving sub-paths are determined from the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-paths, wherein at least two of the moving sub-paths are determined in different time slices.

[0011] On the other hand, an embodiment of the present application further provides a mobile control device, including:

[0012] An acquisition module, used for acquiring grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of the next level is obtained by grid aggregation of the grid map of the previous level;

[0013] A first grid determination module, used to determine an initial starting grid and an initial ending grid for movement of a target object in the grid map of the initial level;

[0014] A second grid determination module is used to determine, in the grid map of the target level, a target grid through which the target object moves, wherein, in the grid map of a level after the target level, the initial starting grid and the initial ending grid are aggregated into the same grid;

[0015] A control module is used to determine a moving sub-path from the mapping range of each of the target grids in the grid map of the initial level, and control the movement of the target object according to the moving sub-path, wherein at least two of the moving sub-paths are determined in different time slices.

[0016] Furthermore, the control module is specifically used for:

[0017] The determining of movement sub-paths from the mapping range of each of the target grids, and controlling the movement of the target object according to the movement sub-paths, comprises:

[0018] Calling the threads corresponding to the target grids in sequence according to the moving order of the target objects;

[0019] Whenever the thread is called, a moving subpath is determined from within the mapping range of the currently corresponding target grid;

[0020] Whenever the moving sub-path corresponding to the current target grid is determined, the target object is controlled to move along the moving sub-path.

[0021] Furthermore, the control module is specifically used for:

[0022] In the grid map of a level before the target level, determining the transition grid through which the target object moves from within the mapping range of each of the target grids;

[0023] The grid map of the level where the transition grid is located is used as the grid map of the target level, and the transition grid is used as the target grid. The transition grid is again determined in the grid map of the level before the target level, until the transition grid is determined in the grid map of the initial level, and the moving sub-path is determined according to the transition grid.

[0024] Furthermore, the control module is specifically used for:

[0025] Adding the target grid to the target queue according to the moving order of the target object, wherein the first queue element in the target queue is the target grid corresponding to the initial starting grid;

[0026] Obtain the first target grid in the target queue, and determine the transition grid through which the target object moves, starting from the mapping range of the first target grid in the grid map of the previous level of the target level;

[0027] When the transition grid is outside the first target grid, the first target grid in the target queue is acquired again, and the transition grid is determined from the mapping range of the first target grid acquired again until the target queue is an empty queue.

[0028] Furthermore, the second grid determination module is specifically used for:

[0029] In the grid map of the target level, determining an aggregated starting grid corresponding to the initial starting grid and an aggregated ending grid corresponding to the initial ending grid;

[0030] Determine the actual cost between the aggregation starting point grid and the adjacent candidate grid, and determine the predicted cost between the candidate grid and the aggregation end point grid;

[0031] Based on the sum of the actual cost and the predicted cost, a target grid through which the target object moves is screened out from the plurality of candidate grids.

[0032] Furthermore, the control module is specifically used for:

[0033] In the grid map of a level after the initial level, respectively determining a preset target waypoint from within a mapping range of each target grid;

[0034] A moving sub-path sequentially passing through the initial starting point grid, the target waypoint and the initial end point grid is determined from within the mapping range of each target grid, and the target object is controlled to move along the moving sub-path.

[0035] Furthermore, the number of the target waypoints is multiple, and the control module is specifically used for:

[0036] Acquire a preset reference subpath passing through at least two of the target waypoints;

[0037] A moving sub-path that sequentially passes through the initial starting point grid, the reference sub-path, and the initial end point grid is determined from within the mapping range of each of the target grids.

[0038] Furthermore, the acquisition module is specifically used for:

[0039] Obtaining an original map, and gridding the original map to obtain a grid map of an initial level;

[0040] Based on the grid map of the initial level, grid maps of multiple levels are obtained through multiple aggregations.

[0041] Furthermore, the acquisition module is specifically used for:

[0042] Using the grid map of the initial level as the grid map of the current level, and evenly dividing the grid map of the current level into a plurality of grid areas, wherein the grid area includes a central grid and a plurality of grids in the same area, and the distance between the grid in the same area and the corresponding central grid is less than or equal to a distance threshold;

[0043] Aggregate each of the central grids and the corresponding grids in the same area to obtain the grid map of the next level, and use the grid map of the next level as the grid map of the current level;

[0044] The grid map of the current level is aggregated again until the grid size of the aggregated grid map is greater than or equal to a preset size threshold, or until the number of aggregations of the grid map is greater than or equal to a preset number threshold.

[0045] Furthermore, the control module is also used for:

[0046] When the target level is the initial level, a plurality of pre-stored initial subpaths are obtained, wherein the initial subpath is a path between any two initial grids, the initial grids are grids in the grid map of the initial level, and in the grid map of a level after the initial level, any two initial grids are aggregated into the same grid;

[0047] The target object is controlled to move according to the initial subpath corresponding to the initial starting point grid and the initial end point grid.

[0048] Furthermore, the second grid determination module is further used for:

[0049] Starting from the grid map of the initial level, the grids of the grid map of each level are traversed in sequence until the initial starting grid and the initial ending grid are aggregated into the same grid in the currently traversed grid map;

[0050] The grid map of a previous level of the currently traversed grid map is determined as the grid map of the target level.

[0051] On the other hand, an embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned movement control method when executing the computer program.

[0052] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned movement control method.

[0053] On the other hand, the embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned movement control method.

[0054] The embodiments of the present application include at least the following beneficial effects: by acquiring grid maps of multiple levels and determining the initial starting grid and the initial ending grid, the target grid through which the target object passes can be quickly determined in the grid map of the target level, and then the moving sub-path is determined from the mapping range of the target grid in the grid map of the initial level. Since the moving sub-path of the target grid is determined from the mapping range of the target grid in the grid map of the initial level, which is equivalent to the search space corresponding to the moving sub-path being the mapping range of the target grid, the space searched for determining the moving sub-path is smaller, which can effectively reduce the time complexity, thereby reducing the time consumption for determining the moving sub-path and improving the fluency of the target object navigation process. On this basis, since at least two moving sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two moving sub-paths, avoiding the blocking phenomenon of the main thread, thereby further improving the fluency of the target object navigation process.

[0055] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0057] Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present application;

[0058] Figure 2 A schematic diagram of an optional flow chart of a mobile control method provided in an embodiment of the present application;

[0059] Figure 3 An optional structural diagram of a grid map provided in an embodiment of the present application;

[0060] Figure 4 An optional tree diagram of grid maps of various levels provided in an embodiment of the present application;

[0061] Figure 5 An optional structural diagram of an initial level grid map provided in an embodiment of the present application;

[0062] Figure 6 An optional structural diagram of a grid map of a target level provided in an embodiment of the present application;

[0063] Figure 7 An optional structural diagram of a target grid provided in an embodiment of the present application;

[0064] Figure 8 An optional structural schematic diagram of the mapping range of the target grid provided in an embodiment of the present application;

[0065] Fig. 9 A schematic diagram of an optional structure of a moving sub-path provided in an embodiment of the present application;

[0066] Fig.10 A schematic diagram of an optional specific flow chart of the mobile control method provided in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of an optional interface of a game scene provided in an embodiment of the present application;

[0068] Fig.12 A schematic diagram of an optional structure of a mobile control device provided in an embodiment of the present application;

[0069] Fig.13 A partial structural block diagram of a terminal provided in an embodiment of the present application;

[0070] Fig.14 A partial structural block diagram of the server provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0072] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. Among them, the target object can be a user. In addition, when the embodiment of the present application needs to obtain the target object attribute information, the target object's separate permission or separate consent will be obtained by means of a pop-up window or jumping to a confirmation page, etc., and after the separate permission or separate consent of the target object is clearly obtained, the necessary target object-related data for enabling the normal operation of the embodiment of the present application will be obtained.

[0073] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0074] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0075] Games may include electronic games. Electronic games refer to interactive games that run on electronic equipment platforms. Electronic games may include online games and stand-alone games. Online games may also be called online games, which generally refer to sustainable individual multi-player online games that use the Internet as a communication medium, game servers and player terminals as game processing devices, and game clients running in player terminals as information interaction windows, aiming to achieve entertainment, leisure, communication and virtual achievements; game clients refer to programs that correspond to game servers and provide local game services to players participating in online games; game servers refer to service devices that provide data calculation, verification, storage and forwarding functions to game clients.

[0076] Online games can be cloud games or ordinary online games. Among them, ordinary online games refer to games that are directly run in the game client installed in the player's terminal. Cloud gaming (Cloud Gaming), also known as gaming on demand (Gaming on Demand), refers to games that run in the game server; that is, in the cloud gaming scenario, all cloud games are not run in the game client of the player's terminal, but in the game server; the game server compresses and encodes the game screen and game audio in the cloud game into a media stream, and then transmits the media stream to the game client in the user terminal through the network for image display and audio playback; it can be seen that the game client does not need to have powerful graphics processing and data computing capabilities, but only needs to have basic streaming media playback capabilities, and the ability to obtain the operation instructions entered by the game player and send the operation instructions entered by the game player to the game server; when the game player performs various operations in the game interface of the game client, the game client will report the operation data generated by these operations to the game server, and the game server will refresh the game screen of the cloud game according to the operation data in the corresponding cloud game, and then return the refreshed game screen to the game client for display, so as to realize the play of cloud games. In other words, the difference between ordinary online games and cloud games is that ordinary online games are run in the game client installed in the player's terminal, while cloud games are run in the game server, and the game client is responsible for presenting the game screen, playing the game audio, and receiving the operation instructions input by the game player. This application does not specifically limit the game type of online games.

[0077] A virtual scene refers to a virtual scene displayed (or provided) when an application is running on a terminal. The virtual scene may be a purely fictitious virtual environment. The virtual scene may be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene or a three-dimensional virtual scene. The embodiment of the present application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Players can control virtual objects to carry out activities in the virtual scene, and the activities include but are not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, and throwing. At least one of the virtual scene can be displayed from a first-person perspective (for example, the player's own perspective is used to play the virtual object in the game); it can also be displayed from a third-person perspective (for example, the player chases the virtual object in the game to play the game); it can also be displayed from a bird's-eye view perspective; wherein the above perspectives can be switched arbitrarily.

[0078] Virtual objects refer to the images of various people and objects that can interact in a virtual scene, or inactive objects in a virtual scene. The active objects can be virtual characters, virtual animals, etc., such as people, animals, plants, oil drums, walls, stones, etc. displayed in a virtual scene. The virtual object can be a virtual image in the virtual scene that represents the player. A virtual scene can include multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.

[0079] For example, the virtual object may be a player character controlled by operations on the client, an artificial intelligence (AI) object set in a virtual scene through training, or a non-player character (NPC) set in a virtual scene interaction. For example, the virtual object may be a virtual character that performs adversarial interactions in a virtual scene. For example, the number of virtual objects participating in the interaction in the virtual scene may be pre-set or dynamically determined according to the number of clients joining the interaction.

[0080] For example, players can control virtual objects to freely fall, glide, or open a parachute to fall in the sky of the virtual scene, run, jump, crawl, bend forward, etc. on land, or control virtual objects to swim, float, or dive in the ocean.

[0081] Related technology: When performing automatic path finding, since the search space of the map is usually very large, it takes a long time to determine the moving path, resulting in poor smoothness of the object's navigation process.

[0082] Based on this, the embodiments of the present application provide a mobile control method, device, electronic device and storage medium, which can reduce the time consumption of determining the mobile sub-path, thereby improving the fluency of the target object navigation process.

[0083] Reference Figure 1 , Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present application, the implementation environment includes a terminal 101 and a server 102, wherein the terminal 101 and the server 102 are connected via a communication network.

[0084] Exemplarily, the server 102 can obtain grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of the next level is obtained by grid aggregation of the grid map of the previous level; in the grid map of the initial level, the initial starting grid and the initial ending grid of the target object's movement are determined; in the grid map of the target level, the target grid through which the target object moves is determined, wherein, in the grid map of the next level after the target level, the initial starting grid and the initial ending grid are aggregated into the same grid; in the grid map of the initial level, mobile sub-paths are determined from the mapping range of each target grid, the movement of the target object is controlled according to the mobile sub-paths, and the path-finding result of the target object is determined, wherein at least two mobile sub-paths are determined in different time slices; and the path-finding result of the target object is sent to the terminal 101.

[0085] The server 102 obtains grid maps of multiple levels and determines the initial starting grid and the initial ending grid. Then, in the grid map of the target level, the target grid through which the target object passes can be quickly determined. Then, in the grid map of the initial level, the moving sub-path is determined from the mapping range of the target grid. Since the moving sub-path of the target grid is determined from the mapping range of the target grid in the grid map of the initial level, which is equivalent to the search space corresponding to the moving sub-path being the mapping range of the target grid, the space searched for determining the moving sub-path is smaller, which can effectively reduce the time complexity, thereby reducing the time consumption for determining the moving sub-path and improving the fluency of the target object navigation process. On this basis, since at least two moving sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two moving sub-paths, avoiding the blocking of the main thread, thereby further improving the fluency of the target object navigation process.

[0086] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In addition, server 102 can also be a node server in a blockchain network.

[0087] The terminal 101 may be a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present embodiment.

[0088] The method provided in the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, games, smart transportation, assisted driving and the like.

[0089] Reference Figure 2 , Figure 2 An optional flow chart of a mobile control method provided in an embodiment of the present application, the mobile control method can be executed by a server, or can also be executed by a terminal, or can also be executed by a server in conjunction with a terminal, the text type determination method includes but is not limited to the following steps 201 to 204.

[0090] Step 201: Obtain multiple grid maps at different levels.

[0091] Among them, the grid map is a type of graph with grids as units. In this graph, the grid map is divided into multiple grids. The grid map can represent the quality of the mapping object or the spatial distribution of the data features of the mapping object.

[0092] Specifically, a mapping object may refer to a geographic entity represented on a map, and a geographic entity has a certain geographic location. The map may be a real map, in which case the geographic entity is used to indicate a material object existing in a real environment, for example, a material object may be a mountain, a lake, a bridge, etc. The map may also be a virtual map, in which case the geographic entity is used to indicate an element existing in a virtual environment, for example, an element may be a road, a building, a mountain, a lake, a player character, a non-player character, etc.;

[0093] The quality of a mapping object may refer to the attributes of a geographic entity represented on a map. For example, the attributes of a geographic entity may be altitude, temperature, rainfall, etc. The attribute value carried by each grid is usually the average of multiple attribute values ​​in the grid area or the attribute value obtained by sampling. For example, the altitude of a grid may be the average of the altitudes of various locations in the grid, or the altitude of the center of the grid.

[0094] The spatial distribution of data features of a mapping object may refer to the distribution of attributes in space. For example, the spatial distribution of altitude may be obtained through a grid map. For example, assuming that a player character can only move in areas where the altitude is within a preset altitude range, the grids that are reachable and unreachable by the player character may be determined based on the spatial distribution of the altitude in the grid map. For example, an unreachable grid may be a grid whose altitude is outside the preset altitude range.

[0095] Among them, there is a hierarchical relationship between multiple grid maps. The grid map of the next level is obtained by grid aggregation of the grid map of the previous level. Specifically, the grids of the grid map of the next level are obtained by aggregation of multiple grids of the grid map of the previous level. Usually, in the grid maps of the same level, the sizes of each grid are the same. It can be seen that the lower the level of the grid map, the smaller the grid size of the grid map, and the more grids the grid map has. Conversely, the higher the level of the grid map, the larger the grid size of the grid map, and the fewer grids the grid map has.

[0096] Specifically, the connectivity between grids can be predetermined in grid maps of each level. First, each grid in the grid map of the initial level is traversed. Assuming that the object is located in the currently traversed grid, the next grid that the object can reach is used as the grid that is reachable by the currently traversed grid. The currently traversed grid is connected to the reachable grid, and the currently traversed grid is not connected to the unreachable grid. For example, grid A and grid B are adjacent, the altitude of grid A is 0 meters, and the altitude of grid B is 50 meters. Assuming the preset altitude range is 10 meters. Since the altitude of grid B is greater than the preset height range, grid B is unreachable, and grid A and grid B are not connected. For another example, grid A and grid B are adjacent, the target object is located in grid A, and grid B is equipped with obstacles. It can also be considered that grid B is unreachable, and grid A and grid B are not connected. Then, based on the connectivity of each grid in the grid map of the initial level, the connectivity of each grid in the grid map of other levels is determined. Subsequently, the moving path of the target object needs to be determined based on the connectivity between the grids.

[0097] Specifically, refer to Figure 3 , Figure 3 An optional structural diagram of a grid map provided in an embodiment of the present application.

[0098] Among them, the distance threshold is set to one, one of the grids in the grid map of the N-1 level is used as the central grid, the grids located above, below, left and right of the central grid are used as grids in the same area, and the grids located at the diagonal angle of the central grid are used as grids in the same area. A grid area of ​​three rows and three columns can be determined, and then the grid area is aggregated into a grid of the grid map of the N level. Then, the grid map of the N level is aggregated to obtain a grid map of the N+1 level.

[0099] Based on this, refer to Figure 4 , Figure 4 An optional tree diagram of grid maps of various levels provided in an embodiment of the present application.

[0100] Among them, based on the aggregation process of the grid maps of each level, a tree relationship between the levels can be constructed. Through the tree relationship, it can be clearly known that the grid map of the next level is obtained by aggregating the grid maps of the previous level.

[0101] Step 202: In the grid map of the initial level, determine the initial starting grid and the initial ending grid for the target object to move.

[0102] Among them, the target object can be a virtual object in a virtual scene, and the corresponding scene map is determined according to the distribution of geographical entities in the virtual scene. The target object can also be a real object in a real scene, and the corresponding scene map is determined according to the distribution of geographical entities in the real scene. The scene map can be a two-dimensional map, and the corresponding grid map can be obtained by gridding the scene map. The grid map can be obtained by gridding the entire scene map, and the grid map can also be obtained by gridding a local scene map.

[0103] Specifically, in an initial level grid map divided into multiple grids, the grid where the target object is located and the grid that the target object needs to reach can be determined, and the grid where the target object is located is used as the initial starting grid for the target object's movement, and the grid that the target object needs to reach is used as the initial destination grid for the target object's movement.

[0104] For example, at the current moment, the target object is in the grid map. At the current moment, the position of the target object in the grid map is the first position, and the grid corresponding to the first position in the grid map of the initial level is used as the initial starting grid. The position that the target object needs to reach in the grid map of the initial level is the second position, and the grid corresponding to the second position in the grid map of the initial level is used as the initial ending grid.

[0105] For another example, at the current moment, the target object is not in the grid map. For example, at the current moment, the target object as a virtual object has not been created in the virtual scene. The grid or position where the target object is created can be known in advance based on the properties of the target object. Therefore, the grid where the target object is created can be used as the initial starting grid, or the position where the target object is created can be used as the third position, and then the grid corresponding to the third position in the grid map of the initial level can be used as the initial starting grid.

[0106] Step 203: In the target-level grid map, determine the target grid through which the target object moves.

[0107] Among them, in the grid map of the next level of the target level, the initial starting grid and the initial ending grid are aggregated into the same grid. Therefore, in the grid image of the next level of the target level, the same grid in which the initial starting grid and the initial ending grid are aggregated can be used as the indication grid, and the area mapped by the indication grid in the grid map of the target level can be used as the indication area, that is, the indication grid is obtained by aggregating all grids in the indication area, and the indication area includes the starting grid where the target object moves and the starting grid where the target object moves. The indication area may also include other grids.

[0108] Based on this, the range of the indication area can be an optional range of the target object's moving path. The indication area is one of the grid areas in the grid map. The number of grids in the grid area is usually small, and the distance between any two grids in the grid area is usually small. Therefore, the target grid through which the target object moves can be quickly determined in each grid in the indication area, which can effectively reduce the time complexity.

[0109] In a possible implementation, the grid map of the target level can be determined by the following steps: starting from the grid map of the initial level, traversing the grids of the grid maps of each level in turn until, in the currently traversed grid map, the initial starting grid and the initial ending grid are aggregated into the same grid; and determining the grid map of the previous level of the currently traversed grid map as the grid map of the target level.

[0110] Among them, after the initial starting grid and the initial ending grid are determined in the grid map of the initial level, the grid map of the target level can be determined in the grid maps of multiple levels based on the initial starting grid and the initial ending grid, as follows: traversal is performed layer by layer in the order from low level to high level. For each level of the grid map, all grids in the grid map need to be traversed. If the currently traversed grid contains both the target object's moving starting point and the moving end point, the traversal is stopped. At this time, the previous level of the level where the currently traversed grid is located is used as the target level. In the grid map of the target level, the grid where the target object's moving starting point and the moving end point are located are located in the same grid area. Therefore, in the grid map of the next level of the target level, the initial starting grid and the initial end point grid can be aggregated into the same grid.

[0111] Based on this, since the traversal starts from the grid map of the initial level, in the grid map of the target level determined by the traversal, the number of grids passed by the moving path can be reduced as much as possible under the premise of being able to generate the moving paths of the target object's moving starting point and moving end point, thereby quickly determining the initial moving path between the moving starting point and moving end point of the target object, and subsequently the target moving path between the initial starting point grid and the initial end point grid can be quickly determined within the mapping range of the grid map of the initial level through the initial moving path.

[0112] In a possible implementation, in a grid map of a target level, a target grid through which a target object moves is determined. Specifically, in a grid map of a target level, an aggregated starting grid corresponding to an initial starting grid and an aggregated ending grid corresponding to an initial ending grid are determined; an actual cost between the aggregated starting grid and an adjacent candidate grid is determined, and a predicted cost between the candidate grid and the aggregated ending grid is determined; and based on the sum of the actual cost and the predicted cost, the target grid through which the target object moves is screened out from a plurality of candidate grids.

[0113] First, the aggregation starting point grid is taken as the current grid, and the actual cost between the aggregation starting point grid and the adjacent candidate grid is calculated, that is, the cost generated by moving from the aggregation starting point grid to the candidate grid is determined. Generally, the closer the aggregation starting point grid is to the candidate grid, the smaller the cost generated by moving from the aggregation starting point grid to the candidate grid. Conversely, the farther the aggregation starting point grid is from the candidate grid, the greater the cost generated by moving from the aggregation starting point grid to the candidate grid.

[0114] and calculating the predicted cost between the candidate grid and the aggregation end grid, that is, determining the estimated cost of moving the candidate grid to the aggregation end grid. Generally, the closer the candidate grid is to the aggregation end grid, the smaller the estimated cost of moving the candidate grid to the aggregation end grid. Conversely, the farther the candidate grid is from the aggregation end grid, the larger the estimated cost of moving the candidate grid to the aggregation end grid.

[0115] Then, the actual cost and the predicted cost of the candidate grid are added together to determine the total cost of each candidate grid adjacent to the aggregation starting grid. Each candidate grid adjacent to the aggregation starting grid may refer to each candidate grid reachable by the current grid. The reachable candidate grid may refer to a grid located in a specified grid area. The total cost of the candidate grid may indicate the expansion priority of the candidate grid. When the total cost of the candidate grid is smaller, the expansion priority of the candidate grid is higher. Conversely, when the total cost of the candidate grid is larger, the expansion priority of the candidate grid is lower.

[0116] Then, the candidate grid with the highest extension priority is used as the candidate grid for current extension, and the source grid of the candidate grid for current extension is recorded as the initial starting grid. Then, the candidate grid for current extension is used as the current grid again, and the total cost of each reachable candidate grid of the current grid is calculated, and then the extension priority of each candidate grid is determined. The candidate grid with the highest extension priority is used as the candidate grid for current extension again, and the source grid of the candidate grid for current extension is recorded as the previous extended candidate grid, until the candidate grid for current extension is the aggregation end grid. The candidate grid for later extension is usually closer to the aggregation end grid than the candidate grid for earlier extension.

[0117] When the expanded candidate grid is the aggregation end grid, there is no need to expand new candidate grids. At this time, the aggregation end grid is used as the target grid, and the corresponding previous expanded candidate grid is determined according to the source grid of the currently determined target grid. The corresponding previous expanded candidate grid is used as the target grid again until the currently determined target grid is the aggregation starting grid. From the later expanded candidate grid to the earlier expanded candidate grid, each target grid can be obtained by backtracking. The aggregation moving path of the target object is determined by the currently determined target grid. When the target object moves along the aggregation moving path with lower moving cost, it can reach the aggregation end grid faster and achieve better moving effect.

[0118] Step 204: In the grid map of the initial level, a moving sub-path is determined from the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-path.

[0119] Among them, the target grid is located in the grid map of the target level. When the target level is not the initial level, through the aggregation relationship between the grid map of the target level and the grid map of the initial level, all the mapping grids corresponding to the target grid can be found in the grid map of the initial level, and then based on the range of the mapping grid, the mapping range of the target grid is determined in the grid map of the initial level. The target grid is obtained by aggregating all the mapping grids. In the grid map of the target level, the target object will pass through all the target grids when moving from the moving starting point to the moving end point. Therefore, when determining the moving sub-path in the grid map of the initial level, compared with determining the moving sub-path from the entire grid map, the moving sub-path corresponding to the target grid is determined from the mapping range of each target grid in the grid map of the initial level, which is equivalent to the search space corresponding to the moving sub-path being the mapping range of the target grid. Therefore, the space searched for determining the moving sub-path is smaller, which can effectively reduce the time complexity, thereby reducing the time consumption of determining the moving sub-path, quickly determining the moving sub-path of the target object, and improving the fluency of the navigation process of the target object.

[0120] On this basis, since at least two moving sub-paths are determined in different time slices, it is equivalent to splitting the determination actions of at least two moving sub-paths, avoiding blocking of the main thread, thereby further improving the smoothness of the target object navigation process.

[0121] In a possible implementation, a moving sub-path is determined from the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-path. Specifically, the threads corresponding to each target grid are called in sequence according to the movement order of the target object; each time the thread is called, the moving sub-path is determined from the mapping range of the currently corresponding target grid; each time the moving sub-path corresponding to the current target grid is determined, the target object is controlled to move along the moving sub-path.

[0122] Among them, the time slices for calling each thread can be different, so calling the threads corresponding to each target grid in sequence according to the moving order of the target object is equivalent to calling the corresponding threads in different time slices respectively. Based on the mapping range of the corresponding target grid, the moving sub-path for the target object to move first can be determined by the thread called first, and the moving sub-path for the target object to move later can be determined by the thread called later. Whenever the moving sub-path is determined, the target object can be controlled to move along the currently determined moving sub-path. During the movement of the target object, the next thread can be called to determine the next moving sub-path of the target object. After the target object moves to the destination of the currently determined moving sub-path, if the next moving sub-path has been determined, the target object can be controlled to move along the next determined moving sub-path. If the next moving sub-path has not been determined, wait until the next moving sub-path is determined, and then control the target object to move along the next determined moving sub-path.

[0123] Based on this, the mobile control method provided in the embodiment of the present application splits the process of calculating a complete mobile path in a single time into the logical loops of multiple main threads, which can reduce the time consumption of a single calculation of the main thread. In addition, the next mobile sub-path can be calculated while controlling the movement of the target object. The process of controlling the movement of the target object and the process of determining the mobile sub-path can be carried out simultaneously without interfering with each other. For example, after determining the mobile sub-path in an earlier time slice, the target object can be controlled to move along the first determined mobile sub-path in a relatively early period of time. The subsequent mobile sub-path can be determined while controlling the movement of the target object. When the target object moves to the destination of the current mobile sub-path, if the subsequent mobile sub-path has been determined, the target object can be controlled to continue moving along the currently determined mobile sub-path, which can avoid waiting for a long response time, that is, reduce the time consumption of waiting for the path finding result to be determined, thereby improving the fluency of the target object navigation process.

[0124] Taking the long-distance pathfinding scenario as an example, in the initial level grid map, it is assumed that the distance between the initial starting point grid and the initial end point grid is far, so the complete moving path from the initial starting point grid to the initial end point grid will be longer, and it will take more time to determine the complete moving path. If the target object is controlled to move along the complete moving path after the complete moving path is determined, it will take a long time to respond, affecting the smoothness of the target object's navigation process. The mobile control method provided in the embodiment of the present application can determine the moving sub-path of the target object in different time slices, and can control the target object to move along the first determined moving sub-path. Then, during the movement of the target object, the next part of the pathfinding result is determined through iterative calculation, so that when the target object moves to the specified position, it can continue to move according to the subsequently determined pathfinding result, which can reduce the time spent waiting for the pathfinding result to be determined, improve the movement efficiency of the target object, and thus improve the smoothness of the target object's navigation process.

[0125] Specifically, the same time slice can also call multiple threads, and the target grids corresponding to the multiple threads need to be adjacent in sequence. For example, multiple threads are called in time slice A1. After the calculation of each currently called thread is completed, that is, after the corresponding moving sub-paths are determined, according to the currently determined moving sub-paths, the target object is controlled to move along the moving sub-path determined in time slice A1 in time slice A2, and subsequent threads are called in time slice A2 to determine the subsequent moving sub-paths. The time of time slice A2 is after the time of time slice A1; therefore, by determining the moving sub-paths corresponding to multiple target grids in parallel, the calculation efficiency of the path can be improved, thereby improving the movement efficiency of the target object.

[0126] Exemplarily, when the target object needs to move from the lower left corner of the grid map to the upper right corner of the grid map, it is assumed that the process of determining the complete moving path is divided into three time slices. First, the moving sub-path of the lower left part can be determined in the first time slice, and then the moving sub-path of the middle part can be determined in the second time slice. In the second time slice, the target object is controlled to start from the initial starting grid and move along the moving sub-path of the lower left part to the first middle grid. Then, the moving sub-path of the upper right part can be determined in the third time slice, and the target object can be controlled to start from the first middle grid and move along the moving sub-path of the middle part to the second middle grid in the third time slice. Then, in the fourth time slice, the target object can be controlled to start from the second middle grid and move along the moving sub-path of the middle part to the initial end grid. The complete moving path is calculated and then the target object is controlled to move along the complete moving path, which is optimized to determine the local moving sub-path and control the target object to move along the local moving path. The target object can also calculate the subsequent moving sub-path while moving, which can effectively reduce the waiting time for calculating the path.

[0127] In one possible implementation, a moving sub-path is determined from within a mapping range of a currently corresponding target grid. Specifically, in a grid map of a level before the target level, a transition grid through which the target object moves is determined from within a mapping range of each target grid; the grid map of the level where the transition grid is located is used as the grid map of the target level, the transition grid is used as the target grid, and the transition grid is again determined in a grid map of a level before the target level, until the transition grid is determined in a grid map of the initial level, and the moving sub-path is determined based on the transition grid.

[0128] Among them, after determining the target grid in the grid map of the target level, the transition movement path of the target object can be determined in the grid map of the previous level based on the mapping range of the target grid in the grid map of the previous level, and the grid in the transition movement path is used as the transition grid. If the previous level is the initial level, the corresponding transition grids can be connected to obtain the moving sub-path of the target object. If the previous level is not the initial level, the transition grid is used as the target grid, and the previous level is used as the target level, and then the above steps of determining the transition grid are repeated, and the transition grid is determined again in the grid map of the previous level until the previous level is the initial level. Through iterative calculation, the transition movement paths of the grid maps of each level before the target level can be determined in turn.

[0129] Based on this, for any iterative process, when determining the transition movement path, it is only necessary to determine the transition movement path from the mapping range of the target grid in the grid map of the previous level, without considering other area ranges in the grid map of the previous level. This can effectively reduce the time complexity of calculating the path, and can quickly determine the transition grid through which the target object moves. For the method of determining the path by traversing all grids, the mobile control method provided in the embodiment of the present application can reduce the time complexity from O(N) to approximately O(logN), where N is the number of grids.

[0130] For example, assuming that the target level is level N, the initial level is level 0, and N is a positive integer, after determining the target grid of level N in the grid map of level N, the transition movement path of the target object can be determined in the grid map of level N-1 based on the mapping range of the target grid of level N in the grid map of level N-1, and the grids in the transition movement path are used as transition grids of level N-1 to determine whether level N-1 is level 0. If level N-1 is level 0, the target movement path of the target object is determined according to each transition grid. If level N-1 is not level 0, the target movement path of the target object is determined according to each transition grid. The transition grid of the N-1 level is used as the target grid of the N-1 level, and then the transition grid of the N-2 level is determined based on the mapping range of the target grid of the N-1 level in the grid map of the N-2 level, and it is judged whether the N-2 level is the 0 level. If the N-2 level is not the 0 level, the iterative calculation continues until the previous level is the 0 level and stops. At this time, the target moving path of the target object can be determined according to the transition grid of the 0 level. Since the target grid can correspond to at least one transition grid of the 0 level, the corresponding transition grids of the 0 level can be connected to obtain the moving sub-path of the target object.

[0131] Specifically, the transition starting grid corresponding to the initial starting grid and the transition ending grid corresponding to the initial ending grid can be determined in the grid map of the previous level of the target level, and the grids within the mapping range of the target grid can be used as candidate grids. Then, the total cost of each candidate grid is calculated by the above-mentioned cost calculation method, and then the transition grid through which the target object moves is screened out from multiple candidate grids. The transition grid is used as the target grid, and the previous level is used as the target level to implement iterative calculation of the transition grid. When the previous level of the target level is the initial level, the moving path of the target object is determined by the currently determined transition grid, and a moving path with a lower moving cost can be obtained. When the target object moves along the moving path with a lower moving cost, it can reach the initial ending grid faster, thereby achieving a better moving effect.

[0132] The following takes the target level as the second level as an example to explain the process of determining the moving sub-path. Figures 5 to 9 , Figure 5An optional structural diagram of an initial level grid map provided in an embodiment of the present application, Figure 6 An optional structural diagram of a grid map of a target level provided in an embodiment of the present application, Figure 7 An optional structural diagram of a target grid provided in an embodiment of the present application is shown in FIG. Figure 8 An optional structural diagram of the mapping range of the target grid provided in an embodiment of the present application, Fig. 9 A schematic diagram of an optional structure of a moving sub-path provided in an embodiment of the present application.

[0133] Depend on Figure 5 It can be seen that based on the location of the target object, the initial starting grid is determined in the grid map of the initial level, and based on the location that the target object needs to reach, the initial ending grid is determined in the grid map of the initial level.

[0134] Depend on Figure 6 It can be seen that, in the grid map of the target level, the aggregated starting grid corresponding to the initial starting grid can be determined, and the aggregated ending grid corresponding to the initial ending grid can be determined.

[0135] Depend on Figure 7 It can be seen that, in the target-level grid map, the total cost of each candidate grid can be calculated by the above-mentioned cost calculation method, and then the target grid through which the target object moves can be screened out from multiple candidate grids.

[0136] Depend on Figure 8 It can be seen that the mapping range of each target grid can be determined in the grid map of the initial level.

[0137] Depend on Fig. 9 It can be seen that the moving sub-path can be determined from the mapping range of each target grid.

[0138] In a possible implementation, in a grid map of a level before the target level, transition grids through which the target object moves are determined from within a mapping range of each target grid. Specifically, the target grids may be added to a target queue according to the movement order of the target objects, wherein the first queue element in the target queue is the target grid corresponding to the initial starting point grid; the first target grid in the target queue is obtained, and in a grid map of a level before the target level, transition grids through which the target object moves are determined starting from a mapping range of the first target grid; when the transition grid is outside the first target grid, the first target grid in the target queue is obtained again, and a transition grid is determined from within a mapping range of the first target grid obtained again, until the target queue is an empty queue.

[0139] Among them, after the target grid is determined in the grid map of the target level, since the target object will pass through each target grid in sequence, the target grid can be added to the target queue according to the moving order of the target object. The earlier the target object passes, the closer it is to the front of the target queue. Conversely, the later the target object passes, the closer it is to the back of the target queue. Therefore, the first target grid in the target queue is the first target grid passed by the target object. Then, the first target grid in the target queue can be obtained. After obtaining the first target grid in the target queue, the first target grid in the target queue is updated to the second target grid passed by the target object. The transition starting point grid can be determined based on the initial starting point grid within the mapping range of the first target grid, and the transition starting point grid is used as the current grid. Then, starting from the mapping range of the current target grid, the next grid reached by taking the current grid as the starting point is determined to obtain the transition grid, and the determined transition grid is used as the current grid, and the next transition grid is determined again. When the next transition grid is outside the mapping range of the current target grid, the first target grid in the target queue is obtained again, and the above steps of determining the transition grid are repeated until the target queue is an empty queue. The transition grid through which the target object moves can be quickly determined from the mapping range of each target grid.

[0140] Specifically, refer to Fig.10 , Fig.10 An optional specific flow chart of the mobile control method provided in an embodiment of the present application.

[0141] Assuming that the target level is N, each target grid is added to the target queue bp. First, the first element top is taken out from the target queue bp, that is, the first target grid in the target queue is obtained. Then, the grid where the initial starting grid is located at the N-1 level is taken as the current grid o. Then, starting from the mapping range of the grid map of the element top at the N-1 level, the transition grid next passed by the target object is determined. For example, the total cost of each grid around the current grid o can be calculated by the above-mentioned cost calculation method, and then the transition grid next passed by the target object is screened out from the grids around the current grid o, and the transition grid next is added to the output queue output, and then The transition grid next is used as the current grid o until the transition grid next is outside the first target grid. The first target grid in the target queue is obtained again, and the above steps are repeated until the target queue bp is empty. The moving path of the target object at the N-1 level is determined according to the output queue output. N is assigned to N-1, which is equivalent to taking the N-1 level as the target level. It is determined again whether the target level is the initial level. If the target level is not the initial level, the output queue output is used as the target queue bp for the next iteration. This realizes the iterative calculation of the moving sub-path of the target object, which can effectively reduce the time complexity of calculating the path and quickly determine the transition grid through which the target object moves.

[0142] In one possible implementation, in a grid map of an initial level, a moving sub-path is determined from within the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-path. Specifically, in a grid map of a level subsequent to the initial level, a preset target waypoint is determined from within the mapping range of each target grid; a moving sub-path that passes through an initial starting grid, a target waypoint, and an initial end grid in sequence is determined from within the mapping range of each target grid, and the target object is controlled to move along the moving sub-path.

[0143] Among them, a plurality of candidate waypoints may be pre-marked in the grid map of the initial level, and a moving path passing through some of the candidate waypoints may be generated, so that a better moving effect can be achieved when the object moves along the moving path.

[0144] For example, the rule for the object's moving speed can be configured as follows: the closer the object is to a candidate waypoint, the faster the object's moving speed is, and the farther the object is from the candidate waypoint, the slower the object's moving speed is. For two moving paths of the same length, the more candidate waypoints the moving path passes through, the faster the object's overall moving speed is usually, which can reduce the time spent on the object's overall moving process, thereby achieving a better moving effect.

[0145] For another example, when an object moves, it consumes resources, which may include food, fuel, currency, etc. The rules for resource consumption can be configured as follows: the closer the object is to a candidate waypoint, the fewer resources it consumes per unit distance moved; the farther the object is from a candidate waypoint, the more resources it consumes per unit distance moved. For two moving paths of the same length, the more candidate waypoints the moving path passes through, the fewer resources the object consumes overall, and more resources can be retained after the overall moving process is completed, thereby achieving a better moving effect.

[0146] For another example, when an object moves, emissions are generated, and the emissions may refer to gases related to carbon emissions. The amount of emissions generated may be configured as follows: the closer the object is to a candidate waypoint, the less emissions are generated per unit distance the object moves; and the farther the object is from the candidate waypoint, the more emissions are generated per unit distance the object moves. For two moving paths of the same length, the more candidate waypoints the moving path passes through, the less emissions the object will generate as a whole. After the overall moving process is completed, even less emissions can be generated, thereby achieving a better moving effect.

[0147] Based on this, candidate waypoints located within the mapping range of the target grid can be screened out from multiple pre-marked candidate waypoints to obtain the target waypoint, and then a moving subpath passing through the target waypoint is generated to control the target object to move along the moving subpath passing through the target waypoint, thereby achieving a better movement effect of the target object.

[0148] Specifically, in order to improve the generation efficiency of the mobile sub-path, the mapping range of each target grid can be set to screen out at most one target waypoint; when there are multiple candidate waypoints within the mapping range of the target grid, one of the candidate waypoints can be randomly selected as the target waypoint; when there are multiple candidate waypoints within the mapping range of the target grid, the distance between each candidate waypoint and the initial starting point grid can be calculated respectively to obtain the first waypoint distance of each candidate waypoint, and the distance between each candidate waypoint and the initial end point grid can be calculated respectively to obtain the second waypoint distance of each candidate waypoint, and then the sum of each first waypoint distance and the corresponding second waypoint distance is calculated respectively to obtain the total waypoint distance of each candidate waypoint, and the candidate waypoints are sorted based on the order of the total waypoint distance from small to large, and the candidate waypoint ranked first is used as the target waypoint.

[0149] In a possible implementation, there are multiple target waypoints, and a moving subpath that passes through an initial starting grid, a target waypoint, and an initial terminal grid in sequence is determined from a mapping range of each target grid. Specifically, a reference subpath preset between at least two target waypoints is obtained; and a moving subpath that passes through an initial starting grid, a reference subpath, and an initial terminal grid in sequence is determined from a mapping range of each target grid.

[0150] Among them, in the grid map of the initial level, there may be a specific channel within the mapping range of each target grid, a first channel opening is set at one end of the channel, and a second channel opening is set at the other end of the channel, the first channel opening and the second channel opening may be set on different grids, the positions of the first channel opening and the second channel opening may be set as target waypoints, and the grids passed by the channel are used as reference subpaths. Since the channel already exists, the reference subpath between the target waypoint of the first channel opening and the target waypoint of the second channel opening may be calculated in advance. When the target object needs to move from the target waypoint of the first channel opening to the target waypoint of the second channel opening, or from the target waypoint of the second channel opening to the target waypoint of the first channel opening, the target object may move along the preset reference subpath, which can achieve better movement effect, and there is no need to calculate the path in real time, which can reduce a large amount of calculation and reduce the storage space occupied by the calculation, thereby reducing the time consumed in the movement process and improving control efficiency.

[0151] For example, in geographical design, there is a specific channel connecting two areas, one channel opening of the channel is located in the first area, and the other channel opening of the channel is located in the second area. The first area and the second area can be adjacent or non-adjacent, and the target object can move along the channel to achieve effective inter-area movement between the first area and the second area.

[0152] In a possible implementation, grid maps of multiple different levels are obtained, specifically, an original map is obtained, and the original map is gridded to obtain a grid map of an initial level; based on the grid map of the initial level, grid maps of multiple levels are obtained through multiple aggregations.

[0153] Based on this, grid maps of other levels except the initial level are all obtained by aggregating the grid maps of the corresponding previous level, and the grid map of the initial level is the original map after gridding. Therefore, it can be considered that the grid maps of each level are obtained based on the same original map. The grid maps of each level can represent the spatial distribution of data features of the mapping objects in the original map. A certain area of ​​the original map can be represented by the corresponding grids in grid maps of different levels. In any two levels of grid maps, if the area of ​​the original map represented by a grid of the grid map of one level is the same as the area of ​​the original map represented by a grid of the grid map of the other level, it means that there is a mapping relationship between the two grids. Usually, any grid of the high-level grid map can have a mapping relationship with multiple grids of the low-level grid map.

[0154] Taking a grid map of any level as an example, the grid map of this level is taken as the first grid map, the grids in the first grid map are taken as the first grids, the grid map of any level before this level is taken as the second grid map, and the grids in the second grid map are taken as the second grids. Normally, multiple second grids of the first grid mapping can be determined in any second grid map.

[0155] In a possible implementation, grid maps of multiple levels are obtained through multiple aggregations. Specifically, the grid map of the initial level is used as the grid map of the current level, and the grid map of the current level is evenly divided into multiple grid areas, wherein the grid area includes a central grid and multiple grids in the same area, and the distance between the grids in the same area and the corresponding central grids is less than or equal to a distance threshold; each central grid and the corresponding grid in the same area are aggregated to obtain a grid map of the next level, and the grid map of the next level is used as the grid map of the current level; the grid map of the current level is aggregated again until the grid size of the aggregated grid map is greater than or equal to a preset size threshold, or until the number of aggregations of the grid map is greater than or equal to a preset number threshold.

[0156] Among them, the grid map of the initial level can be used as the grid map of the current level, and the grid map obtained by subsequent aggregation can also be used as the grid map of the current level. In the grid map of the current level, the grid map can be evenly divided into multiple grid areas by area division. Then, in each grid area, the central grid located at the center of the area and the grids in the same area around the central grid can be determined. Then, all the grids located in the same grid area are aggregated to obtain the grids of the grid map of the next level. After aggregating all the grid areas, the grid map of the next level can be obtained.

[0157] Based on this, after a new grid map is obtained through aggregation, the grid map can be used as the grid map of the current level, and then a new grid map can be obtained again based on the same aggregation method. Therefore, grid maps of multiple levels can be obtained through multiple aggregations.

[0158] Among them, since the size of the grid usually does not exceed the size of the original map, assuming that the original map and the grid are both rectangular, the length of the grid will be smaller than the length of the original map, and the width of the grid will also be smaller than the width of the original map. Therefore, the size threshold can be determined based on the size of the original map. When the grid size of the aggregated grid map is greater than or equal to the size threshold, no aggregation is performed. In addition, the number of aggregations can be limited by setting a number threshold. The initial value of the number of aggregations can be set to zero. After each aggregation to obtain a new grid map, the number of aggregations can be increased by one. When the number of aggregations is greater than or equal to the number threshold, no aggregation is performed.

[0159] Specifically, the edge of each grid area is the edge of the corresponding grid, which is equivalent to dividing the grid map along the edge of the grid. The same grid will only be divided into the same grid area, and will not be divided into different grid areas. In a grid area, the distance between the grid in the same area and the central grid is less than or equal to the distance threshold. Among the candidate grids in the grid map, the grid in the same area of ​​the central grid can be determined by the following method:

[0160] Taking a grid map that can establish a rectangular coordinate system as an example, the positive direction of the x-axis is regarded as the positive right, the negative direction of the x-axis is regarded as the positive left, the positive direction of the y-axis is regarded as the positive top, and the negative direction of the y-axis is regarded as the lower left;

[0161] When the candidate grid is located directly above, directly to the left, directly below or directly to the right of the central grid, the Euclidean distance between the center of the candidate grid and the center of the central grid is calculated to obtain a first distance, and the candidate grid whose first distance is less than or equal to the distance threshold is taken as a grid in the same area as the central grid;

[0162] When the candidate grid is not located directly above, directly to the left, directly below, or directly to the right of the central grid, all grids located directly above the central grid are taken as vertical grids, all grids located directly below the central grid are also taken as vertical grids, all grids located directly to the left of the central grid are taken as horizontal grids, and all grids located directly to the right of the central grid are also taken as horizontal grids. The Euclidean distance between the candidate grid and each vertical grid is calculated to obtain a first calculation result, and the minimum value of the first calculation result is taken as the second distance. The Euclidean distance between the candidate grid and each horizontal grid is calculated to obtain a second calculation result, and the minimum value of the second calculation result is taken as the third distance. The candidate grids whose second distance and third distance are both less than or equal to the distance threshold are taken as the same-area grids of the central grid.

[0163] For example, the distance threshold can be set to 1, and one of the grids in the grid map of the N-1 level is used as the central grid, and the grids located above, below, left, and right of the central grid are used as grids in the same area, and the grids located at the diagonal angles of the central grid are used as grids in the same area. A grid area of ​​three rows and three columns can be determined, and then the grid area is aggregated into a grid of the grid map of the N level. Then, the grid map of the N level is aggregated according to the same aggregation rule to obtain a grid map of the N+1 level.

[0164] For another example, the distance threshold can be set to 2, and one of the grids in the grid map of the N-1 level is taken as the central grid, the grids located in the upper, lower, left and right grids of the central grid are taken as grids in the same area, and some grids located in the diagonal of the central grid are taken as grids in the same area. A grid area of ​​five rows and five columns can be determined, and then the grid area is aggregated into a grid of the grid map of the N level. Then, the grid map of the N level is aggregated according to the same aggregation rule to obtain a grid map of the N+1 level.

[0165] Among them, assuming that the grid is a square, the value of the distance threshold is usually close to the side length of the grid. For example, the distance threshold is set to the side length of the grid, or the distance threshold is set to twice the side length of the grid, so that the number of grids in the grid area is small, and the distance between any two grids in the grid area can also be made smaller. The specific value of the distance threshold is not limited in the embodiment of the present application.

[0166] In a possible implementation, the movement control method also includes: when the target level is the initial level, obtaining multiple pre-stored initial sub-paths, wherein the initial sub-path is a path between any two initial grids, the initial grid is a grid in a grid map of the initial level, and in a grid map of a level subsequent to the initial level, any two initial grids are aggregated into the same grid; and controlling the movement of the target object according to the initial sub-path corresponding to the initial starting grid and the initial ending grid.

[0167] Among them, in the grid map of the initial level, since the moving path between two initial grids that are closer to each other is usually shorter, the time consumed in calculating the moving path is less, and the memory space required to store the moving path is smaller. Therefore, the path between any two initial grids that are closer to each other can be calculated in advance to obtain multiple initial sub-paths, and each storage sub-path can also be stored in advance.

[0168] Specifically, since the grids of the grid map of the latter level are usually obtained by aggregating grids that are closer in the grid map of the previous level, it is possible to judge whether the distance between two grids is closer based on the aggregation results of the grids in the grid map of the initial level. When two grids are aggregated into the same grid in the grid map of the latter level of the initial level, it can be considered that the distance between the two grids is closer. Conversely, when two grids are not aggregated into the same grid in the grid map of the latter level of the initial level, it can be considered that the distance between the two grids is farther.

[0169] Based on this, when the target level is the initial level, the initial starting point grid and the initial end point grid are a pair of initial grids with a relatively close distance. Therefore, the corresponding initial sub-path can be found in the pre-stored multiple storage sub-paths, and then the target object can be controlled to move along the corresponding initial sub-path without calculating the moving path again, which can effectively improve the control efficiency of the target object.

[0170] In addition to the grid map of the initial level, grid maps of other levels can also pre-calculate multiple initial transition paths. The initial transition path is the path between any two initial transition grids. The initial transition grid is the grid in the grid map of the current level. In the grid map of the next level after the current level, any two initial transition grids are aggregated into the same grid. Therefore, in the grid map of the target level, after determining the aggregate starting grid corresponding to the initial starting grid and determining the aggregate ending grid corresponding to the initial ending grid, the initial transition path between the aggregate starting grid and the aggregate ending grid can be directly determined, and then each grid in the initial transition path can be used as the target grid without calculating the moving path again, which can effectively improve the control efficiency of the target object.

[0171] The automatic path-finding process of the mobile control method is described in detail below.

[0172] First, the original map is obtained and gridded to obtain a grid map of the initial level.

[0173] Then, based on the grid map of the initial level, the grid map of the initial level is used as the grid map of the current level, and the grid map of the current level is evenly divided into multiple grid areas, wherein the grid area includes a central grid and multiple grids in the same area, and the distance between the grid in the same area and the corresponding central grid is less than or equal to the distance threshold.

[0174] Then, each central grid and the corresponding grid in the same area are aggregated to obtain a grid map of the next level, and the grid map of the next level is used as the grid map of the current level.

[0175] Then, the grid map of the current level is aggregated again until the grid size of the aggregated grid map is greater than or equal to a preset size threshold, or until the number of aggregations of the grid map is greater than or equal to a preset number threshold, wherein the grid map is divided into multiple grids, and the grid map of the next level is obtained by grid aggregation of the grid map of the previous level.

[0176] Then, starting from the grid map of the initial level, the grids of the grid maps of each level are traversed in sequence until the initial starting point grid and the initial end point grid are aggregated into the same grid in the currently traversed grid map.

[0177] Then, the grid map of the previous level of the currently traversed grid map is determined as the grid map of the target level.

[0178] Then, in the grid map of the target level, the aggregated starting grid corresponding to the initial starting grid and the aggregated ending grid corresponding to the initial ending grid are determined.

[0179] Then, the actual cost between the aggregation start grid and the adjacent candidate grid is determined, and the predicted cost between the candidate grid and the aggregation end grid is determined.

[0180] Then, based on the sum of the actual cost and the predicted cost, the target grid through which the target object moves is screened out from multiple candidate grids.

[0181] Then, in the grid map of the target level, the target grid through which the target object moves is determined, wherein in the grid map of a level subsequent to the target level, the initial starting grid and the initial ending grid are aggregated into the same grid.

[0182] Then, in the grid map of the initial level, the threads corresponding to each target grid are called in sequence according to the movement order of the target objects.

[0183] Then, each time the thread is called, the target grid is added to the target queue according to the moving order of the target object, wherein the first queue element in the target queue is the target grid corresponding to the initial starting grid; the first target grid in the target queue is obtained, and in the grid map of the previous level of the target level, the transition grid through which the target object moves is determined starting from the mapping range of the first target grid; when the transition grid is outside the first target grid, the first target grid in the target queue is obtained again, and the transition grid is determined from the mapping range of the first target grid obtained again, until the target queue is an empty queue.

[0184] Then, the grid map of the level where the transition grid is located is used as the grid map of the target level, and the transition grid is used as the target grid. The transition grid is again determined in the grid map of the level before the target level, until the transition grid is determined in the grid map of the initial level, and the moving sub-path is determined according to the transition grid, wherein at least two moving sub-paths are determined in different time slices.

[0185] Then, whenever the moving sub-path corresponding to the current target grid is determined, the target object is controlled to move along the moving sub-path.

[0186] Then, when the target level is the initial level, multiple pre-stored initial sub-paths are obtained, wherein the initial sub-path is a path between any two initial grids, the initial grid is a grid in the grid map of the initial level, and in the grid map of the next level after the initial level, any two initial grids are aggregated into the same grid; according to the initial sub-path corresponding to the initial starting grid and the initial ending grid, the movement of the target object is controlled.

[0187] Based on this, by obtaining grid maps of multiple levels and determining the initial starting grid and the initial ending grid, the target grid passed by the target object can be quickly determined in the grid map of the target level, and then the moving sub-path is determined from the mapping range of the target grid in the grid map of the initial level. Since the moving sub-path of the target grid is determined from the mapping range of the target grid in the grid map of the initial level, which is equivalent to the search space corresponding to the moving sub-path being the mapping range of the target grid, the space searched for determining the moving sub-path is smaller, which can effectively reduce the time complexity, thereby reducing the time consumption for determining the moving sub-path and improving the fluency of the target object navigation process. On this basis, since at least two moving sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two moving sub-paths, avoiding the blocking of the main thread, thereby further improving the fluency of the target object navigation process.

[0188] The mobile control method provided in the embodiments of the present application can be applied to a variety of scenarios.

[0189] For example, in a navigation scenario of an online game, the grid map may be a virtual map in a virtual scene of the online game, and the target object may be a virtual object in the virtual scene of the online game. After determining the starting point and end point of the movement of the virtual object in the virtual map, the corresponding initial starting point grid and initial end point grid may be determined in the grid map, and then the target grid may be determined in the grid map of the target level based on the initial starting point grid and the initial end point grid. Then, in the grid map of the initial level, the moving sub-path may be determined from the mapping range of the target grid. The space searched for determining the moving sub-path is small, which can effectively reduce the time complexity, thereby reducing the time consumption for determining the moving sub-path and improving the fluency of the target object navigation process. On this basis, since at least two moving sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two moving sub-paths, thereby avoiding blocking of the main thread, thereby further improving the fluency of the target object navigation process.

[0190] Among them, the online game can be a battle type game, and both players can control their respective target objects to join the virtual scene. The virtual map can be determined based on the projection of the virtual scene on the horizontal plane, and then the virtual map can be gridded, and multiple grid maps of different levels can be obtained through multiple aggregation processes. Taking the target object of one of the players as an example, the initial starting point grid can be determined based on the current position of the target object of the party, and the initial end point grid can be determined based on the current position of the target object of the other party. Then, the target grid is determined in the grid map of the target level based on the initial starting point grid and the initial end point grid, and then the moving sub-path of each target grid is determined. The target object of the party can be controlled to move along the moving sub-path toward the initial end point grid. On this basis, the target object of the party can be pre-configured with an action range. In the process of controlling the movement of the target object of the party, it is necessary to obtain the object distance between the target object of the party and the target object of the other party. When the object distance is less than or equal to the action range, the control of the movement of the target object of the party is stopped. At this time, the target object of the party can make corresponding actions.

[0191] Specifically, refer to Fig.11 , Fig.11 An optional interface diagram of a game scene provided in an embodiment of the present application.

[0192] Among them, the game scene is provided with a battle platform 1101, on which virtual characters can be placed, and obstacles 1102 can also be placed on the battle platform 1101. The virtual characters can move in the area of ​​the battle platform 1101 where no obstacles 1102 are placed. The virtual characters can include the virtual commander 1103 of the own side, the virtual members 1104 of the own side, the virtual commander 1105 of the opponent side, the virtual members 1106 of the opponent side, etc. The players of the own side can drag the character card at the bottom of the interface to the designated area of ​​the battle platform 1101, and then generate the corresponding virtual character of the own side in the designated area of ​​the battle platform 1101. Similarly, the players of the opponent side can also drag the character card to the designated area of ​​the battle platform 1101, and then generate the corresponding virtual character of the opponent side in the designated area of ​​the battle platform 1101.

[0193] When a new virtual member 1104 of the party is generated in the battle platform 1101, the virtual member 1104 of the party can be controlled to automatically find a path. The process of automatic path finding is as follows: based on the battle platform 1101, multiple grid maps of different levels are determined, and the virtual member 1104 of the party is used as the target object. The initial starting grid is determined based on the location of the target object, and the initial end grid is determined based on the location of the opponent's virtual commander 1105. The target grid is determined in the grid map of the target level based on the initial starting grid and the initial end grid, and then the target grid is determined in the initial grid. In the grid map of the first level, the moving sub-paths are determined from the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-paths, so that the virtual member 1104 of the party can move toward the virtual commander 1105 of the other party. During the movement of the virtual member 1104 of the party, it is also necessary to analyze the virtual member 1106 of the other party or whether the virtual member 1106 of the other party has entered the action range of the virtual member 1104 of the party. If it has entered the action range of the virtual member 1104 of the party, the control of the virtual member 1104 of the party can be stopped to continue to move.

[0194] For another example, in a vehicle navigation scenario, the grid map may be a road map in a real scene, and the target object may be a vehicle in the real scene. After determining the starting point and end point of the vehicle's movement in the road map, the corresponding initial starting point grid and initial end point grid may be determined in the grid map, and then the target grid may be determined in the target-level grid map based on the initial starting point grid and the initial end point grid. Then, in the grid map of the initial level, the mobile sub-path may be determined from the mapping range of the target grid. The search space for determining the mobile sub-path is small, which can effectively reduce the time complexity, thereby reducing the time consumption for determining the mobile sub-path and improving the smoothness of the target object navigation process. On this basis, since at least two mobile sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two mobile sub-paths, thereby avoiding blocking of the main thread, thereby further improving the smoothness of the target object navigation process.

[0195] It is to be understood that, although the steps in the above-mentioned various flow charts are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flow charts can include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.

[0196] Reference Fig.12 , Fig.12 This is an optional structural diagram of a mobile control device provided in an embodiment of the present application. The mobile control device 1200 includes:

[0197] The acquisition module 1201 is used to acquire grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of the next level is obtained by grid aggregation of the grid map of the previous level;

[0198] A first grid determination module 1202 is used to determine an initial starting grid and an initial ending grid for the target object to move in the grid map of the initial level;

[0199] A second grid determination module 1203 is used to determine, in a grid map of a target level, a target grid through which the target object moves, wherein in a grid map of a level after the target level, an initial starting grid and an initial ending grid are aggregated into a same grid;

[0200] The control module 1204 is used to determine a moving sub-path from the mapping range of each target grid in the initial level grid map, and control the movement of the target object according to the moving sub-path, wherein at least two moving sub-paths are determined in different time slices.

[0201] Furthermore, the control module 1204 is specifically used for:

[0202] Determine the moving sub-paths from the mapping range of each target grid respectively, and control the movement of the target object according to the moving sub-paths, including:

[0203] Call the threads corresponding to each target grid in turn according to the movement order of the target objects;

[0204] Whenever the thread is called, the moving subpath is determined from the mapping range of the current corresponding target grid;

[0205] Whenever the moving sub-path corresponding to the current target grid is determined, the target object is controlled to move along the moving sub-path.

[0206] Furthermore, the control module 1204 is specifically used for:

[0207] In the grid map of the previous level of the target level, a transition grid through which the target object moves is determined from the mapping range of each target grid;

[0208] The grid map of the level where the transition grid is located is used as the grid map of the target level, and the transition grid is used as the target grid. The transition grid is determined again in the grid map of the level before the target level, until the transition grid is determined in the grid map of the initial level, and the moving sub-path is determined according to the transition grid.

[0209] Furthermore, the control module 1204 is specifically used for:

[0210] Add the target grid to the target queue according to the moving order of the target object, where the first queue element in the target queue is the target grid corresponding to the initial starting grid;

[0211] Get the first target grid in the target queue, and determine the transition grid through which the target object moves, starting from the mapping range of the first target grid in the grid map of the previous level of the target level;

[0212] When the transition grid is outside the first target grid, the first target grid in the target queue is obtained again, and the transition grid is determined from the mapping range of the first target grid obtained again until the target queue is an empty queue.

[0213] Further, the second grid determination module 1203 is specifically used for:

[0214] In the grid map of the target level, determine the aggregated starting grid corresponding to the initial starting grid and the aggregated ending grid corresponding to the initial ending grid;

[0215] Determine the actual cost between the aggregation starting point grid and the adjacent candidate grid, and determine the predicted cost between the candidate grid and the aggregation end point grid;

[0216] Based on the sum of the actual cost and the predicted cost, the target grid through which the target object moves is screened out from multiple candidate grids.

[0217] Furthermore, the control module 1204 is specifically used for:

[0218] In a grid map of a level subsequent to the initial level, a preset target waypoint is determined from a mapping range of each target grid;

[0219] A moving subpath that sequentially passes through an initial starting point grid, a target waypoint, and an initial end point grid is determined from within the mapping range of each target grid, and the target object is controlled to move along the moving subpath.

[0220] Furthermore, the number of target waypoints is multiple, and the control module 1204 is specifically used for:

[0221] Acquire a preset reference subpath passing through at least two target waypoints;

[0222] A moving subpath that sequentially passes through an initial starting point grid, a reference subpath, and an initial end point grid is determined from within the mapping range of each target grid.

[0223] Furthermore, the acquisition module 1201 is specifically used for:

[0224] Obtain the original map, grid the original map, and obtain a grid map of the initial level;

[0225] Based on the grid map of the initial level, grid maps of multiple levels are obtained through multiple aggregations.

[0226] Furthermore, the acquisition module 1201 is specifically used for:

[0227] The grid map of the initial level is used as the grid map of the current level, and the grid map of the current level is evenly divided into a plurality of grid areas, wherein the grid area includes a central grid and a plurality of grids in the same area, and the distance between the grid in the same area and the corresponding central grid is less than or equal to a distance threshold;

[0228] Aggregate each central grid and the corresponding grid in the same area to obtain a grid map of the next level, and use the grid map of the next level as the grid map of the current level;

[0229] The grid map of the current level is aggregated again until the grid size of the aggregated grid map is greater than or equal to a preset size threshold, or until the number of aggregations of the grid map is greater than or equal to a preset number threshold.

[0230] Furthermore, the control module 1204 is also used for:

[0231] When the target level is the initial level, a plurality of pre-stored initial subpaths are obtained, wherein the initial subpath is a path between any two initial grids, the initial grid is a grid in a grid map of the initial level, and in a grid map of a level subsequent to the initial level, any two initial grids are aggregated into the same grid;

[0232] The movement of the target object is controlled according to the initial subpath corresponding to the initial starting point grid and the initial end point grid.

[0233] Furthermore, the second grid determination module 1203 is further used for:

[0234] Starting from the grid map of the initial level, the grids of the grid maps of each level are traversed in sequence until the initial starting grid and the initial ending grid are aggregated into the same grid in the currently traversed grid map;

[0235] The grid map of the previous level of the currently traversed grid map is determined as the grid map of the target level.

[0236] The above-mentioned mobile control device 1200 and the mobile control method applied to the central node are based on the same inventive concept. By acquiring grid maps of multiple levels and determining the initial starting grid and the initial ending grid, the target grid passed by the target object can be quickly determined in the grid map of the target level. Then, in the grid map of the initial level, the mobile sub-path is determined from the mapping range of the target grid. Since the mobile sub-path of the target grid is determined from the mapping range of the target grid in the grid map of the initial level, it is equivalent to the search space corresponding to the mobile sub-path being the mapping range of the target grid. Therefore, the space searched for determining the mobile sub-path is small, which can effectively reduce the time complexity, thereby reducing the time consumption of determining the mobile sub-path and improving the fluency of the target object navigation process. On this basis, since at least two mobile sub-paths are determined in different time slices, it is equivalent to splitting the determination action of at least two mobile sub-paths, avoiding the blocking phenomenon of the main thread, thereby further improving the fluency of the target object navigation process.

[0237] The electronic device for executing the above-mentioned mobile control method provided in the embodiment of the present application may be a terminal. Fig.13 , Fig.13 This is a partial structural block diagram of a terminal provided in an embodiment of the present application. The terminal includes: a camera assembly 1310, a memory 1320, an input unit 1330, a display unit 1340, a sensor 1350, an audio circuit 1360, a wireless fidelity (WiFi) module 1370, a processor 1380, and a power supply 1390. Those skilled in the art can understand that Fig.13 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0238] The camera assembly 1310 can be used to capture images or videos. Optionally, the camera assembly 1310 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions.

[0239] The memory 1320 may be used to store software programs and modules. The processor 1380 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the memory 1320 .

[0240] The input unit 1330 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 1330 may include a touch panel 1331 and other input devices 1332 .

[0241] The display unit 1340 may be used to display input information or provided information and various menus of the terminal. The display unit 1340 may include a display panel 1341 .

[0242] The audio circuit 1360 , the speaker 1361 , and the microphone 1362 may provide an audio interface.

[0243] The power source 1390 may be alternating current, direct current, a disposable battery, or a rechargeable battery.

[0244] The number of sensors 1350 may be one or more, and the one or more sensors 1350 include but are not limited to: acceleration sensors, gyroscope sensors, pressure sensors, optical sensors, etc. Among them:

[0245] The acceleration sensor can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 1380 can control the display unit 1340 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor. The acceleration sensor can also be used for collecting game or user motion data.

[0246] The gyroscope sensor can detect the body direction and rotation angle of the terminal, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the terminal. The processor 1380 can implement the following functions based on the data collected by the gyroscope sensor: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0247] The pressure sensor can be set in the side frame of the terminal and / or the lower layer of the display unit 1340. When the pressure sensor is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the processor 1380 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor. When the pressure sensor is set in the lower layer of the display unit 1340, the processor 1380 controls the operability controls on the UI interface according to the user's pressure operation on the display unit 1340. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0248] The optical sensor is used to collect the ambient light intensity. In one embodiment, the processor 1380 can control the display brightness of the display unit 1340 according to the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 1340 is increased; when the ambient light intensity is low, the display brightness of the display unit 1340 is decreased. In another embodiment, the processor 1380 can also dynamically adjust the shooting parameters of the camera assembly 1310 according to the ambient light intensity collected by the optical sensor.

[0249] In this embodiment, the processor 1380 included in the terminal can execute the mobile control method of the previous embodiment.

[0250] The electronic device for executing the above-mentioned mobile control method provided in the embodiment of the present application may also be a server, referring to Fig.14 , Fig.14 Partial structural block diagram of the server provided in the embodiment of the present application, the server 1400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 1422 (for example, one or more processors) and memory 1432, one or more storage media 1430 (for example, one or more mass storage devices) storing application programs 1442 or data 1444. Among them, the memory 1432 and the storage medium 1430 can be short-term storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server 1400. Furthermore, the central processing unit 1422 can be configured to communicate with the storage medium 1430 and execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0251] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or, one or more operating systems 1441, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0252] The processor in the server 1400 may be configured to execute the mobile control method.

[0253] The embodiment of the present application also provides a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the mobile control methods of the above-mentioned embodiments.

[0254] The embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned movement control method.

[0255] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0256] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0257] It should be understood that in the description of the embodiments of the present application, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.

[0258] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0259] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0260] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0261] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0262] It should also be understood that the various implementations provided in the embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0263] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions under the shared conditions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A mobile control method, characterized in that: include: Acquire grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of a later level is obtained by grid aggregation of the grid map of a previous level; In the grid map of the initial level, determining an initial starting grid and an initial ending grid for the movement of the target object; In the grid map of the target level, determining a target grid through which the target object moves, wherein in the grid map of a level after the target level, the initial starting grid and the initial ending grid are aggregated into the same grid; In the grid map of the initial level, moving sub-paths are determined from the mapping range of each target grid, and the movement of the target object is controlled according to the moving sub-paths, wherein at least two of the moving sub-paths are determined in different time slices.

2. The mobile control method according to claim 1, characterized in that: The determining of movement sub-paths from the mapping range of each of the target grids, and controlling the movement of the target object according to the movement sub-paths, comprises: Calling the threads corresponding to the target grids in sequence according to the moving order of the target objects; Whenever the thread is called, a moving subpath is determined from within the mapping range of the currently corresponding target grid; Whenever the moving sub-path corresponding to the current target grid is determined, the target object is controlled to move along the moving sub-path.

3. The mobile control method according to claim 2, characterized in that: The determining of the moving sub-path from within the mapping range of the currently corresponding target grid includes: In the grid map of a level before the target level, determining the transition grid through which the target object moves from within the mapping range of each of the target grids; The grid map of the level where the transition grid is located is used as the grid map of the target level, and the transition grid is used as the target grid. The transition grid is again determined in the grid map of the level before the target level, until the transition grid is determined in the grid map of the initial level, and the moving sub-path is determined according to the transition grid.

4. The mobile control method according to claim 3, characterized in that: Determining the transitional grid through which the target object moves from within the mapping range of each of the target grids in the grid map of the previous level of the target level includes: Adding the target grid to the target queue according to the moving order of the target object, wherein the first queue element in the target queue is the target grid corresponding to the initial starting grid; Obtain the first target grid in the target queue, and determine the transition grid through which the target object moves, starting from the mapping range of the first target grid in the grid map of the previous level of the target level; When the transition grid is outside the first target grid, the first target grid in the target queue is acquired again, and the transition grid is determined from the mapping range of the first target grid acquired again until the target queue is an empty queue.

5. The mobile control method according to claim 1, characterized in that: Determining, in the grid map at the target level, a target grid through which the target object moves, comprises: In the grid map of the target level, determining an aggregated starting grid corresponding to the initial starting grid and an aggregated ending grid corresponding to the initial ending grid; Determine the actual cost between the aggregation starting point grid and the adjacent candidate grid, and determine the predicted cost between the candidate grid and the aggregation end point grid; Based on the sum of the actual cost and the predicted cost, a target grid through which the target object moves is screened out from the plurality of candidate grids.

6. The mobile control method according to claim 1, characterized in that: In the grid map of the initial level, determining a moving sub-path from within the mapping range of each target grid, and controlling the movement of the target object according to the moving sub-path, comprises: In the grid map of a level after the initial level, respectively determining a preset target waypoint from within a mapping range of each target grid; A moving sub-path sequentially passing through the initial starting point grid, the target waypoint and the initial end point grid is determined from within the mapping range of each target grid, and the target object is controlled to move along the moving sub-path.

7. The mobile control method according to claim 6, characterized in that: There are multiple target waypoints, and determining a moving subpath that sequentially passes through the initial starting point grid, the target waypoint, and the initial end point grid from the mapping range of each target grid includes: Acquire a preset reference subpath passing through at least two of the target waypoints; A moving sub-path that sequentially passes through the initial starting point grid, the reference sub-path, and the initial end point grid is determined from within the mapping range of each of the target grids.

8. The mobile control method according to claim 1, characterized in that: The obtaining of multiple grid maps at different levels includes: Obtaining an original map, and gridding the original map to obtain a grid map of an initial level; Based on the grid map of the initial level, grid maps of multiple levels are obtained through multiple aggregations.

9. The mobile control method according to claim 8, characterized in that: The grid maps of multiple levels are obtained by multiple aggregations, including: Using the grid map of the initial level as the grid map of the current level, and evenly dividing the grid map of the current level into a plurality of grid areas, wherein the grid area includes a central grid and a plurality of grids in the same area, and the distance between the grid in the same area and the corresponding central grid is less than or equal to a distance threshold; Aggregate each of the central grids and the corresponding grids in the same area to obtain the grid map of the next level, and use the grid map of the next level as the grid map of the current level; The grid map of the current level is aggregated again until the grid size of the aggregated grid map is greater than or equal to a preset size threshold, or until the number of aggregations of the grid map is greater than or equal to a preset number threshold.

10. The mobile control method according to claim 1, characterized in that: The movement control method further includes: When the target level is the initial level, a plurality of pre-stored initial subpaths are obtained, wherein the initial subpath is a path between any two initial grids, the initial grids are grids in the grid map of the initial level, and in the grid map of a level after the initial level, any two initial grids are aggregated into the same grid; The target object is controlled to move according to the initial subpath corresponding to the initial starting point grid and the initial end point grid.

11. The mobile control method according to claim 1, characterized in that: Before determining the target grid through which the target object moves in the grid map of the target level, the movement control method further includes: Starting from the grid map of the initial level, the grids of the grid map of each level are traversed in sequence until the initial starting grid and the initial ending grid are aggregated into the same grid in the currently traversed grid map; The grid map of a previous level of the currently traversed grid map is determined as the grid map of the target level.

12. A mobile control device, characterized in that: include: An acquisition module, used for acquiring grid maps of multiple different levels, wherein the grid map is divided into multiple grids, and the grid map of the next level is obtained by grid aggregation of the grid map of the previous level; A first grid determination module, used to determine an initial starting grid and an initial ending grid for movement of a target object in the grid map of the initial level; A second grid determination module is used to determine, in the grid map of the target level, a target grid through which the target object moves, wherein, in the grid map of a level after the target level, the initial starting grid and the initial ending grid are aggregated into the same grid; A control module is used to determine a moving sub-path from the mapping range of each of the target grids in the grid map of the initial level, and control the movement of the target object according to the moving sub-path, wherein at least two of the moving sub-paths are determined in different time slices.

13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the movement control method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the movement control method according to any one of claims 1 to 11 is implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the movement control method according to any one of claims 1 to 11 is implemented.

Citation Information

Cited By

  • Unmanned aerial vehicle path planning navigation method and system based on layer-by-layer grid map

    CN120970615A