Point position query method and device in electronic map, equipment and medium

By dividing the electronic map into grids and pre-calculating the correspondence between grids and points, the computational burden caused by the large number of points is solved, and efficient point query is achieved.

CN120929544APending Publication Date: 2025-11-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410565428.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

In electronic maps, when there are many points, existing technologies need to calculate the relationship between coordinates and each point in real time, resulting in high computational pressure and high time complexity.

Method used

The electronic map is divided into multiple grids arranged in an array. The correspondence between grids and points is pre-calculated. The coordinates of the points are determined by querying the points to which the grids belong, thus reducing real-time calculations.

Benefits of technology

It reduces the computational burden of location lookup, improves lookup efficiency, and does not consume lookup time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929544A_ABST
    Figure CN120929544A_ABST
Patent Text Reader

Abstract

The invention discloses a point location query method and device in an electronic map, equipment, a medium and a program product, and belongs to the field of data query. The electronic map comprises a plurality of point locations, the electronic map is divided into a plurality of grids arranged in an array, and the method comprises the following steps: obtaining a first coordinate to be queried; determining a first grid to which the first coordinate belongs in the plurality of grids; querying a first point location to which the first grid belongs based on an affiliation corresponding relationship, wherein the affiliation corresponding relationship comprises a corresponding relationship between at least one grid and a point location overlapped with the at least one grid; and taking the first point as a point query result of the first coordinate. According to the method, the first point location to which the first grid belongs is queried based on the affiliation corresponding relation, and the first grid comprises the first coordinate to be queried, so that real-time calculation is not needed when the point location to which the coordinate belongs is queried, and the calculation pressure of point location query is reduced. The embodiment of the invention can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, auxiliary driving and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data query, and in particular to a method, apparatus, device, medium, and program product for querying points in an electronic map. Background Technology

[0002] In the internet age, video games are an important part of online activities, and AI commentary supported by artificial intelligence (AI) technology is gradually maturing. Much of the content of AI commentary is related to points within video games. For example, identifying the current location of a user-controlled virtual character requires determining its relationship to points. Points are pre-defined polygonal areas on an electronic map, such as the areas occupied by buildings, lakes, forests, and other special terrain features.

[0003] In related technologies, the relationship between the coordinates of the current position of the virtual character and each point is calculated in real time to determine the point to which the coordinates belong.

[0004] However, the number of points is usually quite large. To determine which point the coordinates are in using the above method, it is necessary to calculate the relationship between the coordinates and each point. The more points there are, the greater the computational burden. Summary of the Invention

[0005] This application provides a method, apparatus, device, medium, and program product for querying points in an electronic map, and the technical solution includes at least one of the following aspects.

[0006] According to one aspect of the embodiments of this application, a method for querying points in an electronic map is provided. The electronic map includes a plurality of points and is divided into multiple grids arranged in an array. The method includes:

[0007] Get the first coordinates to be queried. The first coordinates are the coordinates of any point on the electronic map.

[0008] Determine the first grid to which the first coordinate belongs among multiple grids;

[0009] Based on the attribution correspondence, the first point to which the first grid belongs is queried. The attribution correspondence includes the correspondence between at least one grid and the point that overlaps with at least one grid. The point is a pre-set polygonal area in the electronic map.

[0010] The query results are obtained by using the first point as the first coordinate.

[0011] According to another aspect of the embodiments of this application, a point query device in an electronic map is provided. The electronic map includes a plurality of points and is divided into multiple grids arranged in an array. The device includes:

[0012] The acquisition module is used to obtain the first coordinate to be queried, which is the coordinate corresponding to any point in the electronic map;

[0013] The determination module is used to determine the first grid to which the first coordinate belongs among multiple grids;

[0014] The query module is used to query the first point to which the first grid belongs based on the attribution correspondence. The attribution correspondence includes the correspondence between at least one grid and the point that overlaps with at least one grid. The point is a pre-set polygonal area in the electronic map.

[0015] The output module is used to retrieve the query results of points with the first point as the first coordinate.

[0016] According to another aspect of the embodiments of this application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one program; the processor is configured to execute the at least one program in the memory to implement the point query method in the above-described electronic map.

[0017] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, which stores at least one program, which is loaded and executed by a processor to implement the point query method in the above-described electronic map.

[0018] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor retrieves the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the point query method in the above-described electronic map.

[0019] The technical solutions provided in this application embodiment may include the following beneficial effects:

[0020] After obtaining the first coordinate to be queried, this method determines the first grid to which the first coordinate belongs, and then queries the first point to which the first grid belongs based on the attribution correspondence. Since the attribution correspondence is a pre-calculated correspondence between grids and points, it does not need to be calculated in real time when querying the point to which the coordinate belongs, thus not taking up query time and reducing the computational pressure of point query. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 A schematic diagram of a computer system provided in an exemplary embodiment of this application is shown;

[0023] Figure 2 A schematic diagram of a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0024] Figure 3 A schematic diagram illustrating a method for determining the relationship between coordinates and point locations provided in an exemplary embodiment of this application is shown.

[0025] Figure 4 A flowchart illustrating a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0026] Figure 5 A schematic diagram of mesh division provided in an exemplary embodiment of this application is shown;

[0027] Figure 6 A schematic diagram of mesh division provided in an exemplary embodiment of this application is shown;

[0028] Figure 7 A flowchart illustrating a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0029] Figure 8 A flowchart illustrating a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0030] Figure 9 A flowchart illustrating a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0031] Figure 10 A flowchart illustrating a point query method in an electronic map provided in an exemplary embodiment of this application is shown;

[0032] Figure 11 A flowchart illustrating a method for querying game locations in a game electronic map provided in an exemplary embodiment of this application is shown.

[0033] Figure 12 A flowchart illustrating a navigation point query method in a navigation electronic map provided in an exemplary embodiment of this application is shown.

[0034] Figure 13 A block diagram of a point query device in an electronic map provided in an exemplary embodiment of this application is shown;

[0035] Figure 14 A structural block diagram of a computer device provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0038] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0039] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0040] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0041] First, let me explain some of the terms used in this application:

[0042] Artificial Intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0043] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics. Among these, pre-trained models, also known as large-scale models or foundational models, can be widely applied to downstream tasks across various AI fields after fine-tuning. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0044] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, digital twins, virtual humans, robots, AI-generated content, conversational interaction, smart healthcare, smart customer service, and game AI. As the technology develops, AI will be applied in more fields and play an increasingly important role.

[0045] Real-time game AI commentary: A system that provides real-time commentary and broadcasts of game content, including in-game event broadcasts, in-game analysis broadcasts, and broadcasts of relevant information outside the game.

[0046] Points: These are pre-defined polygonal areas in an electronic map, such as the areas occupied by buildings, lakes, forests, and other special terrain features. They include regular and irregular polygons and can also be called map points.

[0047] Algorithm time complexity: refers to the time consumed by executing the current algorithm, usually represented by the symbol O, or simply time complexity. For example, O(n) means that the time complexity is directly proportional to the amount of data in the problem; the larger the amount of data, the longer it takes to execute the algorithm. O(1) means that the time complexity is independent of the amount of data in the problem; the time consumed by executing the algorithm remains unchanged even when the amount of data changes.

[0048] Figure 1 A schematic diagram of a computer system 100 provided in an exemplary embodiment of this application is shown. The computer system 100 includes: a terminal 110 and a server 120.

[0049] Terminal 110 has a game client 111 installed and running that supports a virtual environment. This game client 111 can be a multiplayer online battle arena (MOBA) program. When terminal 110 runs the game client 111, the user interface of the game client 111 is displayed on the screen of terminal 110, and the user interface includes an electronic map. In this embodiment, terminal 110 is the terminal used by user 112. When the account controlled by user 112 moves within the game corresponding to game client 111, the electronic map displays an icon corresponding to the moving account controlled by user 112. The game client 111 can be any of the following: Virtual Reality (VR) application, Augmented Reality (AR) application, 3D map application, Virtual Reality game, Augmented Reality game, First-Person Shooter (FPS) game, Third-Person Shooter (TPS) game, Multiplayer Online Battle Arena (MOBA) game, or strategy board game. In the embodiments of this application, the terms object, user, account, player, etc. have the same meaning, and this application does not limit them.

[0050] Terminal 110 can refer to one of multiple terminals, but this embodiment only uses terminal 110 as an example. The device type of terminal 110 includes at least one of the following: smartphone, tablet computer, virtual reality device, augmented reality device, medical equipment, e-book reader, MP3 player, MP4 player, laptop portable computer, and desktop computer.

[0051] Figure 1Only one terminal is shown, but in different embodiments, other terminals 130 exist to access the server 120. Optionally, one or more other terminals 130 are terminals corresponding to developers, and a development and editing platform for a game client 111 supporting a virtual environment is installed on the other terminals 130. Developers can edit and update the game client 111 on the other terminals 130, and transmit the updated game client installation package to the server 120 via a wireless network or wired network. Terminal 110 can download the game client installation package from the server 120 to update the game client 111.

[0052] Terminal 110 and other terminals 130 are connected to server 120 via wireless or wired networks.

[0053] Server 120 is a network device that includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Server 120 provides backend services for game clients 111 that support a virtual environment. Optionally, server 120 performs the primary computing task, and terminal 110 performs secondary computing tasks; or, server 120 performs secondary computing tasks, and terminal 110 performs primary computing tasks; or, server 120 and terminal 110 collaborate on computing using a distributed computing architecture.

[0054] Optionally, server 120 includes a user-facing input / output (I / O) interface 121, a processor 122, a user account database 123, and a battle service module 124. The processor 122 is used to load instructions stored in the server 120 and process data in the user account database 123 and the battle service module 124. The user account database 123 is used to store data of user accounts used by the terminal 110 and other terminals 130, such as the user account's avatar, nickname, combat power index, and service area. The battle service module 124 is used to provide multiple battle modes for users to play, such as 1V1 battle mode, 3V3 battle mode, 5V5 battle mode, or a battle mode in which one or more users form a camp, and then multiple camps (more than 3) fight against each other and are ranked and eliminated according to the results of the battles. The user-facing I / O interface 121 is used to establish communication and exchange data with the terminal 110 and / or other terminals 130 through a wireless network or wired network.

[0055] Those skilled in the art will understand that the number of terminals 110 described above can be more or less. For example, there may be only one terminal 110, or there may be dozens or hundreds of terminals 110, or even more. This application does not limit the number or type of terminals 110 in its embodiments.

[0056] In the internet age, video games are an important part of online activities, and AI-supported commentary is gradually maturing. Much of the content of AI commentary relates to points within video games. For example, identifying the current location of a user-controlled virtual character requires determining its relationship to points. Points are pre-defined polygonal areas on an electronic map, including regular and irregular polygons. Examples include the areas occupied by buildings, lakes, forests, and other special terrain features on the electronic map, which can be simply referred to as a map.

