Method, device and computer readable storage medium for reading data

By generating a second identifier based on virtual object and system configuration information, the target server is determined, data is read from the preset database and stored in local memory, the database bearing pressure and server memory pressure problems when the client reads data is solved. , improves the gaming experience.

CN114748871BActive Publication Date: 2024-12-20NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210389879.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2024-12-20
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In the prior art, when a client reads data from a server, the database input and output bearing pressure is too high, and the server memory pressure increases due to the increase of redundant data.

Method used

By acquiring the client's data read request, the second identity is generated based on the first identity of the virtual object and the system configuration information, determine the target server, read the data from the target server, and store the data in local memory to avoid frequent access Generation of databases and redundant data.

Benefits of technology

It reduces the load pressure of database input and output, avoids the accumulation of redundant data in server memory, and improves the smoothness of game operation and player experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114748871B_ABST
    Figure CN114748871B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and computer-readable storage medium for reading data. The method comprises: obtaining a data reading request sent by a client, wherein the data reading request includes at least a first identifier of a virtual object; generating a second identifier according to the first identifier and system configuration information, wherein the system configuration information is configuration information of a local server connected to the client; determining a target server corresponding to the second identifier, wherein the target server stores game data read from a preset database; and reading target data corresponding to the first identifier from the game data stored in the target server. The present invention solves the technical problem in the prior art that redundant data is generated when the client reads data from the server, resulting in increased memory pressure on the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for reading data, and a computer-readable storage medium. Background Art

[0002] In a large-world game system, integrating all the characters corresponding to all players in one server can give players a good gaming experience. However, since the existing single server cannot carry the business logic of millions of players in terms of performance, it is necessary to use a routing mechanism in the background to ensure that logic processing is implemented on multiple servers, so as to give players the experience of being in the same server with other players.

[0003] Take the online game that uses the universe as the game world as an example. In the existing routing mechanism, multiple players are distributed on different servers. Each server has its own map mark. Multiple map marks form a galaxy map, so that the client can access the corresponding server according to the galaxy map. For example, in the game, there is a treasure map item that can be moved and traded. Correspondingly, at the data storage level, the data corresponding to the treasure map item can be stored in any server. Specifically, since the treasure location corresponding to the treasure map item needs to be recorded, every time a player finds the treasure map item, the client needs to read the data corresponding to the treasure map item.

[0004] In the existing routing mechanism, the client can connect to the corresponding server, and then the client can directly read data from the database through the server. However, when reading data in this way, the server corresponding to the client will frequently access the database, which will cause load pressure on the input and output of the database.

[0005] In addition, the prior art can also read data by reading memory. For example, the data in the database is pre-stored in the memory of the server, and the client can be connected to the corresponding server, so that when the client needs to obtain data, it does not need to access the database again, and can directly read the data from the server's memory. However, in this way, since the server will pull data from the database and store it every time the player arrives at a place, different servers have the same redundant data, and as the game data increases, the redundant data will also increase synchronously, thereby increasing the memory pressure of the server. Summary of the invention

[0006] The embodiments of the present invention provide a method, device and computer-readable storage medium for reading data, so as to at least solve the technical problem in the prior art that redundant data is generated when a client reads data from a server, resulting in increased memory pressure on the server.

[0007] According to one aspect of an embodiment of the present invention, a method for reading data is provided, comprising: obtaining a data reading request sent by a client, wherein the data reading request includes at least a first identifier of a virtual object; generating a second identifier based on the first identifier and system configuration information, wherein the system configuration information is configuration information of a local server connected to the client; determining a target server corresponding to the second identifier, wherein the target server stores game data read from a preset database; and reading target data corresponding to the first identifier from the game data stored on the target server.

[0008] Furthermore, the method for reading data also includes: determining a game scene corresponding to the virtual object; obtaining target configuration parameters from system configuration information based on the game scene; and performing a modulo calculation on the first identifier based on the target configuration parameters to obtain a second identifier.

[0009] Furthermore, the method for reading data also includes: before obtaining the target configuration parameters from the system configuration information based on the game scenario, determining the game scenario corresponding to the local server; and obtaining the system configuration information from the local memory of the local server according to the game scenario.

