Multi-person online map access method and device, computer storage medium and equipment
By adopting a two-tier storage architecture and coding compression technology in multiplayer online games, the problems of high latency and high storage costs in large-scale multiplayer online games are solved, and map data is quickly stored and real-time read is reduced, reducing storage costs.
Patent Information
- Application Number
- CN202510749452.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In large-scale multiplayer online games, the existing technology has the problem of large response delays or high storage costs, especially when the number of concurrent users exceeds 500, the QPS of relational databases such as MySQL decreases and the average response delay increases.
Using a two-layer storage architecture, map data is divided into hot data and cold data, stored in the first storage area and the second storage area respectively, and data sharding and compression is used to achieve rapid storage and real-time reading.
In large-scale multiplayer online games, the rapid storage and real-time reading of map data are achieved, reducing storage costs, and ensuring data reliability and low latency.
Smart Images

Figure CN120242490A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed data access, and more particularly, to a method, apparatus, computer storage medium, and device for map access in a multi-person online environment. Background Art
[0002] Currently, in application scenarios such as sandbox games and virtual construction platforms that require dynamic updates in a three-dimensional space, when the number of concurrent users exceeds 500, the QPS (Queries Per Second) of relational databases such as MySQL will drop below 1000, and the average response latency will also be greater than 300 ms. Assuming that each voxel size is 32 bit, when the size of the voxel map updated each time is 500×500×500, the original storage space requires approximately 476 MB, and the data transmission bandwidth required for the uncompressed voxel map is 1.2 Gbps. It can be seen that in the related art, when a large number of people access data simultaneously online, there are problems of large request response latency or high storage costs.
[0003] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present application, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, apparatus, computer storage medium, and device for map access in a multi-person online environment, which are used to solve the problems of large response latency or high storage costs when a large number of people access maps online.
[0005] According to one aspect of the embodiments of the present application, a method for map access in a multi-person online environment is provided. The method includes: In response to a write request from a client, storing the map data to be stored in a first storage area and a second storage area respectively; the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data; In response to a read request from a client, obtaining the position coordinates in the read request; Encoding based on the position coordinates to obtain a routing key corresponding to the position coordinates; Reading the target map data corresponding to the routing key from the first storage area or the second storage area.
[0006] In an embodiment provided by the present application, reading the target map data corresponding to the routing key from the first storage area or the second storage area includes: determining whether the target map data corresponding to the routing key exists in the first storage area; if the target map data exists in the first storage area, reading the target map data from the first storage area; if the target map data does not exist in the first storage area, reading the target map data from the second storage area.
[0007] In an embodiment provided by the present application, reading the target map data from the second storage area includes: downloading the first encoded compression package corresponding to the routing key from the second storage area; the first encoded compression package is obtained by compressing the second encoded data stream using the first encoding algorithm; decompressing the first encoded compression package to obtain the second encoded data stream; restoring the second encoded data stream to obtain the target map data; writing the target map data into the first storage area and returning the target map data to the client.
[0008] In an embodiment provided by the present application, encoding based on the position coordinates to obtain the routing key corresponding to the position coordinates includes: encoding the position coordinates using a specified encoding algorithm to obtain a spatial fingerprint with a first preset number of digits; intercepting a second preset number of digits from the spatial fingerprint as the routing key corresponding to the position coordinates.
[0009] In an embodiment provided by the present application, storing the map data to be stored in the first storage area and the second storage area respectively includes: obtaining the sharding key corresponding to the map data to be stored based on the position coordinates in the map data to be stored; storing the map data to be stored in the first storage area based on the sharding key and the consistent hashing algorithm; compressing the map data to be stored and storing it in the second storage area.
[0010] In an embodiment provided by the present application, compressing the map data to be stored and storing it in the second storage area includes: compressing the map data to be stored using the second encoding algorithm to obtain a second encoded data stream; compressing the second encoded data stream using the first encoding algorithm to obtain a first encoded compression package; storing the first encoded compression package in the second storage area.
[0011] In an embodiment provided by the present application, before storing the map data in the first storage area and the second storage area respectively in response to the write request of the client, the method further includes: obtaining the operation request sent by the client; determining the operation type of the operation request; the operation type includes a write request and a read request.
[0012] According to one aspect of the embodiments of the present application, there is provided a map access device for multi-person online, and the device includes: A data writing module, configured to store map data in a first storage area and a second storage area respectively in response to a writing request from a client; the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data; A location acquisition module, configured to acquire the location coordinates in a reading request in response to a reading request from a client; A coordinate encoding module, configured to perform encoding based on the location coordinates to obtain a routing key corresponding to the location coordinates; A data reading module, configured to read target map data corresponding to the routing key from the first storage area or the second storage area.
[0013] According to one aspect of the embodiments of the present application, there is provided a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the multi-person online map access method provided by any embodiment of the present application.
[0014] According to one aspect of the embodiments of the present application, there is provided an electronic device, including: a processor; a memory, configured to store executable instructions of the processor; when the processor executes the executable instructions, the electronic device implements the multi-person online map access method provided by any embodiment of the present application.
[0015] In the technical solution of the present application, by storing the map data to be stored in the first storage area and the second storage area respectively in response to a writing request from a client, double-layer storage of the map data to be stored can be realized, which can ensure the rapid storage of the map data to be stored and can also ensure that the map data will not be lost through the second storage area; in response to a reading request from a client, acquire the location coordinates in the reading request; perform encoding based on the location coordinates to obtain a routing key corresponding to the location coordinates; read the target map data corresponding to the routing key from the first storage area or the second storage area; thus, real-time access to map data can be ensured even in large-scale multi-person online connections, and the required storage cost is lower.
[0016] It should be understood in the present application that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0018] Figure 1Schematically shows a flowchart of a method for map access in a multi-person online scenario provided by an embodiment of the present application.
[0019] Figure 2 Schematically shows a flowchart of a method for map access in a multi-person online scenario provided by an embodiment of the present application.
[0020] Figure 3 Schematically shows a block diagram of a device for map access in a multi-person online scenario provided by an embodiment of the present application.
[0021] Figure 4 Schematically shows a block diagram of an electronic device provided by an embodiment of the present application.
[0022] Figure 5 Schematically shows a block diagram of a computer system structure for implementing the embodiments of the present application. Detailed implementation manners
[0023] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0024] In addition, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of this application. However, those skilled in the art will realize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of this application.
[0025] The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0026] The flowcharts shown in the drawings are only illustrative and do not necessarily include all the content and operations / steps, nor do they necessarily have to be executed in the described order. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to the actual situation.
[0027] In 3D voxel games, single-machine storage and master-slave architecture (client-server) storage of voxel data are two common data management methods. Single-machine voxel data storage is only applicable to single-player games or local multiplayer games. In this method, the data is completely stored locally, so there is no need for network transmission. Therefore, the read and write speeds are fast, the latency is extremely low, and this method is simple to implement without considering network synchronization issues. Obviously, this method cannot implement multiplayer online games. Although the master-slave architecture can be applied to the scenario of multiplayer online voxel games, the server is the authoritative data source, and the client only caches partial data, which has a single point of failure risk and is more suitable for small and medium-scale data storage. The large-scale multiplayer online games mentioned in this application generally refer to games where thousands to millions of users are online at the same time. It requires the server to support frequent updates of data such as character status, map information, and item transactions, and key data needs to be responded to in milliseconds to avoid lag. Therefore, this application provides a method for map access in a multiplayer online environment, which includes Figure 1 S110 to S140 shown below, and the specific process is as follows.
[0028] S110. In response to a write request from the client, store the map data to be stored in the first storage area and the second storage area respectively.
[0029] Specifically, the client refers to the interface in the game server that generates write requests and read requests, rather than the game program running on the player's local device. At the same time, the client can also be responsible for communicating and interacting with the user terminal, generating write requests or read requests by receiving real-time data sent by the user terminal. It should be understood that the map data can include the position states of each coordinate in each map (such as whether a certain coordinate is a building, sky, land, or tree, etc.), as well as the usage rules of various props and vehicles. In one embodiment, the generation process of the write request includes: the user makes a change to a certain position in the map, for example, the position of the coordinate (x, y, z) was originally land, and the user plants a tree at this position, that is, the state of this coordinate position changes from land to tree. Then, the real-time data sent by the user terminal to the client includes the coordinate and its state of this position, and then the client generates a corresponding write request to update the map data in the server. Also, the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data. According to the access frequency and importance of the data, the data can be divided into different categories to better manage and store the data. Developers can preset a certain type of data as hot data, and if the access frequency of the map data is higher than n times / second, then this map data is hot data. That is to say, hot data is usually data with a high access frequency and more critical to the current business and application, while cold data is usually data with a low access frequency and less important to the current business and application. It should be understood that the first storage area refers to a storage area adopting a distributed storage architecture, such as the real-time access and storage of map data can be achieved through a Redis cluster, a distributed NoSQL database, AWS ElastiCache, or the Huawei Cloud DCS service, etc. The second storage area refers to the area for persistent storage of data, such as data can be stored using an Object Storage Service (OSS), an HDFS distributed file system, or a relational database. This application stores the map data to be stored in both the first storage area and the second storage area, which can achieve double-layer storage of the map data to be stored, ensure the fast storage of the map data to be stored, and at the same time ensure that the map data will not be lost through the second storage area.
[0030] In one embodiment provided by this application, when the access frequency of the map data in the first storage area is less than or equal to the preset frequency, the map data is deleted; in this way, the cold data in the first storage area can be cleared, and at the same time, this map data has been stored in the second storage area previously and the map data will not be lost.
[0031] In one embodiment provided by this application, as Figure 2 shown, storing the map data to be stored in the first storage area and the second storage area respectively includes the following S210 to S230.
[0032] S210. Obtain a shard key corresponding to the map data to be stored based on the position coordinates in the map data to be stored.
[0033] Specifically, the shard key (Partition Key) is used to define the sharding logical boundary of the data and is the basis for data grouping in the consistent hashing algorithm. In this embodiment, the position coordinates in the map data to be stored can be encoded using a specified encoding algorithm to obtain a spatial fingerprint with a first preset number of bits; then, a second preset number of bits is intercepted from the spatial fingerprint as the shard key, where the first preset number of bits is greater than or equal to the second preset number of bits. A spatial fingerprint corresponds to a specific regional range (rather than an exact point) in three-dimensional space, and all coordinates within the region will be encoded as the same fingerprint, thereby realizing the discrete grouping of spatial data. For example, the x, y, and z in the position coordinates (x, y, z) are respectively encoded in a binary bit interleaving manner, and then a 64-bit spatial fingerprint is generated using a geospatial quadtree encoding, and then the first 16 bits are intercepted as the shard key.
[0034] S220. Store the map data to be stored in the first storage area based on the shard key and the consistent hashing algorithm.
[0035] Specifically, the consistent hashing algorithm is an algorithm used for data partitioning in a distributed system. When adding or removing nodes, it can minimize the number of data remappings, thereby improving the scalability and fault tolerance of the system. The first storage area is divided into multiple virtual nodes, and the hash values corresponding to these virtual nodes are calculated; the hash value of the shard key is calculated, and the target node with the corresponding hash value is found among the virtual nodes in the hash ring; then, the map data to be stored is stored in the target node.
[0036] S230. Compress the map data to be stored and store it in the second storage area.
[0037] In an embodiment provided by the present application, storing the map data to be stored in the second storage area after compression includes: compressing the map data to be stored using a second encoding algorithm to obtain a second encoded data stream; compressing the second encoded data stream using a first encoding algorithm to obtain a first encoded compressed package; and storing the first encoded compressed package in the second storage area.
[0038] Exemplarily, the second encoding algorithm is used to compress continuous repeating voxel sequences in the map data to be stored, significantly reducing the data volume of the second encoded data stream and decreasing the data transmission volume between the client and the server. For example, the second encoding algorithm is RLE (Run-Length Encoding). AAAABBB can be replaced by A4B3 through RLE encoding, and the compression ratio of RLE encoding is approximately 1:50. The first encoding algorithm is used to eliminate complex redundancies in the data. In this embodiment, the first encoding algorithm can be used to further compress the second encoded data stream, thereby reducing network bandwidth consumption. For example, the first encoding algorithm is Zlib. Zlib uses the DEFLATE algorithm (combining LZ77 dictionary encoding + Huffman encoding), which is a lossless compression technology. The compressed data can be completely restored to the original data without information loss. Further, Zlib can use a dictionary optimization algorithm defined by the developer, resulting in a final data compression ratio of 1:200. Finally, the first encoded compressed package is stored in the second storage area for data persistence of the first encoded compressed package. For example, the following statement can be used to perform RLE preprocessing on the map data to be stored: Plain Text struct VoxelRun { uint32_t material_id : 12; / / Support 4096 materials uint32_t length : 20; / / Support up to 1M length continuous voxels }; Furthermore, the second encoded data stream can be further compressed through the following statement: Plain Text % Generate a 128-byte dictionary based on common voxel combinations common_patterns = [air, stone, water, sandstone]; dict = generate_optimized_dict(common_patterns); compress_with_dict(data, dict); Exemplarily, the S210 to S230 of this embodiment can be implemented through the following program statements: Plain Text def write_voxel(x,y,z,value): key = geohash.encode(x,y,z)[:16] # Generate a 16-bit shard key redis.set(key, rle_compress(update_voxel(x, y, z, value))) # Synchronously write to L1 oss_queue.put((key, value)) # Asynchronously write to disk at L2 In an embodiment provided by the present application, before storing map data in a first storage area and a second storage area respectively in response to a write request from a client, the method provided by the present application further includes: obtaining an operation request sent by the client; determining the operation type of the operation request; the operation type includes a write request and a read request.
[0039] S120. In response to a read request from a client, obtain the position coordinates in the read request.
[0040] As described above, when a player moves randomly or adjusts the perspective in the game map, the game map needs to be updated in real time to provide an immersive experience for the user. Therefore, the user terminal will continuously send the current position of the player to the server, causing the client in the server to generate a read request corresponding to the player, and the read request includes the coordinates (x, y, z) of the player's current position.
[0041] S130. Encode based on the position coordinates to obtain a routing key corresponding to the position coordinates.
[0042] Specifically, a routing key refers to a key identifier used to determine which node data or a request should be assigned to. As described above, when storing the map data to be stored, a sharding key is obtained by encoding the position coordinates using a specified encoding algorithm. When the encoding algorithms used in the encoding processes of the sharding key and the routing key are the same, then the sharding key and the routing key are also the same, and the difference in their names is used to distinguish between the data storage stage and the data reading stage. That is to say, a routing key corresponding to the position coordinates can be obtained by encoding the position coordinates using a specified encoding algorithm.
[0043] In an embodiment provided by the present application, encoding based on the position coordinates to obtain a routing key corresponding to the position coordinates includes: encoding the position coordinates using a specified encoding algorithm to obtain a spatial fingerprint with a first preset number of digits; intercepting a second preset number of digits from the spatial fingerprint as the routing key corresponding to the position coordinates.
[0044] Specifically, the first preset number of digits is greater than or equal to the second preset number of digits. A spatial fingerprint corresponds to a specific area range (rather than an exact point) in three-dimensional space. All coordinates within the area will be encoded as the same fingerprint, thereby realizing the discretization grouping of spatial data. For example, x, y, and z in the position coordinates (x, y, z) are respectively encoded with binary bit interleaving, and then a 64-bit spatial fingerprint is generated using a geospatial quadtree encoding, and then the first 16 bits are intercepted as the routing key.
[0045] S140. Read the target map data corresponding to the routing key from the first storage area or the second storage area.
[0046] Specifically, as described above, the map data to be stored will be stored in both the first storage area and the second storage area at the same time. Even if the map data stored in the first storage area is deleted due to low access frequency, the target map data corresponding to the routing key can still be read from the second storage area.
[0047] In the technical solution of the present application, by responding to the write request of the client and storing the map data to be stored in the first storage area and the second storage area respectively, double-layer storage of the map data to be stored can be realized, which can ensure the fast storage of the map data to be stored and can also ensure that the map data will not be lost through the second storage area; in response to the read request of the client, obtain the position coordinates in the read request; encode based on the position coordinates to obtain the routing key corresponding to the position coordinates; read the target map data corresponding to the routing key from the first storage area or the second storage area; thus, real-time access to the map data can be ensured even in large-scale multi-player online games, and the required storage cost is lower.
[0048] In an embodiment provided by the present application, reading the target map data corresponding to the routing key from the first storage area or the second storage area includes: determining whether there is target map data corresponding to the routing key in the first storage area; if there is target map data in the first storage area, read the target map data from the first storage area; if there is no target map data in the first storage area, read the target map data from the second storage area.
[0049] Specifically, as described above, the map data to be stored will be stored in both the first storage area and the second storage area at the same time, and the access speed of the first storage area is faster than that of the second storage area. Although when the access frequency of the map data in the first storage area is less than or equal to the preset frequency, the map data is deleted, but first detecting whether there is target map data corresponding to the routing key in the first storage area can read the target map data faster. If there is no target map data in the first storage area, that is, the target map data in the first storage area has been deleted, then read the target map data from the second storage area.
[0050] In an embodiment provided by the present application, reading target map data from the second storage area includes: downloading a first encoded compressed package corresponding to a routing key from the second storage area; the first encoded compressed package is obtained by compressing a second encoded data stream using a first encoding algorithm; decompressing the first encoded compressed package to obtain the second encoded data stream; restoring the second encoded data stream to obtain the target map data; writing the target map data into the first storage area and returning the target map data to the client.
[0051] Specifically, when storing the map data to be stored in the second storage area, it undergoes multiple compressions. If the target map data is to be obtained, corresponding decompressions also need to be performed. First, download the first encoded compressed package corresponding to the routing key from the second storage area, and decompress the first encoded compressed package to obtain the second encoded data stream; then perform secondary parsing on the second encoded data stream to restore the target map data. Return the target map data to the client, and at the same time, store the target map data in the first storage area again, completing the preheating of the target map data.
[0052] The following introduces the device embodiments of the present application. As Figure 3 shown, the present application provides a map access device for multi-person online, and the device includes the following modules.
[0053] A data writing module 310, configured to store map data in a first storage area and a second storage area respectively in response to a writing request from a client; the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data; A position acquisition module 320, configured to acquire the position coordinates in a reading request in response to a reading request from a client; A coordinate encoding module 330, configured to encode based on the position coordinates to obtain a routing key corresponding to the position coordinates; A data reading module 340, configured to read target map data corresponding to the routing key from the first storage area or the second storage area.
[0054] In an embodiment provided by the present application, the data reading module 340 includes: a routing judgment unit, configured to judge whether target map data corresponding to the routing key exists in the first storage area; a first reading unit, configured to read the target map data from the first storage area if the target map data exists in the first storage area; a second reading unit, configured to read the target map data from the second storage area if the target map data does not exist in the first storage area.
[0055] In an embodiment provided by the present application, the second reading unit is further configured to download a first encoded compressed package corresponding to a routing key from a second storage area; the first encoded compressed package is obtained by compressing a second encoded data stream using a first encoding algorithm; decompress the first encoded compressed package to obtain the second encoded data stream; restore the second encoded data stream to obtain target map data; write the target map data into a first storage area, and return the target map data to the client.
[0056] In an embodiment provided by the present application, the coordinate encoding module 330 includes: a first encoding unit configured to encode position coordinates using a specified encoding algorithm to obtain a spatial fingerprint with a first preset number of digits; a routing key determination unit configured to intercept a second preset number of digits from the spatial fingerprint as the routing key corresponding to the position coordinates.
[0057] In an embodiment provided by the present application, the data writing module 310 includes: a shard key determination unit configured to obtain a shard key corresponding to the map data to be stored based on the position coordinates in the map data to be stored; a first storage unit configured to store the map data to be stored in a first storage area based on the shard key and a consistent hashing algorithm; a second storage unit configured to compress and store the map data to be stored in a second storage area.
[0058] In an embodiment provided by the present application, the second storage unit is further configured to compress the map data to be stored using a second encoding algorithm to obtain a second encoded data stream; compress the second encoded data stream using a first encoding algorithm to obtain a first encoded compressed package; store the first encoded compressed package in the second storage area.
[0059] In an embodiment provided by the present application, the device of the present application further includes: a request processing module configured to, before storing map data in a first storage area and a second storage area respectively in response to a write request from a client, obtain an operation request sent by the client; determine the operation type of the operation request; the operation type includes a write request and a read request.
[0060] It should be understood that the specific implementation details of the device embodiments in the present application have been explained in detail in the corresponding method embodiments, and will not be elaborated here.
[0061] The following introduces the electronic device of the present application, as Figure 4 As shown, the present application provides an electronic device 400, which includes: a processor 410 and a memory 420, where the memory 420 is used to store executable instructions of the processor; the processor 410 executes the executable instructions to enable the electronic device to implement the multi-person online map access method provided by any embodiment of the present application.
[0062] Specifically, store the multi-player online map access method provided by this application in the memory 420 of the electronic device 400. By executing the multi-player online map access method provided by this application through the processor 410, in response to the write request of the client, store the map data to be stored in the first storage area and the second storage area respectively, so as to achieve double-layer storage of the map data to be stored, which can ensure the rapid storage of the map data to be stored and can also ensure that the map data will not be lost through the second storage area; in response to the read request of the client, obtain the position coordinates in the read request; encode based on the position coordinates to obtain the routing key corresponding to the position coordinates; read the target map data corresponding to the routing key from the first storage area or the second storage area; in this way, real-time access to the map data can be ensured even in large-scale multi-player online, and the required storage cost is lower.
[0063] It should be noted that the specific implementation content of the electronic device in this application has been explained in detail in the corresponding method embodiment, and will not be elaborated here.
[0064] Figure 5 Schematically shows a block diagram of a computer system of an electronic device for implementing the embodiments of this application.
[0065] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitations to the functions and usage scope of the embodiments of this application.
[0066] As Figure 5 shown, the computer system 500 includes a processor 501. The processor 501 can be a CPU (Central Processing Unit) or an MCU (Microcontroller Unit). The processor 501 can perform various appropriate actions and processes according to the program stored in the read-only memory 502 (Read-Only Memory, ROM) or the program loaded from the storage part 508 into the random access memory 503 (Random Access Memory, RAM). In the random access memory 503, various programs and data required for system operation are also stored. The processor 501, the read-only memory 502, and the random access memory 503 are connected to each other through a bus 504. The input / output interface 505 (Input / Output interface, that is, I / O interface) is also connected to the bus 504.
[0067] The following components are connected to the input / output interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a local area network card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as required. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as required so that a computer program read from it can be installed into the storage section 508 as required.
[0068] Specifically, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, various functions defined in the system of the present application are executed.
[0069] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0070] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0071] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0072] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute according to the embodiments of the present application.
[0073] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application.
[0074] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for map access in a multi - person online environment, characterized in that, Including: In response to a write request from a client, storing the map data to be stored in a first storage area and a second storage area respectively; the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data; In response to a read request from a client, obtaining the location coordinates in the read request; Encoding based on the location coordinates to obtain a routing key corresponding to the location coordinates; Reading target map data corresponding to the routing key from the first storage area or the second storage area.
2. The method for map access in a multi-player online environment according to claim 1, characterized in that, The reading the target map data corresponding to the routing key from the first storage area or the second storage area includes: Judging whether the target map data corresponding to the routing key exists in the first storage area; If the target map data exists in the first storage area, reading the target map data from the first storage area; If the target map data does not exist in the first storage area, reading the target map data from the second storage area.
3. The multi - person online map access method according to claim 2, wherein, The reading the target map data from the second storage area includes: Downloading a first encoded compressed package corresponding to the routing key from the second storage area; the first encoded compressed package is obtained by compressing a second encoded data stream using a first encoding algorithm; Decompressing the first encoded compressed package to obtain the second encoded data stream; Restoring the second encoded data stream to obtain the target map data; Writing the target map data into the first storage area and returning the target map data to the client.
4. The multi-person online map access method according to claim 1, characterized in that The encoding based on the location coordinates to obtain a routing key corresponding to the location coordinates includes: Encoding the location coordinates using a specified encoding algorithm to obtain a spatial fingerprint of a first preset number of digits; Intercepting a second preset number of digits from the spatial fingerprint as the routing key corresponding to the location coordinates.
5. The method for map access in a multi-player online environment according to claim 1, characterized in that, The storing the map data to be stored in a first storage area and a second storage area respectively includes: Based on the location coordinates in the map data to be stored, obtaining a shard key corresponding to the map data to be stored; Based on the shard key and the consistent hashing algorithm, storing the map data to be stored in the first storage area; Compressing the map data to be stored and storing it in the second storage area.
6. The multi-person online map access method according to claim 5, characterized in that, The storing the map data to be stored in the second storage area after compression includes: Compressing the map data to be stored using a second encoding algorithm to obtain a second encoded data stream; Compressing the second encoded data stream using a first encoding algorithm to obtain a first encoded compressed package; Storing the first encoded compressed package in the second storage area.
7. The method for map access in a multi-player online environment according to claim 1, wherein, Before, in response to a write request from a client, storing the map data in a first storage area and a second storage area respectively, the method further includes: Obtaining an operation request sent by the client; Judging the operation type of the operation request; the operation type includes a write request and a read request.
8. A map access device for multi-person online use, characterized in that, Including: A data writing module, configured to, in response to a write request from a client, store the map data in a first storage area and a second storage area respectively; the first storage area includes map data belonging to hot data, and the second storage area includes map data belonging to cold data; A location acquisition module, configured to acquire the location coordinates in the read request in response to a read request from a client; A coordinate encoding module, configured to perform encoding based on the location coordinates to obtain a routing key corresponding to the location coordinates; A data reading module, configured to read target map data corresponding to the routing key from the first storage area or the second storage area.
9. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the multi-player online map access method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, Comprising: A processor; A memory, configured to store executable instructions of the processor; When the processor executes the executable instructions, the electronic device implements the multi-player online map access method according to any one of claims 1 to 7 above.
Citation Information
Patent Citations
GIS data management and processing method based on cloud platform
CN110765192A
Mobile network data positioning system and method based on traffic line position fingerprint database
CN113207082A
High-precision map online data processing method and device, electronic equipment and storage medium
CN114201562A
Cited By
Method and equipment for processing meteorological grid point data based on database
CN121434319A
Method and apparatus for processing weather grid data based on database
CN121434319B