[0057] In related technologies, the relationship between the coordinates of the current position of the virtual character and each point is calculated in real time to determine the point to which the coordinates belong.

[0058] However, the number of points is usually quite large. Determining which point a coordinate belongs to using the above method requires calculating the relationship between the coordinate and each point. The more points there are, the greater the computational burden. For example, assuming there are n points and m sides of the polygon corresponding to each point, the time complexity of calculating all points is O(n*m). The greater the number of points and polygon sides, the higher the time complexity and the greater the computational burden.

[0059] To address the aforementioned issues, this application provides a method for querying points in an electronic map. Figure 2 A schematic diagram of a point query method in an electronic map provided in an exemplary embodiment of this application is shown, the method being executed by a terminal 110 and a server 120.

[0060] Terminal 110 interacts with server 120 via a wireless or wired network. Terminal 110 has a game client 111 that supports a virtual environment installed and running. When terminal 110 runs the game client 111, the user interface of the game client 111 is displayed on the screen of terminal 110, and the user interface includes an electronic map 200. When the virtual character 201 controlled by the object moves in the game, the electronic map 200 displays an icon corresponding to the moving virtual character 201. In this embodiment, the terms virtual character, object, user, account, and player have the same meaning, and this application does not limit their usage.

[0061] Terminal 110 sends the first coordinates corresponding to the location of the virtual character 201 on the electronic map 200 to server 120. For example, the first coordinates (m1, n1) are sent to server 120.

[0062] In some embodiments, the server pre-calculates the attribution correspondence between grids and points, and the attribution correspondence includes the correspondence between at least one grid and points that overlap with at least one grid.

[0063] For example, such as Figure 2 As shown, in area 230 of electronic map 200, there is a first point 210. Electronic map 200 is divided into multiple grids arranged in an array, including the first grid (m, n). The server pre-calculates whether each grid has overlapping points. When the coordinates in the grid are within the point, it indicates that there is an overlapping point with the grid. In the case of overlapping points, the attribution relationship between the grid and the point is stored. For example, the first grid (m, n) belongs to the first point 210.

[0064] In some embodiments, via such Figure 3 The method shown determines whether the coordinates are within the point location. Figure 3 This illustration shows a schematic diagram of a method for determining the relationship between coordinates and point positions according to an exemplary embodiment of this application. Figure 3 In (a), a ray is emitted horizontally to the right from coordinate 310, intersecting polygon 311 at 3 points (3 being an odd number), and coordinate 310 lies within polygon 311; Figure 3 In (b), a ray is emitted horizontally to the right from coordinate 320, and the number of intersections with polygon 321 is 2, which is an even number. Coordinate 320 is outside polygon 321.

[0065] After the calculation is completed, the server 120 stores the correspondence between each grid and a point, as well as the correspondence between each coordinate and the grid. Each grid includes one or more coordinates. For example, the first grid (m,n) includes 9 coordinates: (m1,n1), (m2,n2), ..., (m9,n9). This embodiment does not limit the number of coordinates included in each grid. A point is a pre-defined polygonal area in the electronic map, referring to the area occupied by special terrains such as buildings, lakes, and forests in the electronic map. This area includes regular polygons and irregular polygons. When the server 120 receives the first coordinate sent by the terminal 110, it sends the first point information corresponding to the first coordinate to the terminal 110. For example, when the first coordinate (m1,n1) is received, since the first coordinate (m1,n1) belongs to the first grid (m,n), and the first grid (m,n) belongs to the first point 210, the server 120 sends the first point information related to the first point 210 to the terminal 110.

[0066] In some embodiments, if the first coordinates sent by the terminal 110 do not have corresponding point information, the server 120 may send no corresponding information to the terminal 110 or not send any information.

[0067] In some embodiments, terminal 110 includes an AI narration module, which is used to broadcast narration content. This narration content is generated by server 120 based on the first point information and then sent to terminal 110. For example, after receiving the first coordinates (m1, n1), the narration content "Virtual character 201 is currently at the first point 210" is generated based on the first point 210 to which the first coordinates (m1, n1) belong and sent to terminal 110, whereby the AI ​​narration module broadcasts the narration content.

[0068] When the virtual character 201 moves, for example, from the first coordinate (m1,n1) to the coordinate (p1,q1), the terminal 110 sends the current coordinate (p1,q1) of the virtual character 201 to the server 120 to obtain the point information related to the second point 220 to which the coordinate (p1,q1) belongs.

[0069] For example, terminal 110 sends the current coordinates (p1, q1) of virtual character 201 to server 120. Server 120 generates the narration "virtual character 201 is currently at point 220" based on the second point 220 to which coordinates (p1, q1) belong and sends it to terminal 110. The AI ​​narration module then broadcasts the narration.

[0070] In summary, the method provided in this embodiment, after obtaining the first coordinate to be queried, determines the first grid to which the first coordinate belongs, and then queries the first point to which the first grid belongs based on the attribution correspondence. Since the attribution correspondence is a pre-calculated correspondence between grids and points, it does not need to be calculated in real time when querying the point to which the coordinate belongs, thus not occupying query time and reducing the computational pressure of point query.

[0071] Figure 4 A flowchart of a point query method in an electronic map provided by an exemplary embodiment of this application is shown. The electronic map includes a number of points and is divided into multiple grids arranged in an array. The method is executed by a terminal or a server. This embodiment of the application does not limit the method. Taking server execution as an example, the method includes at least one of the following steps.

[0072] Step 410: Obtain the first coordinate to be queried.

[0073] The first coordinate is the coordinate of any point on the electronic map.

[0074] Each point on the electronic map corresponds to a unique coordinate, and the location of any point on the electronic map can be determined based on the first coordinate.

[0075] In some embodiments, the server receives the first coordinates to be queried from the terminal.

[0076] Step 420: Determine the first grid to which the first coordinate belongs among multiple grids.

[0077] In some embodiments, the shape of the grid includes at least one of square, rectangle, triangle, and hexagon. In this embodiment, the grid shape is a square, that is, the length and width of the grid are the same.

[0078] Figure 5 The illustration shows a schematic diagram of grid division provided by an exemplary embodiment of this application, wherein the electronic map is divided into a plurality of square grids of fixed size. Assuming the horizontal coordinate axis is the X-axis and the vertical coordinate axis is the Y-axis, the grid number is, for example, the first grid (m,n), which represents the m-th grid in the horizontal direction and the n-th grid in the vertical direction of the electronic map.

[0079] For example, coordinates A are (x_left_top, y_left_top); coordinates B are (x_right_top, y_right_top); coordinates C are (x_left_bottom, y_left_bottom); coordinates D are (x_right_bottom, y_right_bottom); the span of the horizontal axis of the electronic map is the width of the electronic map, mapw, which is equal to x_right_top - x_left_top; the span of the vertical axis of the electronic map is the height of the electronic map, maph, which is equal to y_left_bottom - y_left_top; the side length of a single grid is the grid width, gridw; the number of grids divided on the horizontal axis is the number of horizontal grids on the electronic map, which is equal to mapw / gridw; the number of grids divided on the vertical axis is the number of vertical grids on the electronic map, which is equal to maph / gridw.

[0080] Figure 6 This diagram illustrates a mesh division provided in an exemplary embodiment of this application, wherein the first mesh (m,n) includes: coordinates 61(m1,n1), 62(m2,n2), 63(m3,n3), 64(m4,n4), and 65(m5,n5). The first mesh (m,n) also includes coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0081] The first grid partially overlaps with point 1, and the overlapping area includes coordinates 61(m1,n1); the first grid partially overlaps with point 2, and the overlapping area includes coordinates 62(m2,n2), 63(m3,n3), and 64(m4,n4).

[0082] In some embodiments, multiple coordinates belong to the same grid. For example, coordinates 61(m1,n1) to coordinates (m9,n9) all belong to the first grid (m,n).

[0083] Step 430: Query the first point of the first grid based on the attribution correspondence.

[0084] The attribution correspondence includes the correspondence between at least one grid and points overlapping with at least one grid. Points are pre-defined polygonal areas in the electronic map. Grids are the basic units in electronic maps, and the area of ​​a point is usually larger than the area of ​​a single grid.

[0085] In some embodiments, a grid belongs to one or more points.

[0086] The first grid corresponding to the first point means that the first grid belongs to the first point, for example, in Figure 6 In the first grid, there is partial overlap between the first grid and point 1 and point 2. The first grid belongs to point 1 or point 2, or the first grid belongs to both point 1 and point 2.

[0087] In some embodiments, a point may comprise multiple grids.

[0088] When the overlap area between the grid and the point is greater than a preset threshold, the point includes the grid. For example, in Figure 2 In the example, assuming the preset threshold is 50%, the first point 210 includes 16 grids filled with diagonal lines.

[0089] In some embodiments, a point is a pre-defined polygonal area in an electronic map, including regular and irregular polygons, such as the area occupied by buildings, lakes, forests, and other special terrain features on the electronic map. For example, Figure 2 The first point 210 is a building point, used to represent buildings on the electronic map, and the second point 220 is a terrain point, used to represent lakes on the electronic map.

[0090] In some embodiments, there is overlap between the points. For example... Figure 6 As shown, there is some overlap between point 1 and point 2.

[0091] In some embodiments, the attribution correspondence between grids and points is pre-calculated based on the correspondence between the coordinates included in the grid and each point.

[0092] For example, the server pre-calculates the first point corresponding to the first grid (m,n). After determining that the first coordinate belongs to the first grid, it queries the first point to which the first grid (m,n) belongs based on the attribution correspondence.

[0093] Step 440: Use the first point as the first coordinate for the point query result.

[0094] In some embodiments, the server uses the first point as the point query result of the first coordinate and sends the point query result to the terminal.

[0095] In some embodiments, the location query result includes relevant information about a first location, which includes: location type, location center point, location area, distance between the location and its nearest multiple locations, etc.

[0096] In summary, the method provided in this embodiment, after obtaining the first coordinate to be queried, determines the first grid to which the first coordinate belongs, and then queries the first point to which the first grid belongs based on the attribution correspondence. Since the attribution correspondence is a pre-calculated correspondence between grids and points, it does not need to be calculated in real time when querying the point to which the coordinate belongs, thus not occupying query time and reducing the computational pressure of point query.

[0097] Figure 7 A flowchart of a point query method in an electronic map provided by an exemplary embodiment of this application is shown. The method is executed by a terminal or a server. This embodiment of the application does not limit the method. Taking server execution as an example, the method includes at least one of the following steps.

[0098] Step 410: Obtain the first coordinate to be queried.

[0099] Step 422: Based on the first coordinate and the side length of the grid, determine the first grid to which the first coordinate belongs among multiple grids.

[0100] In some embodiments, the first coordinate includes a first abscissa and a first ordinate. Based on the first abscissa and the side length of the grid, the grid abscissa of the first grid to which the first coordinate belongs is determined among multiple grids; based on the first ordinate and the side length of the grid, the grid ordinate of the first grid to which the first coordinate belongs is determined among multiple grids.