[0010] Furthermore, the method for reading data also includes: obtaining a correspondence between a server identifier and at least one candidate server, wherein the at least one candidate server is used to store game data in different game scenarios, and the at least one candidate server includes at least a target server; determining the target server from the at least one candidate server based on the correspondence and the second identifier.

[0011] Furthermore, the method for reading data also includes: generating a data query instruction based on the first identifier; sending the data query instruction, and obtaining target data that the target server queries from the game data according to the data query instruction; and reading the target data.

[0012] Furthermore, the method for reading data also includes: after receiving the data query instruction, when the target server detects that the target data does not exist in the local memory, reading the target data from a preset database based on the first identifier and storing the target data in the local memory.

[0013] Furthermore, the method for reading data also includes: after reading the target data corresponding to the first identifier from the game data stored in the target server, pushing the target data to the client, so that the client displays the target data in a visual form.

[0014] According to another aspect of an embodiment of the present invention, a device for reading data is also provided, including: an acquisition module, used to acquire a data reading request sent by a client, wherein the data reading request includes at least a first identifier of a virtual object; a generation module, used to generate a second identifier based on the first identifier and system configuration information, wherein the system configuration information is configuration information of a local server connected to the client; a determination module, used to determine a target server corresponding to the second identifier, wherein the target server stores game data read from a preset database; and a reading module, used to read target data corresponding to the first identifier from the game data stored on the target server.

[0015] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for reading data when it is run.

[0016] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned method of reading data when running.

[0017] In an embodiment of the present invention, the game data read from the preset database is stored in the target server. After obtaining the data reading request sent by the client, a second identifier is generated according to the first identifier and the system configuration information, and the target server corresponding to the second identifier is determined, so as to read the target data corresponding to the first identifier from the game data stored in the target server. The data reading request includes at least the first identifier of the virtual object, the system configuration information is the configuration information of the local server connected to the client, and the target server stores the game data read from the preset database.

[0018] As can be seen from the above content, in the present application, when the client needs to read the target data about the virtual object, the target data is read from the target server storing the game data in the preset database, thereby avoiding the problem of excessive load pressure on the database input and output caused by the client frequently accessing the database. In addition, since the present application adopts the method of pre-storing the game data read from the preset database in the target server, and the second identifier is generated based on the first identifier of the virtual object and the system configuration information, therefore, no matter where the virtual object is in the galaxy map, the local server corresponding to the client finally reads the target data from the target server, that is, the target data will not be stored in other servers as the virtual object moves, thereby avoiding the problem of redundant data in the server and achieving the effect of reducing the memory pressure of the server.

[0019] It can be seen that the technical solution of the present application achieves the purpose of avoiding the generation of redundant data in the server, thereby achieving the technical effect of improving the player experience, and further solving the technical problem in the prior art that redundant data is generated when the client reads data from the server, resulting in increased memory pressure on the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0021] Figure 1 is a flow chart of a method for reading data according to the prior art;

[0022] Figure 2 is a flow chart of a method for reading data according to the prior art;

[0023] Figure 3 is a flow chart of a method for reading data according to an embodiment of the present invention;

[0024] Figure 4 is a flow chart of a method for reading data according to an embodiment of the present invention;

[0025] Figure 5 is a schematic diagram of a device for reading data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

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

[0028] In addition, it should be noted that in the technical solution of this application, the acquisition, storage and application of user personal information involved are all information authorized by the user or fully authorized by all parties.

[0029] Example 1

[0030] According to an embodiment of the present invention, an embodiment of a method for reading data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] Figure 3 is a flow chart of a method for reading data according to an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0032] Step S302: obtaining a data reading request sent by the client.

[0033] In step S302, the data read request includes at least the first identifier of the virtual object. The virtual object may be a virtual item in a game system. For example, in an online game with a universe as the game world (this embodiment is described by taking this type of game as an example), the game system may be a treasure map system, a fleet system, or other types of game systems. When the game system is a treasure map system, the virtual object may be a virtual treasure, and the first identifier may be the ID (Identity document, unique identifier) ​​of the virtual treasure; when the game system is a fleet system, the virtual object may be a virtual ship, and the first identifier may be the ID of the virtual ship. In addition, the client may be any terminal device such as a laptop computer, a desktop computer, a smart tablet, a smart phone, a smart watch, or the like.

