Data processing method and related device
By using the identification and resource type identifier carried by data processing requests in online games to obtain and process target resource data, the problem of low efficiency in virtual resource data calling in online games is solved, and efficient data calling of multi-resource types is achieved.
Patent Information
- Application Number
- CN202311776645.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
In online games, how to efficiently call multiple types of virtual resource data of game users, avoid the need to configure IDIP ports for each resource type, and improve data call efficiency.
Through the preset user's identification and the identification of the first resource type carried in the data processing request, the target resource data of the preset user is obtained and processed, and the corresponding relationship between the IDIP port and the resource type and the identification of the resource type is realized.
It realizes efficient calls to the virtual resource data of game users, without configuring a separate IDIP port for each resource type, improving data call efficiency and flexibility.
Smart Images

Figure CN120189718A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technologies, and in particular, to a method for data processing and related devices. Background Art
[0002] Online games, also known as "internet games", abbreviated as "online games", refer to multiplayer online games with sustainability that aim to achieve entertainment, leisure, communication, and virtual achievements, using the Internet as the transmission medium, the game operator's server and the user's computer as processing terminals, and the game client software as the information interaction window.
[0003] In online games, game users often have various types of virtual resources, such as different types of virtual resources like virtual equipment and virtual avatars. There is at least one page mini-game embedded in the online game client. During the operation of the page mini-game, it is necessary to call the virtual resource data owned by the game user. Since the virtual resources owned by the game user are diverse, how to efficiently call the virtual resource data of the game user has become an urgent problem to be solved. Summary of the Invention
[0004] Embodiments of this application provide a method for data processing and related devices for efficiently calling the virtual resource data of game users.
[0005] The first aspect of this application provides a method for data processing, including:
[0006] Obtain a data processing request, where the data processing request carries the identifier of a preset user and the identifier of a first resource type;
[0007] Obtain the target resource data of the preset user according to the data processing request. The target resource data is the resource data of the preset user before obtaining the data processing request, and the target resource data includes the resource data of the first resource type;
[0008] Process the target resource data according to the data processing request.
[0009] The second aspect of this application provides a data processing device, including:
[0010] An obtaining unit, configured to obtain a data processing request, where the data processing request carries the identifier of a preset user and the identifier of a first resource type;
[0011] The obtaining unit is further configured to obtain the target resource data of the preset user according to the data processing request. The target resource data is the resource data of the preset user before obtaining the data processing request, and the target resource data includes the resource data of the first resource type;
[0012] A processing unit, configured to process the target resource data according to the data processing request.
[0013] In a possible implementation of the second aspect, the login status of the preset user is set as the third identifier, and the third identifier indicates that the preset user is in an offline state;
[0014] The obtaining unit is specifically configured to:
[0015] Obtain the first resource data of the preset user, where the first resource data is the resource data when the preset user is online, and the first resource data includes the resource data of the first resource type;
[0016] Obtain the data modification record of the preset user. The data modification record is the record of modifying the resource data of the preset user before obtaining the data processing request, and the data modification record includes the modification of the resource data of the first resource type;
[0017] Update the first resource data according to the data modification record to obtain the target resource data.
[0018] In a possible implementation of the second aspect, the data processing request includes an update request. The update request carries a first value, and there is a corresponding relationship between the first value and the identifier of the first resource type. The update request also carries an increase identifier or a decrease identifier;
[0019] The processing unit is specifically configured to:
[0020] Update the target resource data according to the first value to obtain the updated target resource data;
[0021] When the updated target resource data meets the preset conditions, generate a target modification record. The target modification record carries the first value, the identifier of the first resource type, and the corresponding relationship between the first value and the identifier of the first resource type;
[0022] Send the target modification record to the storage space.
[0023] In a possible implementation of the second aspect, the device further includes an update unit, which is configured to update the login status of the preset user to the first identifier, and the first identifier indicates that the resource data of the preset user cannot be updated.
[0024] In a possible implementation of the second aspect, the obtaining unit is further configured to obtain the login status of the preset user;
[0025] The update unit is specifically configured to update the login status of the preset user to the first identifier when the login status of the preset user is different from the first identifier.
[0026] In a possible implementation of the second aspect, the obtaining unit is further configured to obtain a second identifier, where the second identifier is used to mark the asset data of the preset user, and the second identifier is included in the data update request;
[0027] The updating unit is further configured to update the second identifier to obtain an updated second identifier;
[0028] The updating unit is further configured to update the data modification record according to the target modification record to obtain an updated data modification record, and the updated data modification record includes the updated second identifier.
[0029] In a possible implementation manner of the second aspect, when the login status of the preset user is switched from the third identifier to the logged-in status, the updating unit is further configured to update the login status of the preset user to the fourth identifier when the login status of the preset user meets the login condition, and the fourth identifier is the identifier of the login server of the preset user;
[0030] The obtaining unit is further configured to obtain the first resource data and the updated data modification record;
[0031] The processing unit is further configured to determine, according to the updated second identifier, that the updated data modification record is a modification record to be updated;
[0032] The updating unit is further configured to update the first resource data according to the updated data modification record to obtain an updated target resource data.
[0033] Another aspect of the present application provides a computer device, including:
[0034] A memory, a transceiver, a processor, and a bus system;
[0035] Wherein, the memory is used to store programs;
[0036] The processor is configured to execute the programs in the memory, including executing the methods of the above aspects;
[0037] The bus system is used to connect the memory and the processor so that the memory and the processor can communicate.
[0038] Another aspect of the present application provides a computer-readable storage medium, in which instructions are stored, and when the instructions run on a computer, the computer is caused to execute the methods of the above aspects.
[0039] Another aspect of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above aspects.
[0040] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0041] The present application provides a data processing method and related devices. By using the identifier of a preset user and the identifier of a first resource type carried in a data processing request, it realizes the invocation of data of the first resource type of the preset user in a game server. There is no need to configure an IDIP port for each resource type separately. Through the correspondence between the identifier of the resource type and the resource data of the resource type, the invocation of data of multiple resource types is performed, achieving efficient invocation of the user's resource data. Brief Description of the Drawings
[0042] Figure 1 It is a schematic flowchart of a method for querying user resource data provided by an embodiment of the present application;
[0043] Figure 2 It is a schematic architecture diagram of a data processing system provided by an embodiment of the present application;
[0044] Figure 3 It is a schematic flowchart of a data processing method provided by an embodiment of the present application;
[0045] Figure 4 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0046] Figure 5 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0047] Figure 6 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0048] Figure 7 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0049] Figure 8 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0050] Figure 9 It is another schematic flowchart of a data processing method provided by an embodiment of the present application;
[0051] Figure 10 It is a schematic interface diagram of a game client provided by an embodiment of the present application;
[0052] Figure 11 It is another schematic interface diagram of a game client provided by an embodiment of the present application;
[0053] Figure 12a It is another schematic interface diagram of a game client provided by an embodiment of the present application;
[0054] Figure 12bAnother interface schematic diagram of the game client provided by the embodiments of the present application;
[0055] Figure 13 A schematic diagram of a data structure of the IDIP protocol for invoking user asset data provided by the embodiments of the present application;
[0056] Figure 14 A schematic diagram of a data structure of a database table for resource update provided by the embodiments of the present application;
[0057] Figure 15 Another schematic diagram of a data structure of the IDIP protocol for invoking user asset data provided by the embodiments of the present application;
[0058] Figure 16 A schematic diagram of a structure of a data processing device provided by the embodiments of the present application;
[0059] Figure 17 Another schematic diagram of a structure of a data processing device provided by the embodiments of the present application;
[0060] Figure 18 A schematic diagram of a server structure provided by the embodiments of the present application. Detailed implementation manners
[0061] The embodiments of the present application provide a data processing method and related devices for efficiently invoking virtual resource data of game users.
[0062] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of the present application are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data may be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "correspond to" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these process, method, product or device.
[0063] To facilitate understanding of the technical solutions provided by the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:
[0064] Player resource data: refers to the virtual resources obtained by players in the game, such as vouchers, props, etc. These data need to be stored in the database table associated with the player to prevent loss, and such data has extremely high requirements for correctness.
[0065] The game lobby server (zonesvr), as the entry of the game business server cluster, accepts request messages from the game client, processes the request services locally or through multi-server collaboration, and returns the processing results to the game client.
[0066] The game online server (onlinesvr) is mainly used to manage the player account information logged in on each zonesvr, forward messages to online players on different zonesvrs, and provide functions such as load balancing.
[0067] TcaplusDB: A distributed NoSQL database independently developed by the IEG business group of Tencent. Due to its high performance, high availability, low cost, dynamic scalability, and ease of use, it is widely adopted by many game projects of Tencent's self-developed studios as the main game data storage component in the actual operation environment.
[0068] The Tencent Interactive Entertainment Data Interface Platform (ieod data interface platform, IDIP), a data interface bridge between the game internal and the game peripheral operation support system, realizes operations such as adding, deleting, modifying, and querying game data (such as items, experience, currency, chat bans, etc.).
[0069] The game IDIP command access server (GameIDIPsvr) receives externally input IDIP instructions and parameters, modifies system or player data, and thus completes the IDIP instruction functions.
[0070] EventLog: A mechanism in game projects that uses a database for offline message notification. The game server abstracts the events to be notified to offline players in the game into a database record and stores it in the database. When the player goes online, the database record message is responded to and processed, thus realizing the message notification function for offline players.
[0071] Online games, also known as "internet games", abbreviated as "online games", refer to multiplayer online games that use the Internet as the transmission medium, use the game operator's server and the user's computer as processing terminals, and use the game client software as the information interaction window, aiming to achieve entertainment, relaxation, communication, and virtual achievements and having sustainability.
[0072] In online games, game users often have various types of virtual resources. For example, different types of virtual resources such as virtual equipment and virtual avatars. At least one page mini-game is embedded in the online game client. During the operation of the page mini-game, it is necessary to call the virtual resource data owned by the game user. The following combines Figure 1 to illustrate the query of user resource data:
[0073] a. The H5 mini-game embedded in the client calls the client SDK to send a request to query the user's resource quantity to the server of the H5 mini-game. This request to query the user's resource quantity is used to query the quantity of the user's Resource A.
[0074] b. According to the mapping relationship between Resource A and the IDIP request in the request to query the user's resource quantity, the server (activity-svr) of the H5 mini-game sends an IDIP request A (query request) to the GameIDIPsvr of the client. The IDIP request A is used to query the quantity of the user's Resource A.
[0075] c. After receiving the IDIP request A, the GameIDIPsvr of the client forwards an online query request to the onlinesvr according to the user ID carried by the IDIP request A. When the user is online, step d is executed; when the user is offline, step f is executed.
[0076] d. The GameIDIPsvr of the client receives the zonesvr information sent by the onlinesvr. The zonesvr information includes the user ID, and sends a data request to query Resource A to this zonesvr. The data request to query Resource A is used to query the real-time data corresponding to the user's Resource A.
[0077] e. The zonesvr queries the real-time data of Resource A (user resource data stored in memory) and sends the real-time data of Resource A to the GameIDIPsvr.
[0078] f. The GameIDIPsvr queries the user's RoleInDB from the TcaplusDB database to obtain the data of the user's RoleInDB table.
[0079] g. The GameIDIPsvr reads the field of Resource A in the user's RoleINDB table data to obtain the real-time data of Resource A.
[0080] h. The GameIDIPsvr sends a response message (query result) of the request to query the user's resource quantity to the server of the H5 mini-game, and sends the real-time data of the user's Resource A to the server of the H5 mini-game.
[0081] i. After processing the data of the user's Resource A, the server of the H5 mini-game returns the processed query result to the client.
[0082] Since the types of virtual resources in online games can change continuously, there is a mapping relationship between the current IDIP interface and the resource types. Whenever the virtual resource types of online games change, it is necessary to re-develop the IDIP interface to query and update the changed virtual resource types. The development of these IDIP interfaces takes a lot of time and the energy of R & D personnel, and also occupies a large amount of storage space. How to efficiently call the virtual resource data of game users has become an urgent problem to be solved at present.
[0083] Based on the above problems, this application proposes that after obtaining the data processing request sent by the H5 mini-game, the target resource data of the preset user can be obtained according to the data processing request. Among them, the data processing request carries the identifier of the preset user and the identifier of the first resource type. The target resource data is the resource data of the preset user before obtaining the data request, and the target resource data includes the resource data of the first resource type. And process the target resource data according to the data processing request. The resource data of the preset user is obtained by looking up the identifier of the preset user carried in the data processing request, the data type of the resource data to be processed is determined by using the identifier of the first resource type, and the data processing of multiple resource types is performed through the IDIP port, realizing the efficient call of the virtual resource data of the user.
[0084] For easy understanding, please refer to Figure 2 , Figure 2 which is the application environment diagram of the data processing method in the embodiments of this application. As Figure 2 shown, the data processing method in the embodiments of this application is applied to a data processing system. The data processing system includes: a server and a terminal device; among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and this application embodiment does not make any restrictions here.
[0085] The server first obtains the data processing request sent by the H5 mini-game, and the data processing request carries the identifier of the preset user and the identifier of the first resource type;
[0086] Then, obtain the target resource data of the preset user according to the data processing request, where the target resource data is the resource data of the preset user before the data acquisition request, and the target resource data includes the resource data of the first resource type;
[0087] Finally, process the target resource data according to the data processing request.
[0088] Next, from the perspective of the server, the data processing method in this application will be introduced. When the H5 mini-game calls the user's resource data, it can perform queries and modifications. On this basis, according to the different data storage locations, the user's status is also divided into an online status and an offline status. The above several situations will be introduced separately below:
[0089] I. Query of user resource data;
[0090] First, introduce the process of querying user resource data proposed in this application, that is, when the data processing request includes a query request, please refer to Figure 3 , the data processing method provided in the embodiment of this application includes: step S110 to step S160. Specifically:
[0091] S110. Obtain the query request;
[0092] GameIDIPsvr obtains the query request, where the query request carries the identifier of the preset user and the identifier of the first resource type, and the query request is used to query the resource data of the first resource type of the preset user.
[0093] Exemplarily, the query request can be IDIPQueryPlayerPropertyReq, which is not limited here.
[0094] Specifically, the identifier of the first resource type can include the identifier of any resource type set by the technician through the interaction interface, and the query request can also include the identifier of the second resource type, which is not limited here.
[0095] In addition, the technician can maintain a list of correspondences between resource types and resource type identifiers in the storage space to help achieve data calls of multiple resource types through one IDIP interface. By carrying different resource type identifiers in the query request, efficient query of data of different resource types can be achieved.
[0096] It can be understood that the description of the identifier of the first resource type carried in the query request here is only an example. In actual applications, it should be set in combination with specific application scenarios, which is not limited here.
[0097] S120. Obtain the login status of the preset user according to the query request;
[0098] Since the identifiers of the preset users in the H5 mini-game server may be the same as or different from those in the game server, to distinguish the identifiers of the preset users in different scenarios, the identifier of the preset user includes a first user identifier and a second user identifier. The first user identifier is the identifier used to mark the preset user in the H5 mini-game server, and the second user identifier is the identifier used to mark the preset user in the game server.
[0099] Regarding that the identifier used by the user in the H5 mini-game server may be different from the identifier used by the user in the game server, a mapping relationship list of the first user identifier and the second user identifier can also be maintained in the game server, where the first user identifier is the identifier used to mark the preset user in the H5 mini-game server, and the second user identifier is the identifier used to mark the preset user in the game server.
[0100] Here, taking the game server storing the mapping relationship between the first user identifier and the second user identifier as an example, query the first user identifier carried in the query request to obtain the mapping relationship between the first user identifier and the second user identifier. Then query the second user identifier to obtain the login status of the preset user.
[0101] Specifically, the login status of the preset user is included in the role information of the preset user. The role information of the preset user can be the RoleinDB table, and the login status of the preset user can be the LoginZoneId field in the RoleinDB table, which is not limited here.
[0102] It can be understood that the description of the method for obtaining the login status of the preset user here is only an example. In actual applications, it should be set according to the specific application scenario, which is not limited here.
[0103] S130. Determine whether the preset user is online according to the login status of the preset user;
[0104] Exemplarily, when the login status of the preset user is the fourth identifier, the preset user is online; when the login status of the preset user is the third identifier, the preset user is offline; when the login status of the preset user is the first identifier, the resource data of the preset user cannot be updated. When the login status of the preset user is the fourth identifier, it is considered that the preset user is online; when the login status of the preset user is the first identifier or the third identifier, it is considered that the preset user is not online.
[0105] Specifically, in some possible cases, the fourth identifier is the identifier of the login server of the preset user, the third identifier is 0, and the first identifier is LOGINZONESVR_IDIP_PROPERTY_OPERATE, which is not limited here.
[0106] When the preset user is online, execute step S140;
[0107] When the preset user is not online, execute step S150.
[0108] S140. Obtain target resource data;
[0109] When the preset user is online, obtain the first resource data of the preset user, where the first resource data is the online resource data of the preset user when the query request is obtained, and the first resource data is the target resource data of the preset user.
[0110] S150. Update the first resource data according to the data modification record to obtain the target resource data;
[0111] When the preset user is not online, obtain the first resource data of the preset user and the data modification record, where the first resource data is the online resource data of the preset user when the query request is obtained; the data modification record is the modification record generated by modifying the resource data of the preset user before obtaining the query request in the case that the preset user is not online.
[0112] Update the first resource data according to the data modification record to obtain the target resource data, and the target resource data is the resource data of the preset user when the query request is obtained.
[0113] It should be noted that there is no clear sequence for obtaining the first resource data and obtaining the data modification record here. In actual applications, it should be set according to specific application scenarios and is not limited here.
[0114] S160. Send the target resource data.
[0115] GameIDIPsvr sends the target resource data to the H5 mini-game server.
[0116] In the embodiment of the present application, the method flow for querying the resource data of the preset user is introduced. By using the identifier of the preset user and the identifier of the first resource type carried in the query request, the data of the first resource type of the preset user in the game server can be called. There is no need to configure the IDIP port for each resource type separately. Through the correspondence between the IDIP port and the resource type and the identifier of the resource type, data calls of multiple resource types are performed, realizing efficient calls of the virtual resource data of the user.
[0117] In the Figure 3 corresponding optional embodiment of the data processing method provided in the embodiment of the present application, please refer to Figure 4 , step S140 may specifically include steps S141 to S144. Specifically:
[0118] S141. The GameIDIPsvr forwards the query request to the Zonesvr;
[0119] After the GameIDIPsvr receives the query request sent by the H5 mini-game server and determines that the preset user is in an online state, it forwards the query request to the zonesvr according to the identifier of the preset user carried in the query request, where the zonesvr is the server logged in by the preset user.
[0120] S142. The Zonesvr obtains the first resource data from the memory;
[0121] Among them, the memory stores the online resource data of the preset user. The first resource data is the online resource data of the preset user, and the first resource data includes the resource data of the first resource type.
[0122] S143. Calculate the target resource data according to the first resource data and the query request;
[0123] Since the first resource data is the online resource data of the preset user, the first resource data may also include the resource data of the second resource type. After the Zonesvr obtains the first resource data, it needs to calculate the target resource data according to the query request.
[0124] Exemplarily, when the query request carries the identifier of the first resource type, the Zonesvr calculates the data resource value of the first resource type in the first resource data to obtain the target resource data.
[0125] When the query request carries the identifier of the first resource type and the identifier of the second resource type, the Zonesvr calculates the data resource value of the first resource type and the resource value of the second resource type in the first resource data to obtain the target resource data.
[0126] It can be understood that the description here is for the query request carrying the identifier of the first resource type and the identifier of the second resource type. In specific application scenarios, the identifier of the resource type carried in the query request should be described in combination with the specific usage scenario, and no restrictions are made here.
[0127] S144. The Zonesvr sends the target resource data to the GameIDIPsvr.
[0128] The Zonesvr sends the calculated target resource data to the GameIDIPsvr.
[0129] In the embodiments of the present application, a method for obtaining target resource data when a preset user is online is introduced. When obtaining the resource data of the preset user, the resource data of one or more resource types can be obtained at one time according to requirements, which solves the problem that when a corresponding data interface is configured for each resource type, the data of multiple resource types cannot be called at one time, and improves the flexibility of the solution while also improving the operability of the solution.
[0130] In the Figure 3 corresponding embodiment of the data processing method provided in the present application, in an alternative embodiment, please refer to Figure 5 , step S150 may specifically include steps S151 to S157. Specifically:
[0131] S151. GameIDIPsvr queries the first resource data from TcaplusDB;
[0132] After GameIDIPsvr receives the query request sent by the H5 mini-game server and determines that the preset user is in an offline state, it queries the first resource data of the preset user from TcaplusDB according to the identifier of the preset user carried in the query request, where the first resource data of the preset user is stored in TcaplusDB.
[0133] S152. TcaplusDB queries the identifier of the preset user and obtains the first resource data;
[0134] Among them, the first resource data is the online resource data of the preset user, and the first resource data includes the resource data of the first resource type.
[0135] Exemplarily, the first resource data may be RoleInDB, which is not limited here.
[0136] S153. TcaplusDB sends the first resource data to GameIDIPsvr;
[0137] Optionally, after receiving the first resource data sent by TcaplusDB, GameIDIPsvr may perform simple processing on the first resource data according to the identifier of the first resource type to obtain the processed first resource data, and only the resource data of the first resource type is included in the processed first resource data.
[0138] It can be understood that the description of GameIDIPsvr processing the first resource data to obtain the processed first resource data here is only an example. In actual applications, the processing of the first resource data may also be performed in step S157, which is not limited here.
[0139] S154. The GameIDIPsvr queries the data modification records from the TcaplusDB;
[0140] Since the preset user is in an offline state, the GameIDIPsvr also needs to query the data modification records from the TcaplusDB. Among them, in the TcaplusDB, there are stored the modification records of the resource data of the preset user when the preset user is offline, that is, the data modification records.
[0141] S155. The TcaplusDB queries the identifier of the preset user and obtains the data modification records;
[0142] Among them, the data modification records are the records of modifying the resource data of the preset user when the preset user is offline, and the data modification records include the modification of the resource data of the first resource type.
[0143] Exemplarily, the data modification records can be PlayerPropertyOperateLogDB, which is not limited here.
[0144] S156. The TcaplusDB sends the data modification records to the GameIDIPsvr;
[0145] Optionally, after receiving the data modification records sent by the TcaplusDB, the GameIDIPsvr can simply process the data modification records according to the identifier of the first resource type to obtain the processed data modification records, and only the modification records of the first resource type are included in the processed data modification records.
[0146] It can be understood that the description here of the GameIDIPsvr processing the data modification records to obtain the processed data modification records is only an example. In actual applications, the processing of the data modification records can also be performed in step S157, which is not limited here.
[0147] S157. The GameIDIPsvr updates the first resource data according to the data modification records to obtain the target resource data.
[0148] The GameIDIPsvr processes the first resource data according to the identifier of the first resource type carried in the query request to obtain the processed first resource data, and the processed resource data is the resource data of the first resource type. And, according to the identifier of the first resource type, the data modification records are processed to obtain the processed data modification records, and the processed data modification records are the modification records of the first resource type.
[0149] Optionally, GameIDIPsvr may also process the first resource data and the data modification record in the foregoing steps S153 and S156 to obtain the processed first resource data and the processed data modification record. Here, GameIDIPsvr may update the processed first resource data according to the processed data modification record to obtain the target resource data, and the target resource data carries the resource data of the first resource category.
[0150] For example, taking the processed data modification record as "first resource type, value a, increase flag" and the processed first resource data as "first resource type, value b" as an example. GameIDIPsvr calculates the sum of value a and value b based on the processed data modification record and the processed first resource data to obtain value c, and the target resource data is "first resource type, value c".
[0151] In the embodiment of the present application, when querying the resource data of a preset user in the case that the preset user is offline, the first resource data and the data modification record are respectively obtained, and the target resource data is calculated according to the first resource data and the data modification record. Among them, the first resource data is the resource data when the preset user is online, the data modification record is the record of modifying the resource data of the preset user when the preset user is offline, and the first resource data includes the resource data of the first resource type, and the data modification record includes the data modification of the first resource type. When processing the query request, the record of modifying the resource data of the preset user when the preset user is offline is fully considered, which improves the accuracy of data management.
[0152] II. User resource data update;
[0153] Next, the process of updating the user data resource proposed in the present application will be introduced, that is, the case where the data processing request is an update request. Please refer to Figure 6 , the data processing method provided by the embodiment of the present application includes: steps S210 to S280. Specifically:
[0154] S210. Obtain an update request;
[0155] GameIDIPsvr obtains an update request, where the update request carries the identifier of the preset user, the identifier of the first resource type, and the first value, and the update request may also carry an increase flag or a decrease flag, and the update request is used to update the resource data of the first resource type of the preset user.
[0156] Exemplarily, the update request may be IDIPOperatePlayerPropertyReq, which is not limited here.
[0157] Specifically, the identifier of the first resource type may include the identifier of any resource type set by a technician through an interaction interface, and the update request may also include the identifier of the second resource type, which is not limited here.
[0158] In addition, a technician can maintain a list of correspondences between resource types and their identifiers in the storage space to help achieve data updates for multiple resource types through an IDIP interface. By carrying different resource type identifiers in the update request, efficient data updates for different resource types can be realized.
[0159] It can be understood that the description of the identifier of the first resource type carried in the update request here is only an example. In actual applications, it should be set according to specific application scenarios, which is not limited here.
[0160] S220. Obtain the login status of a preset user according to the update request;
[0161] Since the identifier of the preset user in the H5 mini-game server may be the same as or different from the identifier of the preset user in the game server, to distinguish the identifiers of the preset user in different scenarios, the identifier of the preset user includes a first user identifier and a second user identifier. The first user identifier is the identifier used to mark the preset user in the H5 mini-game server, and the second user identifier is the identifier used to mark the preset user in the game server.
[0162] Regarding the identifiers used by the user in the H5 mini-game server and the identifiers used by the user in the game server may be different, a mapping relationship list of the first user identifier and the second user identifier can also be maintained in the game server, where the first user identifier is the identifier used to mark the preset user in the H5 mini-game server, and the second user identifier is the identifier used to mark the preset user in the game server.
[0163] Here, taking the game server storing the mapping relationship between the first user identifier and the second user identifier as an example, query the first user identifier carried in the update request to obtain the mapping relationship between the first user identifier and the second user identifier. Then query the second user identifier to obtain the login status of the preset user.
[0164] Specifically, the login status of the preset user is included in the role information of the preset user. The role information of the preset user can be the RoleinDB table, and the login status of the preset user can be the LoginZoneId field in the RoleinDB table, which is not limited here.
[0165] Optionally, when the login status of the preset user is the fourth identifier, the preset user is online; when the login status of the preset user is the third identifier, the preset user is offline; when the login status of the preset user is the first identifier, the resource data of the preset user cannot be updated. When the login status of the preset user is the fourth identifier, the preset user is considered online; when the login status of the preset user is the first identifier or the third identifier, the preset user is considered offline.
[0166] Specifically, in some possible cases, the fourth identifier is the identifier of the login server of the preset user, the third identifier is 0, and the first identifier is LOGINZONESVR_IDIP_PROPERTY_OPERATE, which is not limited here.
[0167] It can be understood that the description of the method for obtaining the login status of the preset user and the specific content of the login status of the preset user here are only examples. In actual applications, it should be set according to the specific application scenario, which is not limited here.
[0168] S230. Determine whether the login status of the preset user is the first identifier;
[0169] Exemplarily, the first identifier can be LOGINZONESVR_IDIP_PROPERTY_OPERATE, which is not limited here.
[0170] If so, execute step S280;
[0171] If not, execute step S240.
[0172] S240. Determine whether the preset user is online;
[0173] When the login status of the preset user is not the first identifier, determine whether the preset user is online according to the login status of the preset user. If the login status of the preset user is not 0, the preset user is considered online; if the login status of the preset user is 0, the preset user is considered offline.
[0174] If online, execute step S250;
[0175] If not online, execute step S260.
[0176] S250. Process the update request to obtain the updated target resource data;
[0177] When the preset user is online, obtain the target resource data according to the identifier of the preset user carried in the update request. The target resource data is the resource data of the preset user when the update request is obtained, and the target resource data includes the resource data of the first resource type.
[0178] Update the target resource data according to the update request to obtain the updated target resource data.
[0179] S260. Process the update request to obtain the target modification record and the updated target resource data;
[0180] When the preset user is offline, obtain the target resource data according to the identifier of the preset user carried in the update request. The target resource data is the resource data of the preset user when the update request is obtained, and the target resource data includes the resource data of the first resource type.
[0181] Update the target resource data according to the update request to obtain the updated target resource data; when the updated target resource data meets the preset conditions, generate a target modification record, where the target modification record includes the modification of the resource data of the first resource type.
[0182] S270. Send the target modification record or the updated target resource data to the storage space;
[0183] When the status of the preset user is the online status, send the updated target resource data to the storage space;
[0184] When the status of the preset user is the offline status, send the target modification record to the storage space.
[0185] It can be understood that the description of the content sent to the storage space here is only an example. In actual applications, the target modification record and the updated target resource data can also be sent to the storage space simultaneously, which is not limited here.
[0186] S280. Send the updated target resource data or the update failure information.
[0187] GameIDIPsvr sends the updated target resource data or the update failure information to the H5 mini-game server.
[0188] When the judgment result of step S230 is that the login status of the preset user is not the first identifier, GameIDIPsvr sends the updated target resource data to the H5 mini-game server;
[0189] When the judgment result of step S230 is that the login status of the preset user is the first identifier, then GameIDIPsvr sends the update failure information to the H5 mini-game server.
[0190] In the embodiments of the present application, when modifying the resource data of a preset user, the modification of the resource data of the preset user is restricted by setting the login status of the preset user to a first identifier, effectively avoiding the data chaos caused by different sources of data simultaneously modifying the resource data of the preset user, and improving the reliability of the data.
[0191] In the Figure 6 corresponding embodiment of the data processing method provided by the present application, in an optional embodiment, please refer to Figure 7 , step S250 may specifically include steps S251 to S254. Specifically:
[0192] S251. GameIDIPsvr forwards the update request to Zonesvr;
[0193] After obtaining the update request sent by the H5 mini-game server and determining that the preset user is in an online state, GameIDIPsvr forwards the update request to zonesvr according to the identifier of the preset user carried in the update request, where zonesvr is the server logged in by the preset user.
[0194] Optionally, the update request may also carry the identifier of the second resource type, the second value, and the increase identifier or decrease identifier corresponding to the second value.
[0195] It can be understood that the description of the specific content carried in the update request here is only an example. In actual applications, it should be set according to the specific application scenario and is not limited here.
[0196] S252. Zonesvr obtains the target resource data from the memory;
[0197] Among them, the online resource data of the preset user is stored in the storage space. The target resource data is the online resource data of the preset user, and the target resource data includes the resource data of the first resource type.
[0198] S253. Zonesvr updates the target resource data according to the update request to obtain the updated target resource data;
[0199] After obtaining the target resource data, zonesvr needs to calculate the updated target resource data according to the update request.
[0200] Specifically, since the update request carries the identifier of the first resource type, the identifier of the preset user, the first value, and the increase identifier or decrease identifier.
[0201] Exemplarily, when the update request carries the identifier of a preset user, the identifier of a first resource type, a first value, and an increment identifier, zonesvr modifies the target resource data according to the update request to obtain the updated target resource data. Specifically, it can calculate the sum of a third value and the first value to obtain the updated target resource data. The third value is the value of the resource data of the first resource type in the target resource data.
[0202] When the update request carries the identifier of a preset user, the identifier of a first resource type, a first value, and a decrement identifier, zonesvr modifies the target resource data according to the update request to obtain the updated target resource data. Specifically, it can calculate the difference between a third value and the first value to obtain the updated target resource data. The third value is the value of the resource data of the first resource type in the target resource data.
[0203] Optionally, when the update request further carries the identifier of a second resource type, a second value, and an increment identifier or a decrement identifier corresponding to the second value, and there is a corresponding relationship between the identifier of the second resource type and the second value, the target resource data further includes data of the second resource type. Zonesvr modifying the target resource data according to the update request further includes: when the update request carries an increment identifier corresponding to the second value, the updated target resource data further includes the sum of the second value and a fourth value. The fourth value is the value of the resource data of the second resource type in the target resource data.
[0204] When the update request carries a decrement identifier corresponding to the second value, the updated target resource data further includes the difference between the fourth value and the second value. The fourth value is the value of the resource data of the second resource type in the target resource data.
[0205] It can be understood that the description of the method for processing the target resource data and the update request to obtain the updated target resource data here is only an example. In specific application scenarios, it should be set according to the specific usage scenario, and there is no limitation here.
[0206] S254. Zonesvr sends the updated target resource data or an update failure message to GameIDIPsvr.
[0207] When all the updated target resource data is greater than or equal to 0, Zonesvr sends the updated target resource data to GameIDIPsvr.
[0208] When the updated target resource data is less than 0, zonesvr sends an update failure message to GameIDIPsvr.
[0209] In the embodiments of the present application, a method for updating target resource data when a preset user is online is introduced. When obtaining the resource data of the preset user, the resource data of one or more resource types can be updated at one time according to requirements, which solves the problem that when a corresponding data interface is configured for each resource type, the data of multiple resource types cannot be updated at one time, improves the flexibility of the solution, and also improves the operability of the solution.
[0210] In the Figure 6 corresponding optional embodiment of the data processing method provided in the embodiment of the present application, please refer to Figure 8 , step S260 may specifically include steps S2601 to S2618. Specifically:
[0211] S2601. GameIDIPsvr sets the login status of the preset user to the first identifier in TcaplusDB;
[0212] When GameIDIPsvr modifies the resource data of the preset user, first, GameIDIPsvr sets the login status of the preset user to the first identifier in TcaplusDB to mark the resource data of the preset user as an unmodifiable state.
[0213] Exemplarily, the first identifier may be LOGINZONESVR_IDIP_PROPERTY_OPERATE, which is not limited here.
[0214] In the embodiments of the present application, when the login status of the preset user is different from the first identifier, the resource data of the preset user is updated, and the login status of the preset user is updated to the first identifier. By ensuring that the login status of the preset user is the first identifier when the preset user updates the resource data, it is restricted that when the preset user updates the resource data, other operations cannot be performed on the resource data of the preset user, avoiding the situation of conflicts in the processing of the resource data of the preset user, and improving the reliability of data processing.
[0215] S2602. TcaplusDB sends a login status setting success signal to GameIDIPsvr;
[0216] After Tcaplus updates the stored login status of the preset user to the first identifier, it sends a login status setting success signal of the preset user to GameIDIPsvr.
[0217] S2603. GameIDIPsvr sends an update identifier request to TcaplusDB;
[0218] Among them, the update identifier request is used to update the second identifier, and the second identifier is used to mark the data modification record.
[0219] S2604. TcaplusDB updates the second identifier to obtain the updated second identifier;
[0220] After TcaplusDB obtains the update identifier request, it updates the second identifier to obtain the updated second identifier.
[0221] Exemplarily, the second identifier can be PlayerPropertyOperateId, where OperateId is the operation sequence number of the IDIP instruction parameter and can uniquely identify an IDIP update request. The updated second identifier can be obtained by incrementing OperateId by 1, and there is no limitation here.
[0222] In the embodiments of the present application, after obtaining the second identifier, the second identifier is updated to obtain the updated second identifier, and the updated second identifier is added to the updated data modification record. When updating the resource data according to the updated data modification record, the second identifier can be used to determine whether the updated data modification record has been processed, avoiding repeated processing of the data modification record and improving the reliability of the solution.
[0223] S2605. TcaplusDB sends the updated second identifier to GameIDIPsvr;
[0224] Among them, the updated second identifier is used to help confirm whether the updated data modification record has been processed.
[0225] S2606. GameIDIPsvr queries the first resource data from TcaplusDB;
[0226] After GameIDIPsvr obtains the update request sent by the H5 mini-game server and determines that the preset user is in an offline state, it queries the online resource data of the preset user from TcaplusDB according to the identifier of the preset user carried in the update request, where the online resource data of the preset user is stored in TcaplusDB.
[0227] S2607. TcaplusDB queries the identifier of the preset user to obtain the first resource data;
[0228] Among them, the first resource data is the online resource data of the preset user, and the first resource data includes the resource data of the first resource type.
[0229] Exemplarily, the first resource data can be RoleInDB, and there is no limitation here.
[0230] S2608. TcaplusDB sends the first resource data to GameIDIPsvr;
[0231] Optionally, after receiving the first resource data sent by TcaplusDB, GameIDIPsvr can perform simple processing on the first resource data according to the identifier of the first resource type to obtain the processed first resource data, and the processed first resource data only contains the resource data of the first resource type.
[0232] It can be understood that the description of GameIDIPsvr processing the first resource data to obtain the processed first resource data here is only an example. In actual applications, the processing of the first resource data can also be performed in step S2612, which is not limited here.
[0233] S2609. GameIDIPsvr queries the data modification record from TcaplusDB;
[0234] Since the preset user is in an offline state, GameIDIPsvr also needs to query the data modification record of the preset user from TcaplusDB. Among them, in TcaplusDB, there are data records stored for modifying the resource data of the preset user when the preset user is offline.
[0235] S2610. TcaplusDB queries the identifier of the preset user to obtain the data modification record;
[0236] Among them, the data modification record is the record of modifying the resource data of the preset user in the offline situation of the preset user, and the data modification record includes the modification of the resource data of the first resource type.
[0237] Exemplarily, the data modification record can be PlayerPropertyOperateLogDB, which is not limited here.
[0238] S2611. TcaplusDB sends the data modification record to GameIDIPsvr;
[0239] Optionally, after receiving the data modification record sent by TcaplusDB, GameIDIPsvr can perform simple processing on the data modification record according to the identifier of the first resource type to obtain the processed data modification record, and the processed data modification record only contains the modification record of the first resource type.
[0240] It can be understood that the description of GameIDIPsvr processing the data modification record to obtain the processed data modification record here is only an example. In actual applications, the processing of the data modification record can also be performed in step S2612, and there is no limitation here.
[0241] S2612. GameIDIPsvr updates the first resource data according to the data modification record and the update request to obtain the updated target resource data;
[0242] GameIDIPsvr processes the first resource data according to the identifier of the first resource type carried in the query request to obtain the processed first resource data, and the processed resource data is the resource data of the first resource type. Moreover, according to the identifier of the first resource type, the data modification record is processed to obtain the processed data modification record, and the processed data modification record is the modification record of the first resource type.
[0243] Optionally, GameIDIPsvr can also process the first resource data and the data modification record in the foregoing steps S2608 and S2611 to obtain the processed first resource data and the processed data modification record. Here, GameIDIPsvr can directly calculate the processed first resource data and the processed data modification record, and there is no limitation here.
[0244] For example, taking the processed data modification record as "first resource type, value a, increment flag" and the processed first resource data as "first resource type, value b" as an example. GameIDIPsvr calculates the sum of value a and value b according to the processed data modification record and the processed first resource data to obtain value c, and the target resource data is "first resource type, value c". The update request is "first resource type, first value, increment flag", and the updated target resource data obtained by updating the target resource data according to the update request is "first resource type, value d", where value d is the sum of the first value and value c.
[0245] S2613. GameIDIPsvr determines whether the updated target resource data meets the preset conditions;
[0246] When all the values in the target resource data are positive or 0, the target resource data meets the preset conditions;
[0247] When there are negative values in the target resource data, the target resource data does not meet the preset conditions.
[0248] If it meets the conditions, GameIDIPsvr executes step S2614;
[0249] If it does not meet the conditions, GameIDIPsvr generates an update failure message.
[0250] S2614. GameIDIPsvr generates a target modification record;
[0251] If the updated target resource data meets the preset conditions, GameIDIPsvr generates a target modification record according to the update request, the current time, and the updated second identifier.
[0252] Exemplarily, the target modification record can be PlayerPropertyOperateRecord, which is not limited here.
[0253] S2615. GameIDIPsvr sends the target modification record to TcaplusDB;
[0254] After receiving the target modification record sent by GameIDIPsvr, TcaplusDB adds the target modification record to the data modification record to obtain the updated data modification record.
[0255] Optionally, the updated second identifier can be carried in the updated data modification record.
[0256] S2616. TcaplusDB sends a signal of successful update to GameIDIPsvr;
[0257] After Tcaplus adds the target modification record to the data modification record to obtain the updated data modification record, it sends a signal of successful update to GameIDIPsvr.
[0258] S2617. GameIDIPsvr sets the login status of the preset user to the third identifier in TcaplusDB;
[0259] After completing the update of the data modification record and receiving the signal of successful update, GameIDIPsvr sets the login status of the preset user to 0 to release the resource data of the preset user to a modifiable state.
[0260] It can be understood that the description of the login status being 0 here is only an example. In actual applications, it can be set according to the actual application scenario and specific requirements, which is not limited here.
[0261] S2618. TcaplusDB sends a signal of successful login status setting to GameIDIPsvr.
[0262] After Tcaplus updates the login status of the stored preset user to 0, it sends a signal of successful login status setting to GameIDIPsvr.
[0263] It should be noted that steps S2601, S2602, S2603, S2604, S2617, and S2618 are optional operations. Among them, steps S2601, S2602, S2617, and S2618 appear simultaneously, and steps S2603 and S2604 appear simultaneously.
[0264] Specifically, when steps S2603 and S2604 are not executed, when generating the target modification record in step S2614, GameIDIP generates the target modification record according to the update request and the current time.
[0265] In the embodiment of the present application, when updating the resource data of a preset user in the case that the preset user is not online, the first resource data and the data modification record are respectively obtained, the target resource data is calculated according to the first resource data and the data modification record, and then the target resource data is updated using the update request to obtain the updated target resource data. Each time an update is performed, it is determined whether the updated target resource data meets the preset conditions. When the target resource data meets the preset conditions, a target modification record is generated, and when the target resource data does not meet the preset conditions, an update failure message is generated. This avoids the situation where the resource data of the preset user does not meet the preset conditions, resulting in the subsequent tasks being unable to be executed normally, and improves the reliability of the solution.
[0266] III. Update of resource data when the user logs in.
[0267] Finally, the process of logging in by a preset user proposed in the present application is introduced, that is, the case where the data processing request is a login request. Please refer to Figure 9 , the data processing method provided by the embodiment of the present application includes: steps S301 to S314. Specifically:
[0268] S301. Zonesvr obtains the login request;
[0269] Among them, the login request carries the identifier of the preset user.
[0270] S302. Zonesvr queries the role information of the preset user from TcaplusDB according to the identifier of the preset user;
[0271] Exemplarily, the login status of the preset user is included in the role information of the preset user. The role information of the preset user can be the RoleinDB table, and the login status of the preset user can be the LoginZoneId field in the RoleinDB table. There is no limitation here.
[0272] Optionally, the login status of the preset user can be 0, the server identifier logged in by the preset user, or the first identifier. Among them, when the login status of the preset user is 0, the preset user is in an offline state; when the login status of the preset user is the server identifier logged in by the preset user, the preset user is in an online state; when the login status of the preset user is the first identifier, the resource information of the preset user is in an unmodifiable state.
[0273] It can be understood that the method for obtaining the login status of the preset user and the description of the specific content of the login status of the preset user here are only examples. In actual applications, it should be set according to the specific application scenario, and no restrictions are imposed here.
[0274] S303. TcaplusDB sends the role information of the preset user to zonesvr;
[0275] S304. zonesvr determines whether the login status of the preset user meets the login conditions;
[0276] Exemplarily, it is determined whether the login status of the user meets the login conditions according to the LoginZoneId field. When the LoginZoneId is not the first identifier, the login status of the preset user meets the login conditions;
[0277] When the LoginZoneId is the first identifier and the writing of the LoginZoneId has timed out, the login status of the preset user meets the login conditions.
[0278] When the LoginZoneId is the first identifier and the writing of the LoginZoneId has not timed out, the login status of the preset user does not meet the login conditions.
[0279] Among them, the first identifier can be LOGINZONESVR_IDIP_PROPERTY_OPERATE, and no restrictions are imposed here.
[0280] If so, execute step S305;
[0281] If not, zonesvr generates a login failure signal.
[0282] S305. Zonesvr updates the login status of the preset user to the fourth identifier in TcaplusDB;
[0283] After receiving the update of the login status of the preset user to the fourth identifier sent by Zonesvr, TcaplusDB updates the login status of the preset user to the identifier of Zonesvr.
[0284] S306. TcaplusDB sends a signal indicating that the login status setting of the preset user is successful to zonesvr;
[0285] After Tcaplus updates the login status of the stored preset user to the first identifier, it sends a signal indicating successful login status setting to zonesvr.
[0286] S307. Zonesvr loads the first resource data into the memory according to the role information of the preset user;
[0287] Among them, the first resource data is the online resource data of the preset user, and the first resource data includes resource data of at least one resource type. Here, it is taken as an example that the first resource data includes resource data of the first resource type. In actual applications, it should be subject to specific circumstances and is not limited here.
[0288] S308. Zonesvr queries the data modification record of the preset user from TcaplusDB;
[0289] Since the preset user is in the logged-in state, Zonesvr also needs to query the data modification record of the preset user from TcaplusDB. Among them, in TcaplusDB, there is a record of modifying the resource data of the preset user when the preset user is offline.
[0290] S309. TcaplusDB queries the identifier of the preset user to obtain the updated data modification record;
[0291] Among them, the data modification record is the record of modifying the resource data of the preset user when the preset user is not online. The updated data modification record carries the target modification record and the updated second identifier.
[0292] Exemplarily, the data modification record can be PlayerPropertyOperateLogDB, which is not limited here.
[0293] S310. TcaplusDB sends the updated data modification record to Zonesvr;
[0294] S311. Zonesvr updates the first resource data according to the updated data modification record to obtain the updated target resource data;
[0295] Zonesvr traverses the record data in the updated data modification record in sequence, and judges whether the updated data modification record has been executed according to the updated second identifier carried in the updated data modification record. If the updated data modification record has not been executed, the data records in the updated data modification record are executed in sequence.
[0296] Specifically, taking the data record as Record, the updated data modification record as the PlayerPropertyOperateLog list, and the updated second identifier carried in the updated data modification record, with the updated second identifier being PlayerPropertyTicket data as an example, when Record.OperateId.OpreateId > PlayerPropertyTicket.OpreateId, the data record has not been executed. The asset data of the preset user in the memory is modified according to the data record in sequence, and PlayerPropertyTicket.OpreateId = Record.OperateId.OpreateId is updated.
[0297] S312. Zonesvr sends a data modification record reset request to TcaplusDB;
[0298] After Zonesvr resets the data modification record, it sends a data modification record reset request to TcaplusDB to achieve the synchronization of the data modification record.
[0299] S313. TcaplusDB sends a reset success signal to Zonesvr;
[0300] After TcaplusDB successfully resets the data modification record, it sends a reset success signal to Zonesvr.
[0301] S314. Zonesvr generates a preset user login success signal.
[0302] After Zonesvr completes the update of the resource data of the preset user, it generates a user login success signal and marks the preset user as logged in successfully.
[0303] In the embodiments of the present application, by adding a second identifier to the data modification record of the preset user, the second identifier is used to determine whether the data modification record is updated, avoiding the situation of updating the same data modification record multiple times during the update, or the situation of missing the update of a certain data modification record, and improving the reliability of the solution.
[0304] The method proposed in the present application has been introduced above. Next, the data structure provided by the present application will be introduced in combination with specific application scenarios:
[0305] Please refer to Figure 10 , after the preset user enters the activity interface of the client, the client displays multiple activity options through the interaction interface. After some activities are clicked, they will jump to the interaction interface provided by the H5 mini-game server, such as Figure 11As shown, a preset user can participate in the exchange of resources in the interaction interface provided by the H5 mini-game server. After the preset user selects the prize to be exchanged, the interaction interface provided by the H5 mini-game server displays a prize exchange confirmation interface, such as Figure 12a After the preset user confirms and clicks to exchange the prize on the prize exchange confirmation interface, there will be a situation as Figure 12b shown in the prize exchange success interface.
[0306] After the preset user enters the interface provided by the H5 mini-game server through the client, if the stay time is too long, the login status of the preset user on the client will become invalid. At this time, when performing prize exchange on the interface provided by the H5 mini-game server, the increase and decrease of the resources of the preset user are both operations in the offline state of the preset user. To avoid deviations in the increase and decrease of the resource data in the offline state of the user, the method in Figure 5 or Figure 8 is executed to call or modify the resource data of the preset user.
[0307] The IDIP protocol (IDIPQueryPlaygerProperty) for querying user asset data and the IDIP protocol (IDIPOperatePlayerProperty) for updating user asset data provided in this application have data structures as Figure 13 shown:
[0308] The implementation of the IDIP protocol (IDIPQueryPlaygerProperty) for querying user asset data requires: the identifier of the user resource type (PlayerPropertyKey), the value of the user resource (PlayerPropertyValue), the entry of the user resource data (PlayerPropertyEntry), the list of user resource type identifiers (PlayerPropertyQuery), the list of user resource data entries (PlayerPropertyResult), the IDIP request protocol for querying user resource data (IDIPQueryPlayerPropertyReq), and the IDIP recovery protocol for querying user resource data (IDIPQueryPlayerPropertyRsp).
[0309] IDIPQueryPlayerPropertyReq, similar to the query request introduced in the foregoing solution, carries the identifier of the user (OpenId) and the list of user resource types (Query). OpenId is the unique identity identifier of the user in this game, and Query is the list of user resource types queried in the query request, which may include the identifier of the first resource type.
[0310] According to IDIPQueryPlayerPropertyReq, PlayerPropertyQuery can be obtained to specify the resource type to be queried.
[0311] According to PlayerPropertyQuery, PlayerPropertyKey can be obtained. The field Key in PlayerPropertyKey is used to uniquely identify a certain resource type in this game.
[0312] And in PlayerPropertyValue, the value corresponding to a certain resource type owned by the user can be found. The field Value in PlayerPropertyValue is used to represent the value of the user's ownership of a certain resource type.
[0313] According to PlayerPropertyKey and PlayerPropertyValue, PlayerPropertyEntry can be generated. PlayerPropertyEntry carries the identifier and value of the resource type.
[0314] According to PlayerPropertyEntry, PlayerPropertyResult can be obtained. PlayerPropertyResult is used to return the data result of querying the user's resources.
[0315] Finally, the query result is fed back through IDIPQueryPlayerPropertyRsp. Among them, Ret is the direct result status value of the instruction. For example, 0 or 1. When 0 indicates execution failure, Msg can also be used as the description information of the instruction execution status to describe the specific reason for the execution failure. Result is the result data of querying the player's assets, that is, the content in PlayerPropertyResult.
[0316] The implementation of the IDIP protocol (IDIPOperatePlayerProperty) for updating user asset data requires the use of: the operation type for updating user resources (EnumPropertyOperateType), the operation unit for updating user resources (PlayerPropertyOperate), the operation list for updating user resources (PlayerPropertyOperateList), the IDIP request protocol for updating user resource data (IDIPOperatePlayerPropertyReq), and the IDIP response protocol for updating user resource data (IDIPOperatePlayerPropertyRsp).
[0317] IDIPOperatePlayerPropertyReq, similar to the update request in the foregoing solution, carries the user's identifier (OpenId) and update identifier (OperateSerial). Among them, OpenId is the unique identity identifier of the user in this game, OperateSerial is the identification serial number of the update request, and Operate is the operation list for updating the user's resources.
[0318] According to IDIPOperatePlayerPropertyReq, obtain PlayerPropertyOperateList, which includes modifications of at least one resource type.
[0319] Through PlayerPropertyOperateList, obtain PlayerPropertyOperate. Among them, Key is used to represent the user's asset type, such as the identifier of the first resource type mentioned in the foregoing solution; OperateType is used to represent the operation type. For example, the addition identifier or subtraction identifier mentioned in the foregoing solution; OperateParam represents the value of the operation. For example, the first value and the second value mentioned in the foregoing solution.
[0320] Generate PlayerPropertyEntry according to PlayerPropertyOperate in combination with PlayerPropertyKey and PlayerPropertyValue, so as to obtain PlayerPropertyResult.
[0321] Finally, according to PlayerPropertyResult, obtain IDIPOperatePlayerPropertyRsp, and feedback the update result through IDIPOperatePlayerPropertyRsp. Among them, Ret is the direct result status value of the instruction. For example, 0 or 1. When 0 indicates execution failure, Msg can also be used as the instruction execution status description information to describe the specific reason for the execution failure. OperateSerial is the unique identification serial number of the update operation request, and result is the result data of the player's assets after the update, that is, the content in PlayerPropertyResult.
[0322] In addition, when the user is offline, the data structure involved in the update of the database table (PlayerPropertyOperateLogDB) used to store the resource updates executed when the user is offline is as Figure 14As shown in the figure, it includes: the resource update record table (PlayerPropertyOperateLogDB) executed when the user is offline, the user offline resource update record table (PlayerPropertyOpeateLog), the user offline resource update record (PlayerPropertyOperateRecord), and the user offline resource update record (PlayerPropertyOperateId).
[0323] PlayerPropertyOperateLogDB is similar to the data update record introduced in the foregoing solution. After the user logs in, the RoleInDB data of the user is updated according to the data in this table, and the user resource data is updated according to the update instruction. Among them, Uin is the unique identifier of the user in this game; CreateTime is the data creation time; UpdateTime is the data update time; Log is the list of user offline resource update records stored.
[0324] PlayerPropertyOperateRecord records the IDIP update resource request data executed during a user's offline state. Among them, OperateId is the identification data of this update instruction, and Operate is the list of operations for updating the user's resources.
[0325] PlayerPropertyOperateId, where OperateSerial is the operation serial number in the IDIP instruction parameter, identifying an IDIP update request; OpreateId is an auto-incrementing unique id generated by the game service for this record to prevent players from repeatedly processing records in case of exceptions; OpreateTime is the timestamp for executing the update instruction.
[0326] On this basis, in order to ensure that there will be no repeated processing of user resources during the update process, a data structure as shown in Figure 15 is added in both the user offline state and the user logged-in state, including: before the resource update in the user offline state, the LoginZoneID in the user's RoleInDB is marked as LOGINZONESVR_IDIP_PROPERTY_OPERATE (the first identifier in the foregoing solution). Among them, when the user is in the online state, the LoginZoneID of the user is the identifier of the Zonesvr where the user logs in; when the user is in the offline state, the LoginZoneID of the user is 0; when the user is in the offline state and during the asset data update, the LoginZoneID of the user is LOGINZONESVR_IDIP_PROPERTY_OPERATE.
[0327] When the user is logged in and the resource data is updated according to the data in PlayerPropertyOpeateLogDB, PlayerPropertyOpeateLog will be reset and written back to the DB. If the write message is lost, when the user logs in next time, the update record will be processed repeatedly, resulting in data errors. Therefore, by using the function of the IDCreateDB database table to generate a unique identifier through auto-increment, an identifier for updating the record (ID_CREATE_TYPE_PROPERTY_OPERATE_ID), which is the second identifier in the foregoing solution, is added to the operation type of updating the user's resources. And PlayerPropertyTicket is added to the Role data to record the latest processed record data. In PlayerPropertyTicket, OperateId and OperateTime are carried to mark the identifier of the updated record and the update time.
[0328] The method for data processing provided in this application has been introduced above. Next, the apparatus for data processing provided in this application will be introduced with reference to the accompanying drawings. Please refer to Figure 16 , the apparatus 10 for data processing includes:
[0329] An obtaining unit 110, configured to obtain a data processing request, where the data processing request carries an identifier of a preset user and an identifier of a first resource type;
[0330] The obtaining unit 110 is further configured to obtain the target resource data of the preset user according to the data processing request, where the target resource data is the resource data of the preset user before obtaining the data processing request, and the target resource data includes the resource data of the first resource type;
[0331] A processing unit 120, configured to process the target resource data according to the data processing request.
[0332] In the embodiment of this application, by using the identifier of the preset user and the identifier of the first resource type carried in the data processing request, the data of the first resource type of the preset user in the game server is called. There is no need to configure the IDIP port for each resource type separately. Through the correspondence between the identifier of the resource type and the resource data of the resource type, the data of multiple resource types is called, and efficient calling of the user's resource data is realized.
[0333] Optionally, the login state of the preset user is a third identifier, and the third identifier indicates that the preset user is in an offline state;
[0334] The obtaining unit 110 is specifically configured to:
[0335] Obtain the first resource data of a preset user, where the first resource data is the resource data when the preset user is online, and the first resource data includes the resource data of the first resource type;
[0336] Obtain the data modification record of the preset user. The data modification record is the record of modifying the resource data of the preset user before obtaining the data processing request. The data modification record includes the modification of the resource data of the first resource type;
[0337] Update the first resource data according to the data modification record to obtain the target resource data.
[0338] In the embodiments of the present application, when processing the target resource data in the case where the preset user is offline, the first resource data and the data modification record are respectively obtained, and the target resource data is calculated according to the first resource data and the data modification record. Among them, the first resource data is the resource data when the preset user is online, the data modification record is the record of modifying the resource data of the preset user when the preset user is offline, and the target resource data is the resource data of the preset user when the data processing request is obtained. And the first resource data includes the resource data of the first resource type, and the data modification record includes the data modification of the first resource type. When processing the query request, the record of modifying the resource data of the preset user when the preset user is offline is fully considered, which improves the accuracy of data management.
[0339] Optionally, the data processing request includes an update request. The update request carries a first value, and there is a corresponding relationship between the first value and the identifier of the first resource type. The update request also carries an increase identifier or a decrease identifier;
[0340] The processing unit 120 is specifically configured to:
[0341] Update the target resource data according to the first value to obtain the updated target resource data;
[0342] When the updated target resource data meets the preset conditions, generate a target modification record. The target modification record carries the first value, the identifier of the first resource type, and the corresponding relationship between the first value and the identifier of the first resource type;
[0343] Send the target modification record to the storage space.
[0344] In an embodiment of the present application, when updating the resource data of a preset user in the case that the preset user is offline, the first resource data and the data modification record are respectively obtained, the target resource data is calculated according to the first resource data and the data modification record, and then the target resource data is updated by using an update request to obtain the updated target resource data. Each time an update is performed, it is determined whether the updated target resource data meets a preset condition. When the target resource data meets the preset condition, a target modification record is generated, and when the target resource data does not meet the preset condition, an update failure message is generated. This avoids the situation where the resource data of the preset user does not meet the preset condition, resulting in the subsequent tasks being unable to be executed normally, and improves the reliability of the solution.
[0345] In an Figure 16 alternative embodiment of the data processing device provided in the corresponding embodiment of the present application, please refer to Figure 17 , the device further includes an update unit 130, configured to update the login status of the preset user to a first identifier, and the first identifier indicates that the resource data of the preset user cannot be updated.
[0346] In an embodiment of the present application, when modifying the resource data of a preset user, the modification of the resource data of the preset user is restricted by setting the login status of the preset user to the first identifier, effectively avoiding the situation of data chaos caused by different sources of data simultaneously modifying the resource data of the preset user, and improving the reliability of the data.
[0347] Optionally, the obtaining unit 110 is further configured to obtain the login status of the preset user;
[0348] The update unit 130 is specifically configured to update the login status of the preset user to the first identifier when the login status of the preset user is different from the first identifier.
[0349] In an embodiment of the present application, when the login status of the preset user is different from the first identifier, the resource data of the preset user is updated, and the login status of the preset user is updated to the first identifier. By ensuring that the login status of the preset user is the first identifier when the preset user updates the resource data, so as to restrict that when the preset user updates the resource data, other operations cannot be performed on the resource data of the preset user, avoiding the situation of conflicts in the processing of the resource data of the preset user, and improving the reliability of the data processing.
[0350] Optionally, the obtaining unit 110 is further configured to obtain a second identifier, and the second identifier is used to mark the asset data of the preset user, and the second identifier is included in the update request;
[0351] The update unit 130 is further configured to update the second identifier to obtain the updated second identifier;
[0352] The update unit 130 is further configured to update the data modification record according to the target modification record to obtain an updated data modification record, and the updated data modification record includes an updated second identifier.
[0353] In the embodiment of the present application, after obtaining the second identifier, the second identifier is updated to obtain an updated second identifier, and the updated second identifier is added to the updated data modification record. When updating the resource data according to the updated data modification record, the second identifier can be used to determine whether the updated data modification record has been processed, so as to avoid repeated processing of the data modification record and improve the reliability of the solution.
[0354] Optionally, when the login status of the preset user is switched from the third identifier to the logged-in status, the update unit is further configured to update the login status of the preset user to the fourth identifier when the login status of the preset user meets the login condition, and the fourth identifier is the identifier of the login server of the preset user;
[0355] The acquisition unit 110 is further configured to acquire the first resource data and the updated data modification record;
[0356] The processing unit 120 is further configured to determine that the updated data modification record is a modification record to be updated according to the updated second identifier;
[0357] The update unit 130 is further configured to update the first resource data according to the updated data modification record to obtain an updated target resource data.
[0358] In the embodiment of the present application, by adding a second identifier to each data record in the data modification record of the preset user, the second identifier is used to determine whether the data record is updated, so as to avoid the situation that the same data record is updated multiple times during the update, or the situation that a certain data record is missed in the update, and improve the reliability of the solution.
[0359] Figure 18FIG. 0 is a schematic structural diagram of a server provided by an embodiment of the present application. The server 300 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 322 (for example, one or more processors) and a memory 332, and one or more storage media 330 (for example, one or more mass storage devices) for storing application programs 342 or data 344. Among them, the memory 332 and the storage media 330 may be transient storage or persistent storage. The programs stored in the storage media 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processing unit 322 may be configured to communicate with the storage media 330 and execute a series of instruction operations in the storage media 330 on the server 300.
[0360] The server 300 may further include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.
[0361] The steps performed by the server in the above embodiments may be based on the Figure 18 server structure shown.
[0362] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above may refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0363] The user terminal includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including, but not limited to, cloud technology, artificial intelligence, intelligent transportation, assisted driving, etc.
[0364] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. 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 displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0365] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0366] In addition, each functional unit in various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0367] 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 such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0368] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of that module or unit.
[0369] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for data processing, characterized in that, Including: Obtain a data processing request, where the data processing request carries an identifier of a preset user and an identifier of a first resource type; Obtain the target resource data of the preset user according to the data processing request, where the target resource data is the resource data of the preset user before obtaining the data processing request, and the target resource data includes the resource data of the first resource type; Process the target resource data according to the data processing request.
2. The method according to claim 1, characterized in that, The login status of the preset user is a third identifier, and the third identifier indicates that the preset user is in an offline state; The obtaining the target resource data of the preset user according to the data processing request includes: Obtain the first resource data of the preset user, where the first resource data is the resource data of the preset user when online, and the first resource data includes the resource data of the first resource type; Obtain the data modification record of the preset user, where the data modification record is the record of modifying the resource data of the preset user before obtaining the data processing request, and the data modification record includes the modification of the resource data of the first resource type; Update the first resource data according to the data modification record to obtain the target resource data.
3. The method according to claim 2, wherein The data processing request includes an update request, the update request carries a first value and there is a corresponding relationship between the first value and the identifier of the first resource type, and the update request also carries an increase identifier or a decrease identifier; The processing the target resource data according to the data processing request includes: Update the target resource data according to the first value to obtain the updated target resource data; When the updated target resource data meets a preset condition, generate a target modification record, where the target modification record carries the first value, the identifier of the first resource type, and the corresponding relationship between the first value and the identifier of the first resource type; Send the target modification record to the storage space.
4. The method according to claim 3, characterized in that, Before obtaining the first resource data of the preset user, the method further includes: Update the login status of the preset user to a first identifier, and the first identifier indicates that the resource data of the preset user cannot be updated.
5. The method according to claim 4, wherein Before updating the login status of the preset user to the first identifier, the method further includes: Obtain the login status of the preset user; The updating the login status of the preset user to the first identifier includes: When the login status of the preset user is different from the first identifier, update the login status of the preset user to the first identifier.
6. The method according to claim 3, wherein The method further includes: Obtain a second identifier, where the second identifier is used to mark the asset data of the preset user, and the second identifier is included in the update request; Update the second identifier to obtain the updated second identifier; Update the data modification record according to the target modification record to obtain the updated data modification record, and the updated data modification record includes the updated second identifier.
7. The method according to claim 6, wherein When the login status of the preset user switches from the third identifier to the login status, the method further includes: When the login status of the preset user meets the login condition, update the login status of the preset user to a fourth identifier, where the fourth identifier is the identifier of the login server of the preset user; Obtain the first resource data and the updated data modification record; Determine the updated data modification record as the modification record to be updated according to the updated second identifier; Update the first resource data according to the updated data modification record to obtain the updated target resource data.
8. A data processing device, characterized in that, Includes: An obtaining unit, configured to obtain a data processing request, where the data processing request carries an identifier of a preset user and an identifier of a first resource type; The obtaining unit is further configured to obtain the target resource data of the preset user according to the data processing request, where the target resource data is the resource data of the preset user before obtaining the data processing request, and the target resource data includes the resource data of the first resource type; A processing unit, configured to process the target resource data according to the data processing request.
9. A computer device, characterized in that, Includes: A memory, a transceiver, a processor, and a bus system; Wherein, the memory is used to store programs; The processor is configured to execute the programs in the memory, including executing the data processing method according to any one of claims 1 to 7; The bus system is used to connect the memory and the processor, so that the memory and the processor can communicate.
10. A computer-readable storage medium, including instructions, which when running on a computer, cause the computer to execute the data processing method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, The computer program is executed by the processor to execute the data processing method according to any one of claims 1 to 7.