[0101] The grid's horizontal coordinate is the floor value of the first quotient, which is the quotient of the first horizontal coordinate and the grid's side length; the grid's vertical coordinate is the floor value of the second quotient, which is the quotient of the first vertical coordinate and the grid's side length.

[0102] like Figure 6 As shown, the first coordinate is 61(m1,n1), the grid side length is gridw, then the first quotient is m1 / gridw, the second quotient is n1 / gridw, the grid horizontal coordinate m is the floor value of the first quotient, and the grid vertical coordinate n is the floor value of the second quotient.

[0103] In some embodiments, the grid x-coordinate is the floor value of the third quotient, which is the quotient of the first difference and the grid side length. The first difference is the difference between the first x-coordinate and the second x-coordinate, and the second x-coordinate is the x-coordinate of the reference point. The grid y-coordinate is the floor value of the fourth quotient, which is the quotient of the second difference and the grid side length. The second difference is the difference between the first y-coordinate and the second y-coordinate, and the second y-coordinate is the y-coordinate of the reference point.

[0104] like Figure 6 As shown, the first coordinate is 61(m1,n1), the grid side length is gridw, and the coordinates of the reference point A are (x_left_top,y_left_top). Then the third quotient is (m1-x_left_top) / gridw, and the fourth quotient is (n1-y_left_top) / gridw. The grid horizontal coordinate m is the floor value of the third quotient, and the grid vertical coordinate n is the floor value of the fourth quotient.

[0105] Step 430: Query the first point of the first grid based on the attribution correspondence.

[0106] In some embodiments, a grid belongs to a point.

[0107] In some embodiments, a point comprises multiple grids. The attribution relationship between grids and points is shown in Table 1.

[0108] Table 1

[0109] Grid The corresponding location First grid Point 2 Second grid Point 2 Third grid Point 1 …… ……

[0110] like Figure 6 As shown, the first grid (m, n) belongs to point 2, the second grid 620 belongs to point 2, and the third grid 630 belongs to point 1. Other grids also include the points mentioned above. Figure 6 It is not shown in the middle.

[0111] In some embodiments, the location includes at least one of the following:

[0112] • Topographic points corresponding to areas with distinctive topographic features;

[0113] • This includes the traffic points corresponding to the area containing transportation facilities;

[0114] • The collection points corresponding to the areas used for resource collection;

[0115] • Battle points corresponding to the areas used for combat;

[0116] • Communication points corresponding to the area used for communicating with other objects.

[0117] For example, in Figure 2 In the map, point 210 is a building point within the terrain points, used to represent buildings on the electronic map. Point 220 is a terrain point, used to represent lakes on the electronic map. Additionally, areas including transportation facilities such as airports and railways are considered transportation points; areas used for resource gathering such as botanical gardens and equipment depots are considered resource gathering points; areas used for combat such as arenas and shooting ranges are considered combat points; and areas used for communication with other entities such as conference rooms and cafes are considered communication points.

[0118] Step 440: Use the first point as the first coordinate for the point query result.

[0119] In summary, the method provided in this embodiment determines the first grid to which the first coordinate belongs among multiple grids based on the first coordinate and the side length of the grid. This method is simple and fast, and can accurately determine the first grid to which the first coordinate belongs.

[0120] Figure 8 A flowchart of a point query method in an electronic map provided by an exemplary embodiment of this application is shown. The electronic map includes m grids and n points, where m and n are positive integers. The method is executed by a terminal or a server. This embodiment of the application does not limit the method, but takes the execution by a server as an example. The method includes at least one of the following steps.

[0121] Step 401: Calculate the overlap ratio between the j-th point among n points and the i-th grid among m grids.

[0122] Where j is less than n, i is less than m, and the overlap ratio is the proportion of the number of coordinates in the overlapping area between the point and the grid to the number of coordinates in the grid.

[0123] In some embodiments, the relationship between the j-th point among n points and the coordinates of each grid in the i-th grid among m grids is determined; the overlap ratio between the j-th point and the i-th grid is calculated.

[0124] like Figure 6 As shown, taking the i-th grid as the first grid and the j-th point as point 1 as an example, the first grid includes: coordinates 61(m1,n1), 62(m2,n2), 63(m3,n3), 64(m4,n4), and 65(m5,n5). The first grid also includes coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0125] The first grid (m,n) overlaps with point 1. The overlapping area includes one coordinate, namely coordinate 61. The overlap ratio corresponding to point 1 is 1 / 9. The other 8 coordinates do not overlap with point 1.

[0126] In some embodiments, determining the relationship between the j-th point among n points and the coordinates of each coordinate in the i-th grid among m grids includes:

[0127] A ray is emitted from any of the coordinates. If the number of intersections between the ray and the boundary of the j-th point is odd, the coordinate is inside the j-th point. If the number of intersections between the ray and the boundary of the j-th point is even, the coordinate is outside the j-th point. The relationship between the j-th point and the coordinates in the i-th grid is determined through the above steps.

[0128] Will Figure 3 The method shown is applied to Figure 6 In the diagram, for coordinate 61, a ray is emitted horizontally to the right from coordinate 61. This ray intersects the boundary of point 1 at one point, so coordinate 61 is inside point 1. For coordinate 65, a ray is emitted horizontally to the right from coordinate 65. This ray intersects the boundary of point 1 at two points, so coordinate 65 is outside point 1. Similarly, all other coordinates besides coordinate 61 are also outside point 1.

[0129] Step 402: After calculating the overlap ratio between the j-th point and the ith grid, calculate the overlap ratio between the (j+1)-th point and the ith grid out of the n points.

[0130] Among them, the (j+1)th point is the point following the j-th point in a preset order, and j+1 is less than or equal to n.

[0131] For example, point 2 is the next point after point 1 in a preset order. The first grid overlaps with point 2, and the overlapping area includes three coordinates, namely coordinates 62, 63, and 64. The overlap ratio corresponding to point 2 is 1 / 3.

[0132] Step 403: Update j to j+1, and repeat the above two steps so that after traversing the overlap ratio between the n points and the i-th grid, the attribution and correspondence between the i-th grid and the points that overlap among the n points can be determined based on the overlap ratio.

[0133] For example, after calculating the overlap ratio between the first grid and points 1 and 2, continue to calculate the overlap ratio between points 3, 4, and other subsequent points and the first grid, thus iterating through the overlap ratio between n points and the first grid.

[0134] In some embodiments, if the overlap ratio between the j-th point and the i-th grid is greater than a preset threshold, the j-th point is a candidate point belonging to the i-th grid.

[0135] For example in Figure 6In the example, assuming the preset threshold is 1 / 10, since the overlap ratio between point 1 and the first grid is 1 / 9 and the overlap ratio between point 2 and the first grid is 1 / 3, both of which are greater than the preset threshold, point 1 and point 2 are both candidate points belonging to the first grid, and the first point is determined from point 1 and point 2.

[0136] In some embodiments, the server determines whether the point traversal is complete by comparing the number of points that have been calculated with the total number of points.

[0137] The server stores information about each location, including the total number of locations and the center point of each location.

[0138] In some embodiments, after traversing the overlap ratios of n points with the i-th grid, the point with the largest overlap ratio among the n points is determined as the point belonging to the i-th grid, and the other points are determined as points not belonging to the i-th grid.

[0139] For example, after traversing the overlap ratios of n points with the first grid, the overlap ratio of point 2 is 1 / 3, which is the largest overlap ratio. Point 2 is then determined to be a point belonging to the first grid, and the other points are determined to be points not belonging to the first grid.

[0140] Step 404: Update i to i+1, repeat the above three steps, and determine the correspondence between the m grids and the overlapping points in the n points.

[0141] Based on the same principle, determine the attribution correspondence between the other grids outside the first grid and the overlapping points among the n points, thereby confirming the attribution correspondence between all grids and the overlapping points among all points.

[0142] Step 410: Obtain the first coordinate to be queried.

[0143] Step 420: Determine the first grid to which the first coordinate belongs among multiple grids.

[0144] Step 430: Query the first point of the first grid based on the attribution correspondence.

[0145] Step 440: Use the first point as the first coordinate for the point query result.

[0146] In summary, the method provided in this embodiment determines the overlap ratio between a grid and a point, then determines the overlap ratio between the next point in a preset order and the grid. By repeating the above steps, the attribution correspondence between the grid and the overlapping points among all points can be determined. Then, based on the same principle, the attribution correspondence between all grids and the overlapping points among all points can be determined, thereby pre-calculating the attribution correspondence between grids and points for use when querying the first point to which the first coordinate belongs.

[0147] Figure 9 A flowchart of a point query method in an electronic map provided by an exemplary embodiment of this application is shown. The method is executed by a terminal or a server. This embodiment of the application does not limit the method. Taking server execution as an example, the method includes at least one of the following steps.

[0148] Step 401: Calculate the overlap ratio between the j-th point among n points and the i-th grid among m grids.

[0149] The electronic map consists of m grids and n points, where m and n are positive integers, i is less than m, and j is less than n.

[0150] In some embodiments, the relationship between the j-th point among n points and the coordinates of each grid in the i-th grid among m grids is determined; the overlap ratio between the j-th point and the i-th grid is calculated.

[0151] like Figure 6 As shown, taking the i-th grid as the first grid and the j-th point as point 1 as an example, the first grid includes: coordinates 61(m1,n1), 62(m2,n2), 63(m3,n3), 64(m4,n4), and 65(m5,n5). The first grid also includes coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0152] The first grid (m,n) overlaps with point 1. The overlapping area includes one coordinate, namely coordinate 61. The overlap ratio corresponding to point 1 is 1 / 9. The other 8 coordinates do not overlap with point 1.

[0153] In some embodiments, determining the relationship between the j-th point among n points and the coordinates of each coordinate in the i-th grid among m grids includes:

[0154] A ray is emitted from any of the coordinates. If the number of intersections between the ray and the boundary of the j-th point is odd, the coordinate is inside the j-th point. If the number of intersections between the ray and the boundary of the j-th point is even, the coordinate is outside the j-th point. The relationship between the j-th point and the coordinates in the i-th grid is determined through the above steps.

[0155] Will Figure 3 The method shown is applied to Figure 6 In the diagram, for coordinate 61, a ray is emitted horizontally to the right from coordinate 61. This ray intersects the boundary of point 1 at one point, so coordinate 61 is inside point 1. For coordinate 65, a ray is emitted horizontally to the right from coordinate 65. This ray intersects the boundary of point 1 at two points, so coordinate 65 is outside point 1. Similarly, all other coordinates besides coordinate 61 are also outside point 1.

[0156] Step 4051: If the overlap ratio between the j-th point and the i-th grid is greater than the overlap threshold, determine that the j-th point belongs to the i-th grid.