[0034] In addition, the player can send a data read request to the corresponding local server through the client. For example, in the treasure map system, the player wants to transfer virtual treasure A from the current location B to the target location C. When the player performs this operation in the game, the player's corresponding client will send a data read request about virtual treasure A to the corresponding local server. After the local server obtains the data read request about virtual treasure A, the local server responds to the data read request and generates a second identifier according to the first identifier corresponding to virtual treasure A.

[0035] Step S304: Generate a second identifier according to the first identifier and system configuration information.

[0036] In step S304, the system configuration information is the configuration information of the local server connected to the client. The local server is a galaxy map local server. Specifically, in the big world game system, players are distributed on different servers, and each server has its own map mark, and all the map marks constitute the galaxy map. At this time, each server can be regarded as a galaxy map local server, so that after logging into the client, the player can access the corresponding galaxy map local server according to the galaxy map where he is located. Players can be distinguished by their nicknames or accounts in the game. For example, players nicknamed Player 1 are distributed on galaxy map local server 1, and players nicknamed Player 2 are distributed on galaxy map local server 2.

[0037] Furthermore, the system configuration information can be set by the operator in the code configuration according to different game scenarios. For example, for a treasure map game scenario, the system configuration information can be set to configuration information A, and for a fleet game scenario, the system configuration information can be set to configuration information B. In addition, after obtaining the first identifier of the virtual object, the local server can obtain the target configuration parameter based on the system configuration information, and then perform a modulo calculation on the first identifier based on the target configuration parameter to obtain the second identifier.

[0038] It should be noted that generating the second identifier based on the system configuration information and the first identifier can ensure that the second identifier corresponding to each virtual object is fixed, so that when the local server determines the target server according to the second identifier, it can accurately find the corresponding target server, thereby achieving the purpose of accurately obtaining the target data and avoiding the problem of redundant data generated in the server in the prior art.

[0039] Step S306: determine the target server corresponding to the second identifier.

[0040] In step S306, the target server stores the game data read from the preset database. Specifically, the target server may be a node server. After the client is connected to the galaxy map local server, the galaxy map local server may generate a second identifier according to the first identifier of the virtual object and the system configuration information, and then the galaxy map local server may perform routing addressing according to the second identifier, thereby determining the corresponding target server from multiple candidate servers. Among them, multiple candidate servers are node servers, and multiple candidate servers are used to store game data in different game scenarios. In addition, the target server may be a server deployed locally or a server deployed in the cloud.

[0041] It should be noted that since the second identifier corresponding to each virtual object is fixed, it ensures that when the local server determines the target server based on the second identifier, the local server can accurately find the corresponding target server, thereby achieving the effect of accurately obtaining the target data, which is beneficial to improving the efficiency of the client in reading the target data.

[0042] Step S308: Read target data corresponding to the first identifier from the game data stored in the target server.

[0043] In step S308, the Galaxy Map local server can read the target data from the target server and push the target data to the client. Specifically, the client first connects to the Galaxy Map local server, and then the Galaxy Map local server obtains the second identifier based on the first identifier and system configuration information sent by the client, and uses the second identifier as a node for routing addressing, and connects to the corresponding target server through the second identifier, so that the target server will obtain the game data from the preset database and store it in the local memory of the target server. Furthermore, when the client needs to read the target data later, the client only needs to access the Galaxy Map local server first, and then the Galaxy Map local server accesses the target server that has stored the target data, so that the target server directly returns the target data to the Galaxy Map local server, and finally the Galaxy Map local server can push the target data to the client. Among them, the game data at least contains the target data.

[0044] Optionally, in the prior art, two methods can be used to allow the client to obtain the target data. Figure 1 As shown in the figure, the first method is for the client to connect to the corresponding local server, and then the client directly obtains the target data from the database through the local server. However, this method of frequent direct access to the database by the client will burden the I / O (input / output) of the database, and the delay when reading the database will be very high, which will cause the game running in the client to freeze.