[0157] The distance between the center point of a point and the center point of a grid is called the center distance. The distance between the center point of the j-th point and the center point of the i-th grid is called the first center distance. The first center distance is the minimum center distance corresponding to the i-th grid, and j+1 is less than or equal to n.

[0158] For example, Figure 6 The diagram shows the overlap between points 1 and 2 and the first grid. Assuming an overlap threshold of 1 / 10, the distance between the center point of point 1 and the center point of the first grid is the first center distance, and the distance between the center point of point 2 and the center point of the first grid is the second center distance, which is greater than the first center distance. Since the overlap ratio corresponding to point 1 is 1 / 9, which is greater than 1 / 10, point 1 is determined to belong to the first grid.

[0159] Step 4052: If the overlap ratio between the j-th point and the ith grid is less than the overlap threshold, calculate the overlap ratio between the (j+1)-th point and the ith grid out of the n points.

[0160] The distance between the center point of the (j+1)th point and the center point of the ith grid is the second center distance, which is greater than the first center distance.

[0161] like Figure 6 As shown, assuming the overlap threshold is 1 / 6, the distance between the center point of point 1 and the center point of the first grid is the first center distance, and the distance between the center point of point 2 and the center point of the first grid is the second center distance. Since the overlap ratio corresponding to point 1 is 1 / 9, which is less than 1 / 6, the overlap ratio between point 2 and the first grid is calculated.

[0162] Step 406: If the overlap ratio between the (j+1)th point and the ith grid is greater than the overlap threshold, determine that the (j+1)th point belongs to the ith grid.

[0163] like Figure 6 As shown, since the overlap ratio of point 2 is 1 / 3, which is greater than the overlap threshold of 1 / 6, point 2 is determined to be the point belonging to the first grid.

[0164] Step 410: Obtain the first coordinate to be queried.

[0165] Step 420: Determine the first grid to which the first coordinate belongs among multiple grids.

[0166] Step 430: Query the first point of the first grid based on the attribution correspondence.

[0167] Step 440: Use the first point as the first coordinate for the point query result.

[0168] In summary, the method provided in this embodiment determines the overlap ratio between a grid and a point. If the overlap ratio is greater than the overlap threshold, the point is determined to belong to the grid. If the overlap ratio is less than the overlap threshold, the overlap ratios of other points with the grid are determined in order of their center distance. Points with overlap ratios greater than the overlap threshold are determined to belong to the grid, thereby speeding up the determination of the belonging points and improving the efficiency of determining the attribution correspondence.

[0169] Figure 10 A flowchart of a point query method in an electronic map provided by an exemplary embodiment of this application is shown. The method is executed by a server or a terminal. This embodiment of the application takes server execution as an example, but is not limited thereto. The method includes at least one of the following steps.

[0170] Step 1010: Obtain the first grid.

[0171] In some embodiments, a first grid (m, n) is obtained, where m and n are integers. The electronic map is divided into multiple grids arranged in an array, and the first grid (m, n) is any one of the grids to be queried in the electronic map.

[0172] In this embodiment of the application, the correspondence between the first grid (m,n) and each point is determined. Other grids are also determined to correspond to each point using the same method, thereby obtaining the correspondence between all grids and each point.

[0173] like Figure 5 As shown, the electronic map is divided into multiple square grids of fixed size. Assuming the horizontal axis is the X-axis and the vertical axis is the Y-axis, the grid is numbered, for example, the first grid (m,n), which represents the m-th grid in the horizontal direction and the n-th grid in the vertical direction of the electronic map.

[0174] For example, coordinates A are (x_left_top, y_left_top); coordinates B are (x_right_top, y_right_top); coordinates C are (x_left_bottom, y_left_bottom); coordinates D are (x_right_bottom, y_right_bottom); the span of the horizontal axis of the electronic map is the width of the electronic map, mapw, which is equal to x_right_top - x_left_top; the span of the vertical axis of the electronic map is the height of the electronic map, maph, which is equal to y_left_bottom - y_left_top; the side length of a single grid is the grid width, gridw; the number of grids divided on the horizontal axis is the number of horizontal grids on the electronic map, which is equal to mapw / gridw; the number of grids divided on the vertical axis is the number of vertical grids on the electronic map, which is equal to maph / gridw.

[0175] Step 1020: Determine whether the traversal of points is complete.

[0176] In some embodiments, the completion of traversing the points indicates that the calculation of the overlap ratio between each point and the first grid has been completed.

[0177] The overlap ratio between a point and the first grid is the proportion of coordinates in the overlapping area of ​​the point to the total number of coordinates in the first grid. For example... Figure 6 As shown, the first grid (m,n) includes coordinates 61(m1,n1), 62(m2,n2), 63(m3,n3), 64(m4,n4), and 65(m5,n5). The first grid (m,n) also includes coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0178] The first grid (m,n) includes 9 coordinates. The first grid (m,n) overlaps with point 1, and the overlapping area includes 1 coordinate, namely coordinate 61. The overlap ratio corresponding to point 1 is 1 / 9. The first grid (m,n) also overlaps with point 2, and the overlapping area includes 3 coordinates, namely coordinates 62, 63, and 64. The overlap ratio corresponding to point 2 is 1 / 3.

[0179] In some embodiments, the server determines whether the overlap ratio between the point and the grid is greater than or equal to a first threshold, which is a preset value. For example, assuming the first threshold is 1 / 9, the overlap ratio between the first grid (m,n) and point 1 is 1 / 9, which is equal to the first threshold; the overlap ratio between the first grid (m,n) and point 2 is 1 / 3, which is greater than the first threshold.

[0180] In some embodiments, the server determines whether the point traversal is complete by comparing the number of points that have been calculated with the total number of points.

[0181] The server stores information about each location, including the total number of locations and the center point of each location.

[0182] Since the server stores the total number of points, it can determine whether the point traversal is complete. If the point traversal is complete, proceed to step 1030; if the point traversal is not complete, proceed to step 1031.

[0183] For example, if there are a total of 5 points, including points 1 to 5, and the overlap ratio between point 1 and the grid is greater than the first threshold, then the point traversal is incomplete, and step 1031 is executed. After determining the overlap ratio between point 5 and the grid, the point traversal is complete, and step 1030 is executed.

[0184] Step 1030: Select the point with the largest overlap ratio as the first point of the first grid.

[0185] In some embodiments, a grid belongs to only one point.

[0186] In some embodiments, the server stores information about each grid, including the total number of grids and the number of coordinates in each grid.

[0187] In some embodiments, the point with the largest overlap ratio is selected as the first point from the points whose overlap ratio is greater than a first threshold.

[0188] For example, in Figure 6 In the example, assuming the first threshold is 1 / 9, the overlap ratio between the first grid (m,n) and point 1 is 1 / 9, and the overlap ratio between the first grid (m,n) and point 2 is 1 / 3. Since 1 / 3 is greater than 1 / 9, the first point to which the first grid (m,n) belongs is point 2.

[0189] Step 1031: Determine the relationship between the coordinates of the first grid and the current point, and traverse the coordinates of the first grid.

[0190] In some embodiments, the server via Figure 2 The method shown determines the relationship between coordinates and the current point and iterates through all coordinates included in the grid, where the current point is a point whose correspondence with the first grid has not yet been determined.

[0191] For example, in Figure 6In the first grid (m,n), there are 9 coordinates, including coordinates 61 and 65. For coordinate 61, a ray is emitted horizontally to the right from coordinate 61. It is determined that this ray intersects the boundary of point 1 at 1, so coordinate 61 is in point 1. For coordinate 65, a ray is emitted horizontally to the right from coordinate 65. It is determined that this ray intersects the boundary of point 1 at 2 points, so coordinate 65 is outside point 1.

[0192] like Figure 6 As shown, taking the current position as position 1 as an example, the server traverses the 9 coordinates included in the first grid (m,n) and determines that coordinate 61 (m1,n1) is inside position 1, while the other 8 coordinates are outside position 1.

[0193] Step 1040: Determine if the coordinate traversal is complete.

[0194] In some embodiments, the server stores the total number of coordinates. The server determines whether the coordinate traversal is complete by comparing the number of coordinates that have determined the relationship between points with the total number of coordinates.

[0195] If the coordinate traversal is complete, proceed to step 1050; if the coordinate traversal is incomplete, proceed to step 1031.

[0196] Step 1050: Calculate the overlap ratio between the current point and the first grid, and record the relationship between the current point and the first grid.

[0197] In some embodiments, the overlap ratio between the current point and the first grid is calculated. The specific calculation method for the overlap ratio is described in step 1020, and will not be repeated here.

[0198] In some embodiments, the server records current points with an overlap ratio greater than or equal to a first threshold as related to the first grid, and current points with an overlap ratio less than the first threshold as unrelated to the first grid.

[0199] like Figure 6 As shown, assuming the first threshold is 1 / 9, the overlap ratio between the first grid (m,n) and point 1 is 1 / 9, which is equal to the first threshold; the overlap ratio between the first grid (m,n) and point 2 is 1 / 3, which is greater than the first threshold. The server records that both point 1 and point 2 are related to the first grid (m,n).

[0200] After executing step 1050, execute step 1020. The server determines whether the point traversal is complete by comparing the number of calculated points with the total number of points. The calculated points include current points with an overlap ratio greater than or equal to the first threshold and current points with an overlap ratio less than the first threshold.

[0201] Using the method described above, the first point belonging to the first grid (m, n) can be obtained. Similarly, the points belonging to each grid can be obtained. For cases where the points are irregular polygons, an approximate fit can be made using grids. For example, in... Figure 2 In the middle, the first point 210 is an irregular quadrilateral, corresponding to 16 grids filled with diagonal lines.

[0202] The above method involves the server pre-calculating the locations of the grid points, for example, calculating the locations offline. With a fixed electronic map, the locations of the points belonging to each grid are fixed data. After the server calculates the correspondence between the grid points and the points, it stores the data on the server, allowing for direct retrieval of the grid points without the need for real-time calculation.

[0203] In some embodiments, the server receives a first coordinate sent by the terminal and calculates the first grid to which the first coordinate belongs.

[0204] For example, in Figure 6 In the process, when the terminal provides the coordinates 61(m1,n1) corresponding to the current location of the account, the server calculates the first grid (m,n) to which coordinate 61 belongs, where m = (m1-x_left_top) / gridw and is rounded down, and n = (n1-y_left_top) / gridh and is rounded down.

[0205] In some embodiments, the server sends the first point to which the first grid belongs to the terminal.

[0206] The first point belonging to the first grid (m,n) is the point at coordinates 61(m1,n1). The time taken to calculate the point belonging to the grid is independent of the number of points and the number of edges of the polygon corresponding to the point; it is pre-calculated by the server. When the number of points is x and the number of edges of the polygon corresponding to the point is y, the time complexity of the calculation process is O(1), which is a fixed constant and independent of x and y.

[0207] In the above embodiments, steps with the same sequence number can be considered as the same step. Wherein, Figure 4 Corresponding embodiments, Figure 7 Corresponding embodiments, Figure 8 Corresponding embodiments, Figure 9 Corresponding embodiments and Figure 10 The corresponding embodiments can be implemented individually or in combination, and this application does not limit them.

[0208] In one application scenario, the point-to-point lookup method in electronic maps can be applied to the gaming industry. Optionally, the electronic map is a game electronic map. Figure 11A flowchart of a game point query method in a game electronic map provided by an exemplary embodiment of this application is shown. The game electronic map includes a number of game points and is divided into multiple game grids arranged in an array. The method is executed by a terminal or a server. This embodiment of the application does not limit the method. Taking server execution as an example, the method includes at least one of the following steps.

[0209] Step 1110: Obtain the coordinates of the first game to be queried.

[0210] The first game coordinate is the coordinate of the user-controlled virtual character on the game's electronic map, where the user-controlled virtual character corresponds to any point on the game's electronic map.

[0211] Each point on the game's electronic map corresponds to a unique coordinate, and the location of any point on the game's electronic map can be determined based on the first game coordinate.

[0212] In some embodiments, the server receives the first game coordinates to be queried from the terminal.

[0213] Step 1120: Determine the first game grid to which the first game coordinate belongs among multiple game grids.

[0214] In some embodiments, the shape of the game grid includes at least one of a square, rectangle, triangle, and hexagon. In this embodiment, the game grid is a square, meaning that the length and width of the game grid are the same.

[0215] Taking the first grid as the first game grid and the point as the game point as an example, such as Figure 6 As shown, the first game grid (m,n) includes: game coordinates 61(m1,n1), game coordinates 62(m2,n2), game coordinates 63(m3,n3), game coordinates 64(m4,n4), and game coordinates 65(m5,n5). The first game grid (m,n) also includes game coordinates (m6,n6) to game coordinates (m9,n9). Figure 6 It is not shown in the middle.

[0216] The first game grid partially overlaps with game point 1, and the overlapping area includes game coordinates 61(m1,n1); the first game grid partially overlaps with game point 2, and the overlapping area includes game coordinates 62(m2,n2), game coordinates 63(m3,n3), and game coordinates 64(m4,n4).

[0217] In some embodiments, multiple game coordinates belong to the same game grid. For example, game coordinates 61(m1,n1) to game coordinates (m9,n9) all belong to the first game grid (m,n).

[0218] In some embodiments, the first game grid to which the first game coordinates belong is determined among a plurality of game grids based on the first game coordinates and the side length of the game grid.

[0219] In some embodiments, the first game coordinate includes a first abscissa and a first ordinate. Based on the first abscissa and the side length of the game grid, the game grid abscissa of the first game coordinate to which the first game coordinate belongs is determined among multiple game grids; based on the first ordinate and the side length of the game grid, the game grid ordinate of the first game coordinate to which the first game coordinate belongs is determined among multiple game grids.

[0220] The horizontal coordinate of the game grid is the floor value of the first quotient, which is the quotient of the first horizontal coordinate and the side length of the game grid; the vertical coordinate of the game grid is the floor value of the second quotient, which is the quotient of the first vertical coordinate and the side length of the game grid.

[0221] Step 1130: Query the first game point to which the first game grid belongs based on the attribution correspondence.

[0222] The attribution correspondence includes the correspondence between at least one game grid and game points that overlap with at least one game grid. A game point is a pre-defined polygonal area in the game's electronic map. The game grid is the basic unit in the game's electronic map, and the area of ​​a game point is usually larger than the area of ​​a single game grid.

[0223] In some embodiments, a game grid belongs to one or more game points.

[0224] In some embodiments, a game point includes multiple game grids.

[0225] When the overlap area between the game grid and the game point is greater than a preset threshold, the game point includes the game grid. For example, in Figure 2 In this context, assuming a preset threshold of 50%, the first game point 210 comprises 16 game grids filled with diagonal lines.

[0226] In some embodiments, game points are pre-defined polygonal areas in the game electronic map, including regular polygons and irregular polygons, such as areas occupied by special terrain features like buildings, lakes, and forests in the game electronic map.

[0227] In some embodiments, there is overlap between game points.

[0228] In some embodiments, the attribution correspondence between the game grid and the game points is pre-calculated based on the coordinates included in the game grid and the correspondence between each game point.

[0229] In some embodiments, game points include at least one of the following: terrain points corresponding to areas with terrain features; resource points corresponding to areas used for acquiring virtual resources; and battle points corresponding to areas used for combat.

[0230] For example, bushes, turrets, and other similar areas are considered terrain points; areas where regular monsters and boss monsters are located are considered resource points; and areas such as rivers and jungles are considered combat points.

[0231] Step 1140: Query the game point results using the first game point as the first game coordinate.

[0232] In some embodiments, the server uses the first game point as the game point query result of the first game coordinates and sends the game point query result to the terminal.

[0233] In some embodiments, the game point query results include information about a first game point, which includes: game point type, center point of the game point, area of ​​the game point, distance between the game point and the nearest multiple game points, etc.

[0234] In some embodiments, the terminal includes an AI commentary module, which is used to broadcast commentary content. This commentary content is generated by the server based on the game location query results and then sent to the terminal. For example, after receiving the first game coordinates (m1, n1), based on the fact that the first game location to which the first game coordinates (m1, n1) belongs is grass, the commentary content "The virtual character is currently located in the grass, preparing to ambush the enemy character" is generated and sent to the terminal, and the AI ​​commentary module broadcasts this commentary content.

[0235] The attribution and correspondence between game grids and game points are determined based on a preset order:

[0236] In relation to the above steps, before step 1110, the method further includes: step 1101: calculating the overlap ratio between the j-th game point among n game points and the i-th game grid among m game grids.

[0237] Where j is less than n, i is less than m, and the overlap ratio is the proportion of game coordinates in the overlapping area between the game point and the game grid to the total number of game coordinates in the game grid.

[0238] In some embodiments, the relationship between the j-th game point among n game points and the game coordinates in the i-th game grid among m game grids is determined; the overlap ratio between the j-th game point and the i-th game grid is calculated.

[0239] like Figure 6As shown, taking the i-th game grid as the first game grid and the j-th game point as game point 1 as an example, the first game grid includes: game coordinates 61(m1,n1), game coordinates 62(m2,n2), game coordinates 63(m3,n3), game coordinates 64(m4,n4), and game coordinates 65(m5,n5). The first game grid also includes game coordinates (m6,n6) to game coordinates (m9,n9). Figure 6 It is not shown in the middle.

[0240] The first game grid (m,n) overlaps with game point 1. The overlapping area includes one game coordinate, namely game coordinate 61. The overlap ratio corresponding to game point 1 is 1 / 9. The other 8 game coordinates do not overlap with game point 1.

[0241] In some embodiments, determining the relationship between the j-th game point out of n game points and the game coordinates of the i-th game grid out of m game grids includes:

[0242] A ray is emitted from any of the game coordinates. If the number of intersections between the ray and the boundary of the j-th game point is odd, the game coordinate is inside the j-th game point. If the number of intersections between the ray and the boundary of the j-th game point is even, the game coordinate is outside the j-th game point. The relationship between the j-th game point and each game coordinate in the i-th game grid is determined through the above steps.

[0243] Will Figure 3 The method shown is applied to Figure 6 In the game, for coordinate 61, a ray is emitted horizontally to the right from coordinate 61. This ray intersects the boundary of game point 1 at one point, so coordinate 61 is inside game point 1. For coordinate 65, a ray is emitted horizontally to the right from coordinate 65. This ray intersects the boundary of game point 1 at two points, so coordinate 65 is outside game point 1. Similarly, all other game coordinates besides coordinate 61 are also outside game point 1.

[0244] Step 1102: After calculating the overlap ratio between the j-th game point and the ith game grid, calculate the overlap ratio between the (j+1)-th game point and the ith game grid out of the n game points.

[0245] Here, the (j+1)th game point is the game point following the j-th game point in a preset order, and j+1 is less than or equal to n.

[0246] For example, game point 2 is the next game point after game point 1 in a preset order. The first game grid overlaps with game point 2. The overlapping area includes three game coordinates, namely game coordinate 62, game coordinate 63, and game coordinate 64. The overlap ratio corresponding to game point 2 is 1 / 3.

[0247] Step 1103: Update j to j+1, and repeat the above two steps so that after traversing the overlap ratio between the n game points and the i-th game grid, the attribution and correspondence between the i-th game grid and the overlapping game points among the n game points can be determined based on the overlap ratio.

[0248] For example, after calculating the overlap ratio between the first game grid and game point 1 and game point 2, continue to calculate the overlap ratio between game point 3, game point 4 and other subsequent game points and the first game grid, thus traversing the overlap ratio between n game points and the first game grid.

[0249] In some embodiments, if the overlap ratio between the j-th game point and the i-th game grid is greater than a preset threshold, the j-th game point is a candidate game point belonging to the i-th game grid.

[0250] For example in Figure 6 In the example, assuming the preset threshold is 1 / 10, since the overlap ratio between game point 1 and the first game grid is 1 / 9 and the overlap ratio between game point 2 and the first game grid is 1 / 3, both of which are greater than the preset threshold, game point 1 and game point 2 are both candidate game points belonging to the first game grid. The first game point is determined from game point 1 and game point 2.

[0251] In some embodiments, the server determines whether the traversal of game points is complete by comparing the number of calculated game points with the total number of game points.

[0252] The server stores information about each game point, including the total number of game points and the center point of each game point.

[0253] In some embodiments, after traversing the overlap ratios of n game points with the i-th game grid, the game point with the largest overlap ratio among the n game points is determined as the game point belonging to the i-th game grid, and the other game points are determined as game points not belonging to the i-th game grid.

[0254] For example, after iterating through the overlap ratios of n game points with the first game grid, the overlap ratio of game point 2 is 1 / 3, which is the largest overlap ratio. Therefore, game point 2 is determined to be a game point belonging to the first game grid, and the other game points are determined to be game points not belonging to the first game grid.

[0255] Step 1104: Update i to i+1, repeat the above three steps, and determine the attribution correspondence between the m game grids and the overlapping game points among the n game points.

[0256] Based on the same principle, determine the attribution correspondence between the other game grids outside the first game grid and the overlapping game points among the n game points, thereby confirming the attribution correspondence between all game grids and the overlapping game points among all game points.

[0257] Determine the attribution correspondence between game grids and game points based on center distance:

[0258] In relation to the above steps, before step 1110, the method further includes: step 1101: calculating the overlap ratio between the j-th game point among n game points and the i-th game grid among m game grids.

[0259] Where j is less than n, i is less than m, and the overlap ratio is the proportion of game coordinates in the overlapping area between the game point and the game grid to the total number of game coordinates in the game grid.

[0260] Step 11051: If the overlap ratio between the j-th game point and the i-th game grid is greater than the overlap threshold, determine that the j-th game point is the game point belonging to the i-th game grid.