[0045] The second method is to read the memory. Figure 2 As shown, the data in the database is pre-stored in the local server, and then the client can connect to the local server. When the client needs to obtain the target data, the client does not need to access the database again, but can directly access the local server, and the local server sends the target data to the client. However, since the information of the virtual object is stored in the local server corresponding to the location, as the virtual object moves and trades, there will be a lot of duplicate information stored in multiple local servers. This duplicate information becomes redundant data in the local server. The accumulation of redundant data will cause the problem of excessive memory pressure on the server.

[0046] In the present application, by obtaining the target data from the target server, the problem of frequent access to the database is avoided, thereby reducing the input / output pressure of the database and improving the smoothness of the game operation. In addition, since the present application adopts the method of pre-storing the game data read from the preset data in the target server, no matter where the virtual object moves to, the client will eventually read the target data about the virtual object from the target server, that is, the target data will not be stored in other servers as the position of the virtual object changes, thereby avoiding the problem of redundant data in other servers and achieving the effect of reducing the memory pressure of the server.

[0047] Based on the contents of the above steps S302 to S308, it can be known that in the embodiment of the present invention, the game data read from the preset database is stored in the target server. After obtaining the data reading request sent by the client, the second identifier is generated according to the first identifier and the system configuration information, and the target server corresponding to the second identifier is determined, so as to read the target data corresponding to the first identifier from the game data stored in the target server. The data reading request includes at least the first identifier of the virtual object, the system configuration information is the configuration information of the local server connected to the client, and the target server stores the game data read from the preset database.

[0048] As can be seen from the above content, in the present application, when the client needs to read the target data about the virtual object, the target data is read from the target server storing the game data in the preset database, thereby avoiding the problem of excessive load pressure on the database input and output caused by the client frequently accessing the database. In addition, since the present application adopts the method of pre-storing the game data read from the preset database in the target server, and the second identifier is generated based on the first identifier of the virtual object and the system configuration information, therefore, no matter where the virtual object is in the galaxy map, the local server corresponding to the client finally reads the target data from the target server, that is, the target data will not be stored in other servers as the virtual object moves, thereby avoiding the problem of redundant data in the server and achieving the effect of reducing the memory pressure of the server.

[0049] It can be seen that the technical solution of the present application achieves the purpose of avoiding the generation of redundant data in the server, thereby achieving the technical effect of improving the player experience, and further solving the technical problem in the prior art that redundant data is generated when the client reads data from the server, resulting in increased memory pressure on the server.

[0050] In an optional embodiment, the local server may generate the second identifier according to the first identifier and the system configuration information. Specifically, the local server may first determine the game scene corresponding to the virtual object, then obtain the target configuration parameters from the system configuration information based on the game scene, and finally perform a modulo calculation on the first identifier based on the target configuration parameters to obtain the second identifier.

[0051] Optionally, in the same game system, there may be multiple different game scenes. For example, in a game system, there may be game scenes such as treasure map activities, legion activities, and battle activities at the same time. In addition, for each virtual object, the virtual object will have a corresponding game scene. On this basis, the local server can obtain the target configuration parameters from the system configuration information based on each game scene, and perform a modulo calculation on the first identifier of the virtual object based on the target configuration parameters to obtain the second identifier.

[0052] Specifically, the operator can define different target configuration parameters according to different game scenarios in the code configuration. For example, the operator can define the target configuration parameter for the treasure map game scenario as: TREASURE_MAP = 512. Then, when the local server performs a modulo calculation on the first identifier based on the target configuration parameter, the local server can perform the following modulo calculation on the first identifier based on the target configuration parameter corresponding to the treasure map game scenario: item_id%RouteMods.TREASURE_MAP, thereby obtaining the second identifier according to the calculation result.

[0053] Optionally, taking the game scene as a treasure map game scene as an example, the first identifier of each virtual object in the treasure map game scene is fixed and each first identifier is unique, so whether the virtual object is traded or moved, the first identifier of the virtual object will not be changed. In addition, since the target configuration parameters corresponding to each game scene are also fixed, the second identifier obtained after the modulo calculation of a first identifier and a target configuration parameter is also fixed. Further, if a new virtual object A is generated in the game, then after the virtual object A is generated, the second identifier corresponding to the virtual object A is also determined, and then the target server corresponding to the virtual object A is also determined.