[0261] The distance between the center point of the game point and the center point of the game grid is called the center distance. The distance between the center point of the j-th game point and the center point of the ith game grid is called the first center distance. The first center distance is the minimum center distance corresponding to the ith game grid, and j+1 is less than or equal to n.

[0262] For example, Figure 6 The diagram illustrates the overlap between game points 1 and 2 and the first game grid. Assuming an overlap threshold of 1 / 10, the distance between the center point of game point 1 and the center point of the first game grid is the first center distance, and the distance between the center point of game point 2 and the center point of the first game grid is the second center distance. The second center distance is greater than the first center distance. Since the overlap ratio corresponding to game point 1 is 1 / 9, which is greater than 1 / 10, game point 1 is determined to be a game point belonging to the first game grid.

[0263] Step 11052: If the overlap ratio between the j-th game point and the ith game grid is less than the overlap threshold, calculate the overlap ratio between the (j+1)-th game point and the ith game grid among the n game points.

[0264] The distance between the center point of the (j+1)th game point and the center point of the ith game grid is the second center distance, which is greater than the first center distance.

[0265] like Figure 6 As shown, assuming the overlap threshold is 1 / 6, the distance between the center point of game point 1 and the center point of the first game grid is the first center distance, and the distance between the center point of game point 2 and the center point of the first game grid is the second center distance. Since the overlap ratio corresponding to game point 1 is 1 / 9, which is less than 1 / 6, the overlap ratio between game point 2 and the first game grid is calculated.

[0266] Step 1106: If the overlap ratio between the (j+1)th game point and the ith game grid is greater than the overlap threshold, determine that the (j+1)th game point is the game point belonging to the ith game grid.

[0267] like Figure 6 As shown, since the overlap ratio corresponding to game point 2 is 1 / 3, which is greater than the overlap threshold of 1 / 6, game point 2 is determined to be the game point belonging to the first game grid.

[0268] In summary, the method provided in this embodiment, after obtaining the first game coordinates to be queried, determines the first game grid to which the first game coordinates belong, and then queries the first game point to which the first game grid belongs based on the attribution correspondence. Since the attribution correspondence is a pre-calculated correspondence between game grids and game points, it does not need to be calculated in real time when querying the game point to which the coordinates belong, thus not occupying query time and reducing the computational pressure of game point query.

[0269] The method provided in this embodiment further determines the overlap ratio between a game grid and a game point, and then determines the overlap ratio between the next game point in a preset order and the game grid. By repeating the above steps, the attribution correspondence between the game grid and the overlapping game points among all game points can be determined. Then, based on the same principle, the attribution correspondence between all game grids and the overlapping game points among all game points is determined, thereby pre-calculating the attribution correspondence between game grids and game points for use when querying the first game point to which the first game coordinate belongs.

[0270] The method provided in this embodiment further determines the game point belonging to the game grid by determining the overlap ratio between a game grid and a game point. If the overlap ratio is greater than the overlap threshold, the game point is determined to belong to the game grid. If the overlap ratio is less than the overlap threshold, the overlap ratio between other game points and the game grid is determined in order of center distance. The game points with overlap ratios greater than the overlap threshold are determined to belong to the game grid, thereby speeding up the determination of the game point and improving the efficiency of determining the attribution correspondence.

[0271] In one application scenario, the point-of-sale method in electronic maps can be applied to the field of navigation. Optionally, the electronic map is a navigation electronic map. Figure 12 A flowchart of a navigation point query method in a navigation electronic map provided in an exemplary embodiment of this application is shown. The navigation electronic map includes a number of navigation points and is divided into multiple navigation grids arranged in an array. The method is executed by a terminal or a server. This embodiment of the application does not limit the method. Taking server execution as an example, the method includes at least one of the following steps.

[0272] Step 1210: Obtain the first navigation coordinates to be queried.

[0273] The first navigation coordinates are the coordinates of the user's current location on the navigation electronic map, and the user's current location corresponds to any point on the navigation electronic map.

[0274] Each point on the navigation electronic map corresponds to a unique coordinate, and the location of any point on the navigation electronic map can be determined based on the first navigation coordinate.

[0275] In some embodiments, the server receives the first navigation coordinates to be queried from the terminal.

[0276] Step 1220: Determine the first navigation grid to which the first navigation coordinates belong among multiple navigation grids.

[0277] In some embodiments, the shape of the navigation grid includes at least one of a square, a rectangle, a triangle, and a hexagon. In this embodiment, the navigation grid is a square, meaning that the length and width of the navigation grid are the same.

[0278] Taking the first grid as the first navigation grid and the point as the navigation point as an example, such as Figure 6 As shown, the first navigation grid (m,n) includes: navigation coordinates 61(m1,n1), 62(m2,n2), 63(m3,n3), 64(m4,n4), and 65(m5,n5). The first navigation grid (m,n) also includes navigation coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0279] The first navigation grid partially overlaps with navigation point 1, and the overlapping area includes navigation coordinates 61(m1,n1); the first navigation grid partially overlaps with navigation point 2, and the overlapping area includes navigation coordinates 62(m2,n2), navigation coordinates 63(m3,n3), and navigation coordinates 64(m4,n4).

[0280] In some embodiments, multiple navigation coordinates belong to the same navigation grid. For example, navigation coordinates 61(m1,n1) to navigation coordinates (m9,n9) all belong to the first navigation grid (m,n).

[0281] In some embodiments, the first navigation grid to which the first navigation coordinates belong is determined among a plurality of navigation grids based on the first navigation coordinates and the side length of the navigation grid.

[0282] In some embodiments, the first navigation coordinate includes a first abscissa and a first ordinate. Based on the first abscissa and the side length of the navigation grid, the navigation grid abscissa of the first navigation grid to which the first navigation coordinate belongs is determined among multiple navigation grids; based on the first ordinate and the side length of the navigation grid, the navigation grid ordinate of the first navigation grid to which the first navigation coordinate belongs is determined among multiple navigation grids.

[0283] The horizontal coordinate of the navigation grid is the floor value of the first quotient, which is the quotient of the first horizontal coordinate and the side length of the navigation grid; the vertical coordinate of the navigation grid is the floor value of the second quotient, which is the quotient of the first vertical coordinate and the side length of the navigation grid.

[0284] Step 1230: Query the first navigation point to which the first navigation grid belongs based on the attribution correspondence.

[0285] The attribution correspondence includes the correspondence between at least one navigation grid and navigation points that overlap with at least one navigation grid. Navigation points are pre-defined polygonal areas in the navigation electronic map. The navigation grid is the basic unit in the navigation electronic map, and the area of ​​a navigation point is usually larger than the area of ​​a single navigation grid.

[0286] In some embodiments, a navigation grid belongs to one or more navigation points.

[0287] In some embodiments, a navigation point includes multiple navigation grids.

[0288] When the overlap area between the navigation grid and the navigation point is greater than a preset threshold, the navigation point includes the navigation grid. For example, in Figure 2 In this context, assuming a preset threshold of 50%, the first navigation point 210 includes 16 navigation grids filled with diagonal lines.

[0289] In some embodiments, navigation points are pre-defined polygonal areas in a navigation electronic map, including regular polygons and irregular polygons, such as areas occupied by special terrain features like buildings, lakes, and forests in the navigation electronic map.

[0290] In some embodiments, there is overlap between navigation points.

[0291] In some embodiments, the attribution correspondence between the navigation grid and the navigation points is pre-calculated based on the correspondence between the coordinates included in the navigation grid and each navigation point.

[0292] In some embodiments, navigation points include at least one of the following: terrain points corresponding to areas with terrain features; traffic points corresponding to areas including transportation facilities; sports points corresponding to areas used for sports activities; communication points corresponding to areas used for communicating with other objects; and danger points corresponding to accident-prone areas.

[0293] For example, in Figure 2 In the map, point 210 is a building point within the terrain points, used to represent buildings on the navigation map. Point 220 is a terrain point, used to represent lakes on the navigation map. Additionally, areas including transportation facilities such as airports and railways are considered transportation points; areas used for sports activities such as stadiums and shooting ranges are considered sports points; areas used for communication with other entities such as conference rooms and office buildings are considered communication points; and accident-prone areas such as cliffs and slippery road sections are considered danger points.

[0294] Step 1240: Use the first navigation point as the navigation point query result of the first navigation coordinates.

[0295] In some embodiments, the server uses the first navigation point as the navigation point query result of the first navigation coordinates and sends the navigation point query result to the terminal.

[0296] In some embodiments, the navigation point query result includes relevant information about a first navigation point, which includes: navigation point type, center point of the navigation point, area of ​​the navigation point, distance between the navigation point and the nearest multiple navigation points, etc.

[0297] In some embodiments, the terminal includes an AI commentary module, which is used to broadcast navigation content. This commentary content is generated by the server based on the navigation point query results and then sent to the terminal. For example, after receiving the first navigation coordinates (m1, n1), the server generates the commentary "The user is currently in a slippery road section, please drive carefully" based on the fact that the first navigation point to which the first navigation coordinates (m1, n1) belong is a slippery road section, and sends it to the terminal, where the AI ​​commentary module broadcasts this navigation content.

[0298] The attribution correspondence between navigation grids and navigation points is determined based on a preset order:

[0299] In relation to the above steps, before step 1210, the method further includes: step 1201: calculating the overlap ratio between the j-th navigation point among n navigation points and the i-th navigation grid among m navigation grids.

[0300] Where j is less than n, i is less than m, and the overlap ratio is the proportion of the number of navigation coordinates in the overlapping area between the navigation point and the navigation grid to the total number of navigation coordinates in the navigation grid.

[0301] In some embodiments, the relationship between the j-th navigation point among n navigation points and each navigation coordinate in the i-th navigation grid among m navigation grids is determined; the overlap ratio between the j-th navigation point and the i-th navigation grid is calculated.

[0302] like Figure 6 As shown, taking the i-th navigation grid as the first navigation grid and the j-th navigation point as navigation point 1 as an example, the first navigation grid includes: navigation coordinates 61(m1,n1), navigation coordinates 62(m2,n2), navigation coordinates 63(m3,n3), navigation coordinates 64(m4,n4), and navigation coordinates 65(m5,n5). The first navigation grid also includes navigation coordinates (m6,n6) to (m9,n9). Figure 6 It is not shown in the middle.

[0303] The first navigation grid (m,n) overlaps with navigation point 1. The overlapping area includes one navigation coordinate, namely navigation coordinate 61. The overlap ratio corresponding to navigation point 1 is 1 / 9. The other 8 navigation coordinates do not overlap with navigation point 1.

[0304] In some embodiments, determining the relationship between the j-th navigation point among n navigation points and the navigation coordinates in the i-th navigation grid among m navigation grids includes:

[0305] A ray is emitted from any of the navigation coordinates. If the number of intersections between the ray and the boundary of the j-th navigation point is odd, the navigation coordinate is inside the j-th navigation point. If the number of intersections between the ray and the boundary of the j-th navigation point is even, the navigation coordinate is outside the j-th navigation point. The relationship between the j-th navigation point and each navigation coordinate in the i-th navigation grid is determined through the above steps.

[0306] Will Figure 3 The method shown is applied to Figure 6 In the context of navigation coordinate 61, a ray is emitted horizontally to the right from navigation coordinate 61. This ray intersects the boundary of navigation point 1 at one point, so navigation coordinate 61 is within navigation point 1. In the context of navigation coordinate 65, a ray is emitted horizontally to the right from navigation coordinate 65. This ray intersects the boundary of navigation point 1 at two points, so navigation coordinate 65 is outside navigation point 1. Similarly, other navigation coordinates besides navigation coordinate 61 are also outside navigation point 1.

[0307] Step 1202: After calculating the overlap ratio between the j-th navigation point and the ith navigation grid, calculate the overlap ratio between the (j+1)-th navigation point and the ith navigation grid out of the n navigation points.

[0308] Here, the (j+1)th navigation point is the navigation point following the j-th navigation point in a preset order, and j+1 is less than or equal to n.

[0309] For example, navigation point 2 is the next navigation point after navigation point 1 in a preset order. The first navigation grid overlaps with navigation point 2. The overlapping area includes three navigation coordinates, namely navigation coordinate 62, navigation coordinate 63, and navigation coordinate 64. The overlap ratio corresponding to navigation point 2 is 1 / 3.

[0310] Step 1203: Update j to j+1, and repeat the above two steps so that after traversing the overlap ratio between the n navigation points and the i-th navigation grid, the attribution correspondence between the i-th navigation grid and the navigation points that overlap among the n navigation points can be determined based on the overlap ratio.

[0311] For example, after calculating the overlap ratio between the first navigation grid and navigation points 1 and 2, the overlap ratio between navigation points 3, 4, and other subsequent navigation points and the first navigation grid is calculated, thus iterating through the overlap ratio between n navigation points and the first navigation grid.

[0312] In some embodiments, if the overlap ratio between the j-th navigation point and the i-th navigation grid is greater than a preset threshold, the j-th navigation point is a candidate navigation point belonging to the i-th navigation grid.

[0313] For example in Figure 6 In the example, assuming the preset threshold is 1 / 10, since the overlap ratio between navigation point 1 and the first navigation grid is 1 / 9 and the overlap ratio between navigation point 2 and the first navigation grid is 1 / 3, both of which are greater than the preset threshold, navigation point 1 and navigation point 2 are both candidate navigation points belonging to the first navigation grid. The first navigation point is determined from navigation point 1 and navigation point 2.

[0314] In some embodiments, the server determines whether the navigation point traversal is complete by comparing the number of completed navigation points with the total number of navigation points.

[0315] The server stores information about each navigation point, including the total number of navigation points and the center point of each navigation point.

[0316] In some embodiments, after traversing the overlap ratios of n navigation points with the i-th navigation grid, the navigation point with the largest overlap ratio among the n navigation points is determined as the navigation point to which the i-th navigation grid belongs, and the other navigation points are determined as navigation points not to which the i-th navigation grid belongs.

[0317] For example, after traversing the overlap ratios of n navigation points with the first navigation grid, the overlap ratio of navigation point 2 is 1 / 3, which is the largest overlap ratio. Therefore, navigation point 2 is determined to be a navigation point belonging to the first navigation grid, and the other navigation points are determined to be navigation points not belonging to the first navigation grid.

[0318] Step 1204: Update i to i+1, repeat the above three steps, and determine the attribution correspondence between the m navigation grids and the overlapping navigation points among the n navigation points.

[0319] Based on the same principle, the attribution correspondence between the other navigation grids outside the first navigation grid and the overlapping navigation points among the n navigation points is determined, thereby confirming the attribution correspondence between all navigation grids and the overlapping navigation points among all navigation points.

[0320] Determine the attribution correspondence between navigation grids and navigation points based on center distance:

[0321] In relation to the above steps, before step 1210, the method further includes: step 1201: calculating the overlap ratio between the j-th navigation point among n navigation points and the i-th navigation grid among m navigation grids.

[0322] Where j is less than n, i is less than m, and the overlap ratio is the proportion of the number of navigation coordinates in the overlapping area between the navigation point and the navigation grid to the total number of navigation coordinates in the navigation grid.

[0323] Step 12051: If the overlap ratio between the j-th navigation point and the i-th navigation grid is greater than the overlap threshold, determine that the j-th navigation point is the navigation point to which the i-th navigation grid belongs.

[0324] The distance between the center point of the navigation point and the center point of the navigation grid is called the center distance. The distance between the center point of the j-th navigation point and the center point of the ith navigation grid is called the first center distance. The first center distance is the minimum center distance corresponding to the ith navigation grid, and j+1 is less than or equal to n.

[0325] For example, Figure 6 The diagram illustrates the overlap between navigation points 1 and 2 and the first navigation grid. Assuming an overlap threshold of 1 / 10, the distance between the center point of navigation point 1 and the center point of the first navigation grid is the first center distance, and the distance between the center point of navigation point 2 and the center point of the first navigation grid is the second center distance. The second center distance is greater than the first center distance. Since the overlap ratio corresponding to navigation point 1 is 1 / 9, which is greater than 1 / 10, navigation point 1 is determined to be a navigation point belonging to the first navigation grid.

[0326] Step 12052: If the overlap ratio between the j-th navigation point and the ith navigation grid is less than the overlap threshold, calculate the overlap ratio between the (j+1)-th navigation point and the ith navigation grid among the n navigation points.

[0327] The distance between the center point of the (j+1)th navigation point and the center point of the ith navigation grid is the second center distance, which is greater than the first center distance.

[0328] like Figure 6 As shown, assuming an overlap threshold of 1 / 6, the distance between the center point of navigation point 1 and the center point of the first navigation grid is the first center distance, and the distance between the center point of navigation point 2 and the center point of the first navigation grid is the second center distance. Since the overlap ratio corresponding to navigation point 1 is 1 / 9, which is less than 1 / 6, the overlap ratio between navigation point 2 and the first navigation grid is calculated.

[0329] Step 1206: If the overlap ratio between the (j+1)th navigation point and the ith navigation grid is greater than the overlap threshold, determine that the (j+1)th navigation point is the navigation point to which the ith navigation grid belongs.

[0330] like Figure 6 As shown, since the overlap ratio corresponding to navigation point 2 is 1 / 3, which is greater than the overlap threshold of 1 / 6, navigation point 2 is determined to be the navigation point to which the first navigation grid belongs.

[0331] In summary, the method provided in this embodiment, after obtaining the first navigation coordinates to be queried, determines the first navigation grid to which the first navigation coordinates belong, and then queries the first navigation point to which the first navigation grid belongs based on the attribution correspondence. Since the attribution correspondence is a pre-calculated correspondence between navigation grids and navigation points, it does not need to be calculated in real time when querying the navigation point to which the coordinates belong, thus not occupying query time and reducing the computational pressure of navigation point query.

[0332] The method provided in this embodiment further determines the overlap ratio between a navigation grid and a navigation point, and then determines the overlap ratio between the next navigation point in a preset order and the navigation grid. By repeating the above steps, the attribution correspondence between the navigation grid and the navigation points that overlap among all navigation points can be determined. Then, based on the same principle, the attribution correspondence between all navigation grids and the navigation points that overlap among all navigation points can be determined. Thus, the attribution correspondence between navigation grids and navigation points is pre-calculated and used for subsequent querying of the first navigation point to which the first navigation coordinates belong.

[0333] The method provided in this embodiment further determines the navigation point to which the navigation grid belongs by determining the overlap ratio between a navigation grid and a navigation point. If the overlap ratio is greater than the overlap threshold, the navigation point is determined to belong to the navigation grid. If the overlap ratio is less than the overlap threshold, the overlap ratio between other navigation points and the navigation grid is determined in order of center distance. The navigation points corresponding to the overlap ratios greater than the overlap threshold are determined to belong to the navigation grid, thereby speeding up the determination of the navigation points and improving the efficiency of determining the attribution correspondence.

[0334] Figure 13 The diagram illustrates a block diagram of a point-to-point query device in an electronic map provided in an exemplary embodiment of this application. This device can be implemented as a computer device, or as part of a computer device, through software or hardware, or a combination of both. The device includes:

[0335] The acquisition module 1310 is used to acquire the first coordinate to be queried, which is the coordinate corresponding to any point in the electronic map;

[0336] The determination module 1320 is used to determine the first grid to which the first coordinate belongs among multiple grids;

[0337] The query module 1330 is used to query the first point to which the first grid belongs based on the attribution correspondence. The attribution correspondence includes the correspondence between at least one grid and the point that overlaps with at least one grid. The point is a pre-set polygonal area in the electronic map.

[0338] Output module 1340 is used to retrieve the point query results with the first point as the first coordinate.

[0339] In one possible design of this embodiment, the determining module 1320 is used to determine the first grid to which the first coordinate belongs among multiple grids based on the first coordinate and the side length of the grid.

[0340] In one possible design of this embodiment, the first coordinate includes a first abscissa and a first ordinate; the determining module 1320 is used to determine the grid abscissa of the first grid to which the first coordinate belongs in a plurality of grids based on the first abscissa and the side length of the grid;

[0341] Based on the first ordinate and the side length of the grid, determine the grid ordinate of the first grid to which the first ordinate belongs among multiple grids;

[0342] The grid's horizontal coordinate is the floor value of the first quotient, which is the quotient of the first horizontal coordinate and the grid's side length; the grid's vertical coordinate is the floor value of the second quotient, which is the quotient of the first vertical coordinate and the grid's side length.

[0343] In one possible design of this embodiment, the electronic map includes m grids and n points, where m and n are positive integers. The calculation module 1301 is used to calculate the overlap ratio between the j-th point among the n points and the i-th grid among the m grids, where j is less than n and i is less than m. The overlap ratio is the proportion of the number of coordinates in the overlapping area between the point and the grid to the number of coordinates in the grid.

[0344] After calculating the overlap ratio between the j-th point and the ith grid, calculate the overlap ratio between the (j+1)-th point and the ith grid out of the n points. The (j+1)-th point is the point following the j-th point in a preset order, and j+1 is less than or equal to n.

[0345] The module 1320 is used to update j to j+1 and repeat the above two steps so that after traversing the overlap ratio between n points and the i-th grid, the attribution and correspondence between the i-th grid and the points that overlap among the n points can be determined based on the overlap ratio.

[0346] The module 1320 is used to update i to i+1. The above three steps are repeated to determine the correspondence between the m grids and the overlapping points in the n points.

[0347] In one possible design of this embodiment, the determining module 1320 is used to determine the point with the largest overlap ratio among the n points as the point belonging to the i-th grid after traversing the overlap ratio between the n points and the i-th grid, and to determine the other points as points that do not belong to the i-th grid.

[0348] In one possible design of this embodiment, the calculation module 1301 is used to determine the relationship between the j-th point among n points and the coordinates of each coordinate in the i-th grid among m grids; and to calculate the overlap ratio between the j-th point and the i-th grid.

[0349] In one possible design of this embodiment, the determining module 1320 is used to emit a ray from any one of the coordinates; if the number of intersections between the ray and the boundary of the j-th point is odd, the coordinate is inside the j-th point; if the number of intersections between the ray and the boundary of the j-th point is even, the coordinate is outside the j-th point; the relationship between the j-th point and each coordinate in the i-th grid is determined through the above steps.

[0350] In one possible design of this embodiment, the calculation module 1301 is used to calculate the overlap ratio between the j-th point among n points and the i-th grid among m grids, where i is less than m and j is less than n; if the overlap ratio between the j-th point and the i-th grid is greater than the overlap threshold, the j-th point is determined to be the point to which the i-th grid belongs.

[0351] In one possible design of this embodiment, the distance between the center point of a point and the center point of a grid is called the center distance, and the distance between the center point of the j-th point and the center point of the i-th grid is called the first center distance. The first center distance is the minimum center distance corresponding to the i-th grid. The calculation module 1301 is used to calculate the overlap ratio between the (j+1)-th point and the i-th grid among n points when the overlap ratio between the j-th point and the i-th grid is less than the overlap threshold, where j+1 is less than or equal to n; and to determine that the (j+1)-th point belongs to the i-th grid when the overlap ratio between the (j+1)-th point and the i-th grid is greater than the overlap threshold. The distance between the center point of the (j+1)-th point and the center point of the i-th grid is called the second center distance, which is greater than the first center distance.

[0352] In one possible design of this embodiment, the location includes at least one of the following:

[0353] Terrain points corresponding to areas with terrain features; traffic points corresponding to areas including transportation facilities; resource gathering points corresponding to areas used for resource gathering; combat points corresponding to areas used for combat; and communication points corresponding to areas used for communication with other objects.

[0354] For a functional description of module 1310, please refer to [link / reference]. Figure 4 The content of step 410 in the embodiment.

[0355] For a functional description of module 1320, please refer to [link / reference]. Figure 4 Steps 420 and 420 in the embodiment Figure 7The content of step 422 in the embodiment, Figure 8 The contents of steps 403 and 404 in the embodiment, and Figure 9 The contents of steps 4051 and 406 in the embodiment.

[0356] For a functional description of the query module 1330, please refer to [link / reference]. Figure 4 The content of step 430 in the embodiment.

[0357] For a functional description of the output module 1340, please refer to [link / reference]. Figure 4 The content of step 440 in the embodiment.

[0358] For a functional description of the computing module 1301, please refer to [link / reference]. Figure 8 The contents of steps 401 and 402 in the embodiment, and Figure 9 The contents of steps 401 and 4052 in the embodiment.

[0359] This application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one program; the processor is used to execute the at least one program in the memory to implement the point query method in the electronic map provided in the above method embodiments.

[0360] Figure 14 This illustration shows a structural block diagram of a computer device 1400 provided in an exemplary embodiment of this application. Typically, the computer device 1400 includes a processor 1401 and a memory 1402.

[0361] Processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1401 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1401 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1401 may include a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1401 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0362] The memory 1402 may include one or more computer-readable storage media, which may be non-transitory. The memory 1402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 are used to store at least one instruction, which is executed by the processor 1401 to implement the point query method in the electronic map provided in the method embodiments of this application.

[0363] In some embodiments, the computer device 1400 may optionally include an input interface 1403 and an output interface 1404. The processor 1401, memory 1402, and input interfaces 1403 and 1404 can be connected via a bus or signal lines. Various peripheral devices can be connected to the input interfaces 1403 and 1404 via a bus, signal lines, or a circuit board. The input interfaces 1403 and 1404 can be used to connect at least one input / output related peripheral device to the processor 1401 and memory 1402. In some embodiments, the processor 1401, memory 1402, and input interfaces 1403 and 1404 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, memory 1402, and input interfaces 1403 and 1404 can be implemented on separate chips or circuit boards, and this application does not limit this.

[0364] Those skilled in the art will understand that the structure shown above does not constitute a limitation on the computer device 1400, and may include more or fewer components than shown, or combine certain components, or employ different component arrangements.

[0365] In an exemplary embodiment, a chip is also provided, the chip including programmable logic circuits and / or program instructions, which, when the chip is run on a computer device 1400, is used to implement the point query method in the electronic map provided in the method embodiment of this application.

[0366] In an exemplary embodiment, a computer program product is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor retrieves the computer instructions from the computer-readable storage medium and executes the computer instructions to implement the point query method in the electronic map provided in the method embodiment of this application.

[0367] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one program that is loaded and executed by a processor to implement the point query method in an electronic map provided in the method embodiments of this application.

[0368] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0369] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.

[0370] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for querying points in an electronic map, characterized in that, The electronic map includes several points, and the electronic map is divided into multiple grids arranged in an array. The method includes: Obtain the first coordinate to be queried, where the first coordinate is the coordinate corresponding to any point in the electronic map; Determine the first grid to which the first coordinate belongs among the plurality of grids; Based on the attribution correspondence, the first point to which the first grid belongs is queried. The attribution correspondence includes the correspondence between at least one grid and a point that overlaps with the at least one grid. The point is a pre-set polygonal area in the electronic map. The first point is used as the point query result of the first coordinate.

2. The method according to claim 1, characterized in that, Determining the first grid to which the first coordinate belongs among the plurality of grids includes: Based on the first coordinate and the side length of the grid, determine the first grid to which the first coordinate belongs among the plurality of grids.

3. The method according to claim 2, characterized in that, The first coordinate includes a first abscissa and a first ordinate; determining the first grid to which the first coordinate belongs among the plurality of grids based on the first coordinate and the side length of the grid includes: Based on the first horizontal coordinate and the side length of the grid, determine the grid horizontal coordinate of the first grid to which the first coordinate belongs among the plurality of grids; Based on the first ordinate and the side length of the grid, determine the grid ordinate of the first grid to which the first coordinate belongs among the plurality of grids; Wherein, the horizontal coordinate of the grid is the floor value of the first quotient, which is the quotient of the first horizontal coordinate and the side length of the grid; the vertical coordinate of the grid is the floor value of the second quotient, which is the quotient of the first vertical coordinate and the side length of the grid.

4. The method according to any one of claims 1 to 3, characterized in that, The electronic map comprises m grids and n points, where m and n are positive integers. The method further includes: Calculate the overlap ratio between the j-th point among the n points and the i-th grid among the m grids, where j is less than n and i is less than m. The overlap ratio is the proportion of the number of coordinates in the overlapping area between the point and the grid to the number of coordinates in the grid. After calculating the overlap ratio between the j-th point and the i-th grid, calculate the overlap ratio between the (j+1)-th point and the i-th grid among the n points. The (j+1)-th point is the point following the j-th point in a preset order, and j+1 is less than or equal to n. Update j to j+1 and repeat the above two steps so that after traversing the overlap ratio between the n points and the i-th grid, the attribution correspondence between the i-th grid and the points that overlap among the n points can be determined based on the overlap ratio. Update i to i+1, repeat the above three steps, and determine the attribution correspondence between the m grids and the overlapping points among the n points.

5. The method according to claim 4, characterized in that, After traversing the overlap ratio between the n points and the i-th grid, the process of determining the attribution correspondence between the i-th grid and the points among the n points that meet the overlap condition includes: After traversing the overlap ratio between the n points and the i-th grid, the point with the largest overlap ratio among the n points is determined to be the point belonging to the i-th grid, and the other points are determined to be points that do not belong to the i-th grid.

6. The method according to claim 4, characterized in that, The calculation of the overlap ratio between the j-th point among the n points and the i-th grid among the m grids includes: Determine the relationship between the j-th point among the n points and the coordinates of each point in the i-th grid among the m grids; Calculate the overlap ratio between the j-th point and the i-th grid.

7. The method according to claim 6, characterized in that, Determining the relationship between the j-th point among the n points and the coordinates of each coordinate in the i-th grid among the m grids includes: A ray is emitted from any one of the coordinates mentioned; If the number of intersections between the ray and the boundary of the j-th point is odd, the coordinates are within the j-th point. If the number of intersections between the ray and the boundary of the j-th point is even, the coordinates are outside the j-th point. The relationship between the j-th point and each coordinate in the i-th grid is determined through the above steps.

8. The method according to claim 1, characterized in that, The electronic map comprises m grids and n points, where m and n are positive integers. The method further includes: Calculate the overlap ratio between the j-th point among the n points and the i-th grid among the m grids, where i is less than m and j is less than n; If the overlap ratio between the j-th point and the i-th grid is greater than the overlap threshold, the j-th point is determined to be the point belonging to the i-th grid.

9. The method according to claim 8, characterized in that, The distance between the center point of the location and the center point of the grid is the center distance, and the distance between the center point of the j-th location and the center point of the i-th grid is the first center distance, which is the minimum center distance corresponding to the i-th grid. The method further includes: If the overlap ratio between the j-th point and the ith grid is less than the overlap threshold, calculate the overlap ratio between the (j+1)-th point and the ith grid among the n points, where j+1 is less than or equal to n; If the overlap ratio between the (j+1)th point and the ith grid is greater than the overlap threshold, then the (j+1)th point is determined to be the point belonging to the ith grid. The distance between the center point of the (j+1)th point and the center point of the ith grid is the second center distance, which is greater than the first center distance.

10. The method according to any one of claims 1 to 9, characterized in that, The location includes at least one of the following: Topographic points corresponding to areas with distinctive topographic features; Traffic points corresponding to areas including transportation facilities; The collection points corresponding to the area used for resource collection; The combat points corresponding to the areas used for combat; The communication points corresponding to the area used for communicating with other objects.

11. A point query device in an electronic map, characterized in that, The electronic map includes several points and is divided into multiple grids arranged in an array. The device includes: The acquisition module is used to acquire the first coordinate to be queried, where the first coordinate is the coordinate corresponding to any point in the electronic map; The determining module is used to determine the first grid to which the first coordinate belongs among the plurality of grids; The query module is used to query the first point to which the first grid belongs based on the attribution correspondence relationship. The attribution correspondence relationship includes the correspondence relationship between at least one grid and the point that overlaps with the at least one grid. The point is a pre-set polygonal area in the electronic map. The output module is used to retrieve the query result of the first point as the first coordinate.

12. A computer device, characterized in that, The computer device includes a processor and a memory, wherein the memory stores at least one program; the processor is configured to execute the at least one program in the memory to implement the point query method in an electronic map as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the point query method in an electronic map as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor retrieves the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the point query method in an electronic map as described in any one of claims 1 to 10.