[0054] Optionally, if the target server pointed to by the second identifier corresponding to virtual object A is server A, then no matter whether virtual object A is traded or moved, when the client reads the target data about virtual object A, the local server will obtain the target data from server A without accessing other servers.

[0055] From the above content, it can be seen that the modulo calculation of the first identifier based on the target configuration parameters ensures that the second identifier corresponding to each virtual object is fixed, so that when the local server determines the target server according to the second identifier, it can accurately find the corresponding target server, thereby achieving the purpose of accurately obtaining the target data and solving the problem of redundant data generated in the server in the prior art.

[0056] In an optional embodiment, before obtaining the target configuration parameters from the system configuration information based on the game scenario, the local server may determine the game scenario corresponding to the local server, and obtain the system configuration information from the local memory of the local server according to the game scenario.

[0057] Optionally, since the system configuration information corresponding to each game scene is different, the local server first needs to determine the game scene corresponding to the local server when obtaining the system configuration information. For example, the local server can determine the game scene corresponding to the virtual object through a first identifier, or when the client sends a data reading request to the local server, the data reading request includes a game scene identifier.

[0058] Furthermore, after determining the corresponding game scene, the local server can obtain system configuration information from the local memory of the local server according to the game scene. For example, if the local server determines that the game scene is a treasure map game scene, it will obtain the system configuration information corresponding to the treasure map game scene from the local memory.

[0059] It should be noted that by configuring different system configuration information according to the game scene, the uniqueness of the second identifier is ensured. Therefore, when there are multiple game scenes, the local server can still accurately find the target server corresponding to the virtual object in each game scene, thereby improving the efficiency of acquiring the target data without generating redundant data for the server.

[0060] In an optional embodiment, the local server may obtain a correspondence between a server identifier and at least one candidate server, and determine a target server from at least one candidate server based on the correspondence and the second identifier. The at least one candidate server is used to store game data in different game scenarios, and the at least one candidate server includes at least the target server.

[0061] Optionally, game data in different game scenarios can be stored in different node servers, and these node servers can all be used as candidate servers to provide game data for local servers. For example, node server 1 is used to store game data in the treasure map game scenario, node server 2 is used to store game data in the legion activity game scenario, and node server 3 is used to store game data in the battle activity game scenario.

[0062] In addition, the local server can establish and store a correspondence between the server identifier and at least one candidate server. For example, for local server A, local server A can provide game data in the treasure map game scene for the client, and can also provide game data in the legion activity game scene for the client. Therefore, local server A can establish a correspondence with the above-mentioned node server 1 and node server 2. When local server A generates a second identifier for the treasure map game scene, node server 1 is determined to be the target server, and when local server A generates a second identifier for the legion activity game scene, node server 2 is determined to be the target server.

[0063] It should be noted that by establishing at least one candidate server to store game data in different game scenarios, standardized management of game data is achieved. In addition, using multiple servers to store game data reduces the storage pressure of each server and improves the efficiency of the local server in obtaining target data from the target server.

[0064] In an optional embodiment, after generating the data query instruction based on the first identifier, the local server sends the data query instruction and obtains the target data that the target server queries from the game data according to the data query instruction, thereby reading the target data.

[0065] Optional, such as Figure 4 As shown, after the local server receives the data reading request sent by the client, the local server can generate a second identifier according to the first identifier in the data reading request, and determine the corresponding target server according to the second identifier. Then, the local server generates a data query instruction based on the first identifier, and sends the data query instruction to the target server. Since the target server has pre-stored game data obtained from the preset database, the target server can directly extract the target data from the game data according to the data query instruction, and return the target data to the local server, and then the local server pushes the target data to the client.

[0066] It can be seen that by using the target server to store game data, when the client needs to read the target data, it does not need to frequently access the database, and no redundant data will be generated in the server, thereby achieving the effect of reducing the memory pressure of the server and improving the player's gaming experience.

[0067] In an optional embodiment, after receiving the data query instruction, when it is detected that the target data does not exist in the local memory, the target server reads the target data from a preset database based on the first identifier and stores the target data in the local memory of the target server.

[0068] Optionally, when the game system is initialized, after receiving the data query instruction, the local server can detect whether the target data exists in the local memory of the target server by accessing the target server. If it is detected that the target data does not exist in the local memory, the target server will first read the target data from the preset database, and then store the target data in the local memory. The scenario in which the target data does not exist in the local memory can be the scenario when the game system is initialized as described above, or it can be the scenario when new content is launched in the game, for example, a new game scene is added to the game, or a new virtual object is added to the game, etc.

[0069] In the above process, by detecting the data in the local memory of the target server, the effect of real-time updating of the game data in the local memory of the target server is achieved, thereby ensuring the efficiency of the client reading the target data to the greatest extent, thereby reducing the input / output pressure of the database and improving the gaming experience of gamers.

[0070] In an optional embodiment, after reading the target data corresponding to the first identifier from the game data stored in the target server, the local server may push the target data to the client so that the client displays the target data in a visual form.

[0071] Optionally, after the local server obtains the target data from the target server, the local server may push the target data to the client that sent the data read request, so that the client can display the corresponding game content based on the target data. For example, the data read request is to move the virtual object A from the current position B to the target position C, wherein the target data corresponding to the data read request at least includes the corresponding information of the virtual object A, the current position B, and the target position C. On this basis, after obtaining the target data, the client can update the game content according to the corresponding information of the virtual object A, the current position B, and the target position C, and finally present the effect that the position of the virtual object A is changed from the current position B to the target position C.

[0072] It should be noted that by having the target server return the target data to the local server, and having the local server push the target data to the client, the problem of frequent database access in the prior art is avoided, thereby achieving the effect of reducing database access pressure.

[0073] It can be seen from the above content that when the client needs to read the target data about the virtual object, the present application can first determine the second identifier through the first identifier of the virtual object, and then determine the target server storing the target data through the second identifier, and read the target data from the target server, thereby avoiding the problem of excessive load pressure on the database input and output caused by the client frequently accessing the database. In addition, since the present application adopts the method of pre-storing the game data read from the preset database in the target server, and the second identifier is generated based on the first identifier of the virtual object and the system configuration information, therefore, no matter where the virtual object is in the galaxy map, the local server corresponding to the client will eventually read the target data from the target server, that is, the target data will not be stored in other servers as the virtual object moves, thereby avoiding the problem of redundant data in the server and achieving the effect of reducing the memory pressure of the server.

[0074] It can be seen that the technical solution of the present application achieves the purpose of avoiding the generation of redundant data in the server, thereby achieving the technical effect of improving the player experience, and further solving the technical problem in the prior art that redundant data is generated when the client reads data from the server, resulting in increased memory pressure on the server.

[0075] Example 2

[0076] According to an embodiment of the present invention, there is also provided an embodiment of a device for reading data, wherein: Figure 5 is a schematic diagram of a device for reading data according to an embodiment of the present invention, such as Figure 5 As shown, the device includes the following modules: an acquisition module 501 , a generation module 502 , a determination module 503 and a reading module 504 .

[0077] Among them, the acquisition module 501 is used to obtain the data reading request sent by the client, wherein the data reading request includes at least the first identifier of the virtual object; the generation module 502 is used to generate the second identifier based on the first identifier and the system configuration information, wherein the system configuration information is the configuration information of the local server connected to the client; the determination module 503 is used to determine the target server corresponding to the second identifier, wherein the target server stores the game data read from the preset database; the reading module 504 is used to read the target data corresponding to the first identifier from the game data stored in the target server.

[0078] It should be noted that the above-mentioned acquisition module 501, generation module 502, determination module 503 and reading module 504 correspond to steps S302 to S308 in the above-mentioned embodiment, and the examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.

[0079] Optionally, the generation module further includes: a first determination module, a first acquisition module and a calculation module. The first determination module is used to determine the game scene corresponding to the virtual object; the first acquisition module is used to obtain target configuration parameters from system configuration information based on the game scene; and the calculation module is used to perform a modulo calculation on the first identifier based on the target configuration parameters to obtain a second identifier.

[0080] Optionally, the data reading device further includes: a second determination module and a second acquisition module, wherein the second determination module is used to determine the game scene corresponding to the local server; and the second acquisition module is used to acquire system configuration information from the local memory of the local server according to the game scene.

[0081] Optionally, the determination module further includes: a third acquisition module and a third determination module. The third acquisition module is used to acquire the correspondence between the server identifier and at least one candidate server, wherein the at least one candidate server is used to store game data in different game scenarios, and the at least one candidate server includes at least a target server; the third determination module is used to determine the target server from the at least one candidate server based on the correspondence and the second identifier.

[0082] Optionally, the reading module further includes: a generating module, a sending module and a first reading module. The generating module is used to generate a data query instruction based on the first identifier; the sending module is used to send the data query instruction and obtain the target data that the target server queries from the game data according to the data query instruction; and the first reading module is used to read the target data.

[0083] Optionally, the device for reading data also includes: a second reading module, which is used to, after receiving the data query instruction, when the target server detects that the target data does not exist in the local memory, read the target data from the preset database based on the first identifier and store the target data in the local memory.

[0084] Optionally, the device for reading data further includes: a push module, configured to push the target data to the client, so that the client displays the target data in a visual form.

[0085] Example 3

[0086] According to an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is configured to execute the method for reading data in Embodiment 1 when running.

[0087] Example 4

[0088] According to an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are enabled to run the programs, wherein the program is configured to execute the method for reading data in Example 1 when running.

[0089] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0090] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

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

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

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

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

[0095] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for reading data, characterized in that: include: Acquire a data reading request sent by a client, wherein the data reading request includes at least a first identifier of a virtual object; generating a second identifier according to the first identifier and system configuration information, wherein the system configuration information is configuration information of a local server connected to the client; Determining a target server corresponding to the second identifier, wherein the target server stores game data read from a preset database; Reading target data corresponding to the first identifier from the game data stored in the target server; Among them, generating the second identifier based on the first identifier and the system configuration information includes: determining the game scene corresponding to the virtual object; obtaining target configuration parameters from the system configuration information based on the game scene, wherein the system configuration information is determined based on the game scene corresponding to the local server; performing modulo calculation on the first identifier based on the target configuration parameters to obtain the second identifier.

2. The method according to claim 1, characterized in that Before acquiring the target configuration parameters from the system configuration information based on the game scenario, the method further includes: Determining the game scene corresponding to the local server; The system configuration information is obtained from the local memory of the local server according to the game scenario.

3. The method according to claim 1, characterized in that Determining a target server corresponding to the second identifier includes: Acquire a correspondence between a server identifier and at least one candidate server, wherein the at least one candidate server is used to store game data in different game scenarios, and the at least one candidate server includes at least the target server; The target server is determined from the at least one candidate server based on the corresponding relationship and the second identifier.

4. The method according to claim 1, characterized in that: Reading target data corresponding to the first identifier from the game data stored in the target server includes: generating a data query instruction based on the first identifier; Sending the data query instruction, and obtaining the target data that the target server queries from the game data according to the data query instruction; The target data is read.

5. The method according to claim 4, characterized in that After receiving the data query instruction, when the target server detects that the target data does not exist in the local memory, it reads the target data from the preset database based on the first identifier and stores the target data in the local memory.

6. The method according to claim 1, characterized in that After reading the target data corresponding to the first identifier from the game data stored in the target server, the method further includes: The target data is pushed to the client, so that the client displays the target data in a visual form.

7. A device for reading data, characterized in that: include: An acquisition module, configured to acquire a data reading request sent by a client, wherein the data reading request at least includes a first identifier of a virtual object; A generating module, configured to generate a second identifier according to the first identifier and system configuration information, wherein the system configuration information is configuration information of a local server connected to the client; A determination module, configured to determine a target server corresponding to the second identifier, wherein the target server stores game data read from a preset database; A reading module, configured to read target data corresponding to the first identifier from the game data stored in the target server; Among them, the generation module is also used to: determine the game scene corresponding to the virtual object; obtain target configuration parameters from the system configuration information based on the game scene, wherein the system configuration information is determined based on the game scene corresponding to the local server; perform modulo calculation on the first identifier based on the target configuration parameters to obtain the second identifier.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method for reading data as claimed in any one of claims 1 to 6 when executed.

9. An electronic device, characterized in that: The electronic device comprises one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the function of running the programs, wherein the programs are configured to execute the method for reading data described in any one of claims 1 to 6 when running.