Data synchronization method and device, storage medium and electronic equipment
By obtaining the interactive data of multiple accounts in virtual games and synchronous processing, the problem of low consistency of account interaction data in virtual games is solved, and data consistency and timely synchronization are achieved.
Patent Information
- Application Number
- CN202311283956.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
Smart Images

Figure CN119701378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular, to a data synchronization method, device, storage medium and electronic device. Background Art
[0002] Account interaction data in virtual games should usually be consistent, but because account interaction data is often recorded by multiple accounts separately, there may be inconsistencies in account interaction data. Therefore, there is a problem of low consistency in account interaction data.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a data synchronization method, device, storage medium and electronic device to at least solve the technical problem of low consistency of account interaction data.
[0005] According to one aspect of an embodiment of the present application, a data synchronization method is provided, comprising: obtaining account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account; in response to an interaction request triggered by the first account to the second account, obtaining second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account; and synchronizing the first interaction data based on the second interaction data.
[0006] According to another aspect of an embodiment of the present application, a data synchronization device is further provided, including: a first acquisition unit, used to acquire account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account; a second acquisition unit, used to acquire second interaction data of the second account in the virtual game in response to an interaction request triggered by the first account to the second account, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account; and a synchronization unit, used to synchronize the first interaction data based on the second interaction data.
[0007] As an optional solution, the above-mentioned second acquisition unit includes at least one of the following: a first acquisition module, used to obtain the target interaction attribute of the above-mentioned second account in the above-mentioned virtual game, wherein the above-mentioned target interaction attribute is the attribute value recorded by the above-mentioned second account that changes with the occurrence of the first interaction behavior between the above-mentioned first account and the second account, and the above-mentioned second interaction data includes data corresponding to the above-mentioned target interaction attribute; a second acquisition module, used to obtain the target interaction relationship of the above-mentioned second account in the above-mentioned virtual game, wherein the above-mentioned target interaction relationship is the interaction relationship established between the above-mentioned first account and the second account as the second interaction behavior occurs, recorded by the above-mentioned second account, and the above-mentioned second interaction data includes data corresponding to the above-mentioned target interaction relationship.
[0008] As an optional scheme, the above-mentioned synchronization unit includes: an update module, which is used to synchronously update the above-mentioned first attribute value to the above-mentioned second attribute value when the original interaction attribute and the above-mentioned target interaction attribute are obtained and the first attribute value corresponding to the above-mentioned original interaction attribute is less than the second attribute value corresponding to the above-mentioned target interaction attribute, wherein the above-mentioned original interaction attribute is the attribute value between the above-mentioned first account and the second account recorded in the above-mentioned first account and changes with the occurrence of the above-mentioned first interaction behavior; or, a first new addition module, which is used to synchronously add the above-mentioned target interaction attribute to the interaction attribute recorded by the above-mentioned first account when the above-mentioned target interaction attribute is obtained but the above-mentioned original interaction attribute is not obtained.
[0009] As an optional solution, the above-mentioned device also includes: a second adding module, which is used to synchronously add the above-mentioned target interaction attributes as the interaction attributes recorded by the above-mentioned first account, when the above-mentioned target interaction relationship is obtained but the original interaction relationship is not obtained, and the above-mentioned target interaction relationship is synchronously added to the interaction relationship recorded by the above-mentioned first account, wherein the above-mentioned original interaction relationship is the interaction relationship established between the above-mentioned first account and the second account recorded by the above-mentioned first account as the second interaction behavior occurs, and the above-mentioned target interaction attributes are used to indicate the degree of intimacy of the above-mentioned target interaction relationship.
[0010] As an optional scheme, the above-mentioned synchronization unit includes: a third acquisition module, which is used to obtain the current relationship restriction condition of the above-mentioned first account when the above-mentioned target interaction relationship is obtained but the original interaction relationship is not obtained, wherein the above-mentioned original interaction relationship is the interaction relationship between the above-mentioned first account and the second account recorded by the above-mentioned first account and established as the second interaction behavior occurs, and the above-mentioned relationship restriction condition is used to limit the interaction relationship to be established by the above-mentioned first account; a fourth acquisition module, which is used to obtain data exception information when the above-mentioned target interaction relationship satisfies the above-mentioned relationship restriction condition, and send the above-mentioned data exception information to the client of the above-mentioned second account, wherein the above-mentioned data exception information is used to prompt the client of the above-mentioned second account to roll back the data corresponding to the above-mentioned target interaction relationship.
[0011] As an optional solution, the above-mentioned first acquisition unit includes: a first reading module, used to read the first data matching the first identity identifier of the above-mentioned first account from the target database, and use the above-mentioned first data as the above-mentioned account interaction data; the above-mentioned device also includes: a first determination module, used to use the interaction data that has changed in the above-mentioned account interaction data as dynamic interaction data after the above-mentioned account interaction data of the first account in the virtual game is obtained as the above-mentioned dynamic interaction data; a storage module, used to transmit the above-mentioned dynamic interaction data to the above-mentioned target database after the above-mentioned account interaction data of the first account in the virtual game is obtained, and store it according to the above-mentioned first identity identifier.
[0012] As an optional solution, the above-mentioned device also includes: an allocation module, which is used to allocate a dynamic label to the above-mentioned first interaction data when the above-mentioned first interaction data changes after the above-mentioned first interaction data is synchronously processed based on the above-mentioned second interaction data; and a second determination module, which is used to determine the interaction data carrying the above-mentioned dynamic label in the above-mentioned account interaction data as the above-mentioned dynamic interaction data after the above-mentioned first interaction data is synchronously processed based on the above-mentioned second interaction data.
[0013] As an optional solution, the second acquisition unit includes: a second reading module, used to read second data matching the second identity identifier of the second account from the target database, and use the second data as the second interaction data.
[0014] As an optional solution, the above-mentioned device also includes: a third acquisition unit, which is used to obtain the above-mentioned interaction request after obtaining the account interaction data of the first account in the virtual game, when the interaction operation performed by the above-mentioned first account on the above-mentioned second account is obtained and the above-mentioned second account is in an online state.
[0015] As an optional solution, the above-mentioned first acquisition unit includes: a fifth acquisition module, which is used to acquire the first target interaction data and the second target interaction data of the above-mentioned first account in the above-mentioned virtual game, wherein the above-mentioned first target interaction data is interaction data stored according to the interaction identifier between the accounts in the above-mentioned virtual game, and the above-mentioned second target interaction data is interaction data stored according to the identity identifier of the account in the above-mentioned virtual game, and the above-mentioned second target interaction data includes the above-mentioned first interaction data; the above-mentioned device also includes: a determination unit, which is used to determine the interaction data carrying the target interaction identifier from the above-mentioned first target interaction data in response to the target interaction request triggered by the above-mentioned first account to the above-mentioned second account after the account interaction data of the first account in the virtual game is acquired, wherein the above-mentioned target interaction identifier is used to indicate that interaction occurs between the above-mentioned first account and the above-mentioned second account.
[0016] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above data synchronization method.
[0017] According to another aspect of an embodiment of the present application, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the data synchronization method through the computer program.
[0018] In an embodiment of the present application, the account interaction data of the first account in the virtual game is obtained, wherein the account interaction data includes the first interaction data between the first account and the second account recorded by the first account; in response to the interaction request triggered by the first account to the second account, the second interaction data of the second account in the virtual game is obtained, wherein the second interaction data is the interaction data between the first account and the second account recorded by the second account; and the first interaction data is synchronized based on the second interaction data. After obtaining the account interaction data (first interaction data) recorded by the own account (first account), the account interaction data is not used directly, but the account interaction data (second interaction data) recorded by other accounts (second accounts) interacting with the own account is obtained, and the account interaction data recorded by the own account is synchronized, thereby achieving the purpose of timely synchronization of the account interaction data recorded by multiple accounts that interact, thereby achieving the technical effect of improving the consistency of the account interaction data, and thus solving the technical problem of low consistency of the account interaction data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 is a schematic diagram of an application environment of an optional data synchronization method according to an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a process of an optional data synchronization method according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of an optional data synchronization method according to an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0029] Fig.10 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0030] Fig.11 is a schematic diagram of another optional data synchronization method according to an embodiment of the present application;
[0031] Fig.12 is a schematic diagram of an optional data synchronization device according to an embodiment of the present application;
[0032] Fig.13 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] For ease of understanding, the following terms are explained:
[0036] Zonesvr: Provides player account login function, lobby service, and main business logic based on roles. It provides services in a clustered manner. After the player logs in, most of the key data is cached on Zonesvr. It is written back to the DB regularly. The current write-back frequency can be configured to be 1 to 5 minutes depending on the situation. Most of the client's requests are processed directly on the zoneserver, and the rest are passed to other servers through Zonesvr for further processing. Zoneid is the globally unique identifier of Zonesvr.
[0037] DB: DataBase is a warehouse that organizes, stores and manages data according to data structure.
[0038] TcaplusDB: Tencent's self-developed database, a distributed NoSQL database for games.
[0039] Tcaproxy: A proxy server for business access to DB data, which helps decouple business logic and DB access and improve the efficiency of DB access.
[0040] RoleInDB: Player role storage table, used to store player role data, including all basic player data, role property, game data, social data, etc.
[0041] RoleSimpleDataDB: Player brief data table, used to store player brief data. When the client requests a player's brief information, it will obtain the player's corresponding SimpleInfo from RoleSimpleDataDB.
[0042] Eventlog: A solution for asynchronous calculation based on stored player interaction data. It is a notification mechanism implemented in the game to complete weak player interactions, similar to the implementation of email. Asynchronous interaction events are stored in the DB in the form of EventLog and notified to the character. After receiving the notification, the character retrieves the EventLog from the DB and executes it. The main purpose is to serialize data operations and ensure data consistency.
[0043] According to one aspect of an embodiment of the present application, a data synchronization method is provided. Optionally, as an optional implementation, the data synchronization method may be applied to, but is not limited to, Figure 1 In the environment shown, the environment may include, but is not limited to, a user device 102 and a server 112 . The user device 102 may include, but is not limited to, a display 104 , a processor 106 , and a memory 108 . The server 112 includes a database 114 and a processing engine 116 .
[0044] The specific process can be as follows:
[0045] Step S102, the user device 102 obtains an interaction request triggered by the first account to the second account;
[0046] Steps S104-S106, sending the interaction request to the server 112 via the network 110;
[0047] Steps S108-S110, the server 112 obtains first interaction data of the first account in the virtual game and second interaction data of the second account in the virtual game from the database 114, and further performs synchronization processing on the first interaction data based on the second interaction data through the processing engine 116 to obtain a synchronization processing result, wherein the synchronization processing result may include interaction data obtained after the first interaction data is updated based on the second interaction data;
[0048] Steps S112 - S114 , sending the synchronization processing result to the user device 102 via the network 110 , the user device 102 displays the synchronization processing result on the display 104 via the processor 106 , and stores the synchronization processing result in the memory 108 .
[0049] remove Figure 1In addition to the examples shown, the above steps can be completed independently by the user device or the server, or by the user device and the server in collaboration, such as the user device 102 executing the above steps S108-S110, thereby reducing the processing pressure of the server 112. The user device 102 includes but is not limited to handheld devices (such as mobile phones), laptops, tablet computers, desktop computers, vehicle-mounted devices, smart TVs, etc., and the present application does not limit the specific implementation of the user device 102. The server 112 can be a single server or a server cluster consisting of multiple servers, or a cloud server.
[0050] Optionally, as an optional implementation, as Figure 2 As shown, the data synchronization method can be executed by an electronic device, such as Figure 1 The user device or server shown in the figure comprises:
[0051] S202, obtaining account interaction data of the first account in the virtual game, wherein the account interaction data includes first interaction data between the first account and the second account recorded by the first account;
[0052] S204, in response to an interaction request triggered by the first account to the second account, obtaining second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account;
[0053] S206: Synchronize the first interaction data based on the second interaction data.
[0054] Optionally, in this embodiment, the above data synchronization method can be applied to, but is not limited to, data processing scenarios of player social data. Player social data is usually data between two players, such as friend data, close relationship data, etc. Both parties will maintain relevant data with their friends, and their data should usually be consistent. Social data will be recorded in the players' respective databases. Since the data is stored in different players, there will be inconsistencies in player data. This embodiment proposes an efficient data synchronization method, which allows players to synchronize social data with each other in a timely manner during normal games to ensure the consistency of each other's data.
[0055] Optionally, in this embodiment, the first account can interact with other accounts in the virtual game in the virtual game, such as the first account interacting with other accounts in the virtual game through transactions, team formation, guilds, etc., and the account interaction data can be but is not limited to data generated during the interaction, such as game character information (including character name, level, equipment, skills, attributes, etc.), transaction records (including transaction records between players, auction house transaction records, etc.), social relationships (including friend lists, guild member lists, etc.), game activity records (including records of completing tasks, fighting monsters, participating in activities, etc.), game item information (including items in the backpack, items in the warehouse, etc.), game resource information (including the number of resources in the account, resources in transactions, etc.).
[0056] Optionally, in this embodiment, the first interaction data between the first account and the second account recorded by the first account can be understood but not limited to being the first interaction data between the first account and the second account cached in the client memory of the first account; similarly, the second interaction data between the first account and the second account recorded by the second account can be understood but not limited to being the second interaction data between the first account and the second account cached in the client memory of the second account.
[0057] Optionally, in this embodiment, the account interaction data is usually stored in the respective databases of the multiple accounts, and is loaded into the memory by the process where the account is located when the player logs in. The interaction between the multiple accounts will update the memory data in real time, and the memory data will be written back to the database at regular intervals. The account's memory data is distributed in different server processes for independent management, and there is no mutual influence or interference between the multiple accounts on the account interaction data, so when the client displays the account data, it will directly obtain the account's own account interaction data from the server;
[0058] Further take the first interaction data and the second interaction data in this embodiment as an example. Figure 3 As shown, when the first account logs in to the client 302, the server cluster will allocate server 304 to the client 302, and then read the first interaction data between the first account and the second account recorded by the first account from the database 306 through the server 304, and transmit it to the memory of the client 302 for caching; similarly, when the second account logs in to the client 310, the server cluster will allocate server 308 to the client 310, and then read the second interaction data between the first account and the second account recorded by the second account from the database 306 through the server 308, and transmit it to the memory of the client 310 for caching;
[0059] In this embodiment, the client 302 may obtain the second interaction data by, but not limited to, reading the second interaction data from the memory of the client 310 by the server 304 , or by, but not limited to, reading the second interaction data from the database 306 by the server 304 .
[0060] Optionally, in this embodiment, the first interaction data is synchronously processed based on the second interaction data, and a synchronization processing result is obtained. If there is a difference in data content between the second interaction data and the first interaction data, first determine the interaction data with higher data credibility between the second interaction data and the first interaction data, and then synchronize the first interaction data according to the interaction data with higher credibility. If the first interaction data is different from the interaction data with higher credibility, the first interaction data is updated according to the interaction data with higher credibility. If the first interaction data lacks some data content in the interaction data with higher credibility, the part of the data content is added to the first interaction data, and the updated first interaction data is used as the synchronization processing result.
[0061] Optionally, in this embodiment, in the process of synchronizing the first interactive data based on the second interactive data, considering that the formats of the first interactive data and the second interactive data may be inconsistent, format conversion or compatibility processing is required to ensure that the data can be correctly synchronized. If there is a conflict between the first interactive data and the second interactive data, conflict detection and resolution are required. For example, if two players buy the same item at the same time, it is necessary to determine which player obtains the item. In addition, the synchronization frequency of the first interactive data and the second interactive data needs to be reasonably set to ensure that the data can be synchronized in time, while avoiding frequent synchronization causing excessive server load. Furthermore, during the data synchronization process, it is necessary to ensure the security of the data to prevent the data from being tampered with or leaked. In order to improve the efficiency of data synchronization, incremental synchronization or differential synchronization can be used to synchronize only the data that has changed, avoiding data redundancy and long transmission time caused by full synchronization.
[0062] It should be noted that after obtaining the account interaction data (first interaction data) recorded by its own account (first account), the account interaction data is not used directly, but the account interaction data (second interaction data) recorded by other accounts (second account) that interact with its own account is obtained, and the account interaction data recorded by its own account is synchronized, and the account interaction data recorded by multiple accounts that interact are synchronized in a timely manner, thereby achieving the technical effect of improving the consistency of account interaction data.
[0063] To further illustrate, the optional Figure 4As shown, account interaction data of the first account 402 in the virtual game is obtained, wherein the account interaction data includes first interaction data between the first account 402 and the second account 404 recorded by the first account 402; in response to an interaction request triggered by the first account 402 to the second account 404 (such as when the client of the first account 402 performs a required game operation on the second account 404, triggering an interaction request), second interaction data of the second account 404 in the virtual game is obtained, wherein the second interaction data is interaction data between the first account 402 and the second account 404 recorded by the second account 404; and the first interaction data is synchronized based on the second interaction data.
[0064] Through the embodiments provided by the present application, the account interaction data of the first account in the virtual game is obtained, wherein the account interaction data includes the first interaction data between the first account and the second account recorded by the first account; in response to the interaction request triggered by the first account to the second account, the second interaction data of the second account in the virtual game is obtained, wherein the second interaction data is the interaction data between the first account and the second account recorded by the second account; and the first interaction data is synchronized based on the second interaction data. After obtaining the account interaction data (first interaction data) recorded by the own account (first account), the account interaction data is not used directly, but the account interaction data (second interaction data) recorded by other accounts (second accounts) interacting with the own account is obtained, and the account interaction data recorded by the own account is synchronized, thereby achieving the purpose of timely synchronization of the account interaction data recorded by multiple accounts that interact, thereby achieving the technical effect of improving the consistency of the account interaction data.
[0065] As an optional solution, obtaining the second interaction data of the second account in the virtual game includes at least one of the following:
[0066] S1-1, obtaining a target interaction attribute of the second account in the virtual game, wherein the target interaction attribute is an attribute value recorded by the second account that changes between the first account and the second account as the first interaction behavior occurs, and the second interaction data includes data corresponding to the target interaction attribute;
[0067] S1-2, obtaining a target interaction relationship of the second account in the virtual game, wherein the target interaction relationship is an interaction relationship established between the first account and the second account recorded by the second account as a second interaction behavior occurs, and the second interaction data includes data corresponding to the target interaction relationship.
[0068] Optionally, in this embodiment, the target interaction attribute is an attribute value recorded by the second account that changes with the occurrence of the first interaction behavior between the first account and the second account, wherein the first interaction behavior can be, but is not limited to, an interaction behavior between multiple accounts, such as multiple players (accounts) forming a team to jointly complete tasks, fight monsters, and other activities, multiple players forming a team to jointly complete tasks, fight monsters, and other activities, players trading items or virtual resources, players fighting PVP (player vs. player) or PVE (player vs. environment), players chatting, giving gifts, participating in a game together, and other social interactions. The attribute value that changes with the occurrence of the first interaction behavior, such as the social interaction of giving gifts between account A and account B, increases the social intimacy between account A and account B, and another example is that account A and account B fight PVP, and account A wins, thereby increasing the number of wins of account A relative to account B, and the number of losses of account B relative to account A.
[0069] Optionally, in this embodiment, the target interactive relationship is an interactive relationship established between the first account and the second account recorded by the second account as a second interactive behavior occurs. The second interactive behavior may be, but is not limited to, an interactive behavior conducted between multiple accounts for establishing an interactive relationship, such as social interactions such as adding friends and establishing close relationships between players, such as account A adding account B as a friend, account A applying to establish a close relationship with account B, etc.
[0070] It should be noted that in order to increase the data diversity of account interaction data in virtual games, interaction attributes and / or interaction relationships are also used as account interaction data.
[0071] Through the embodiments provided in the present application, a target interaction attribute of a second account in a virtual game is obtained, wherein the target interaction attribute is an attribute value between a first account and a second account recorded by the second account and changes with the occurrence of a first interaction behavior, and the second interaction data includes data corresponding to the target interaction attribute; a target interaction relationship of the second account in the virtual game is obtained, wherein the target interaction relationship is an interaction relationship established between the first account and the second account recorded by the second account and established with the occurrence of a second interaction behavior, and the second interaction data includes data corresponding to the target interaction relationship, thereby achieving the purpose of using the interaction attribute and / or interaction relationship as account interaction data, thereby realizing the technical effect of improving the data diversity of account interaction data in the virtual game.
[0072] As an optional solution, the first interaction data is synchronously processed based on the second interaction data, including:
[0073] S2-1, when the original interaction attribute and the target interaction attribute are obtained and the first attribute value corresponding to the original interaction attribute is less than the second attribute value corresponding to the target interaction attribute, the first attribute value is synchronously updated to the second attribute value, wherein the original interaction attribute is the attribute value between the first account and the second account recorded by the first account that changes with the occurrence of the first interaction behavior; or,
[0074] S2-2, when the target interaction attribute is obtained but the original interaction attribute is not obtained, the target interaction attribute is synchronously added to the interaction attribute recorded in the first account.
[0075] Optionally, in this embodiment, the original interaction attribute is an attribute value between the first account and the second account recorded by the first account and changes as the first interaction behavior occurs, wherein the original interaction attribute and the target interaction attribute belong to the same type of data, the difference is that the original interaction attribute is recorded by the first account, and the target interaction attribute is recorded by the second account.
[0076] It should be noted that in order to improve the efficiency of data synchronization processing, the target interaction attributes are used as benchmark data, and in the case where there are target interaction attributes but no original interaction attributes, and in the case where there are target interaction attributes and original interaction attributes but the second attribute value of the target interaction attributes is greater than the first attribute value of the original interaction attributes, the original interaction attributes are synchronously processed based on the target interaction attributes, such as synchronously updating the first attribute value to the second attribute value, and synchronously adding the target interaction attributes to the interaction attributes recorded in the first account.
[0077] To further illustrate, the optional Figure 5 As shown, when the original interaction attribute 502 and the target interaction attribute 504 are obtained, and the first attribute value (intimacy: 50) corresponding to the original interaction attribute 502 is less than the second attribute value (intimacy: 70) corresponding to the target interaction attribute 504, the first attribute value is synchronously updated to the second attribute value, or in other words, the intimacy in the original interaction attribute 502 is adjusted to 70.
[0078] Through the embodiments provided by the present application, when the original interaction attribute and the target interaction attribute are obtained, and the first attribute value corresponding to the original interaction attribute is less than the second attribute value corresponding to the target interaction attribute, the first attribute value is synchronously updated to the second attribute value, wherein the original interaction attribute is the attribute value between the first account and the second account recorded in the first account that changes with the occurrence of the first interaction behavior; or, when the target interaction attribute is obtained but the original interaction attribute is not obtained, the target interaction attribute is synchronously added to the interaction attribute recorded in the first account, thereby achieving the purpose of using the target interaction attribute as benchmark data, thereby realizing the technical effect of improving the efficiency of data synchronization processing.
[0079] As an optional solution, in the process of synchronously adding the target interaction attribute as the interaction attribute of the first account record, the method further includes:
[0080] When the target interaction relationship is obtained but the original interaction relationship is not obtained, the target interaction relationship is synchronously added to the interaction relationship recorded by the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account recorded by the first account as the second interaction behavior occurs, and the target interaction attribute is used to indicate the degree of intimacy of the target interaction relationship.
[0081] It should be noted that in order to improve the efficiency of data synchronization processing, in the process of synchronously adding the target interaction attributes as the interaction attributes recorded in the first account, if the target interaction relationship is obtained but the original interaction relationship is not obtained, the target interaction relationship is synchronously added to the interaction relationship recorded in the first account.
[0082] To further illustrate, the optional Figure 6 As shown, in the process of synchronously adding the target interaction attribute (the value of friend intimacy 50) as the interaction attribute recorded by the first account, when the target interaction relationship 604 (friend relationship) is obtained but the original interaction relationship is not obtained, the target interaction relationship 604 is synchronously added to the interaction relationship 602 recorded by the first account, such as the interaction relationship 602 recorded by the first account will be updated to include the friend relationship between the first account and the second account. Among them, the relationship between the friend relationship and the friend intimacy can be understood as, but not limited to, the friend intimacy is used to represent the information (such as quantity, frequency, etc.) of the first interaction behavior performed by the first account and the second account after the friend relationship is established.
[0083] Through the embodiments provided by the present application, when the target interaction relationship is obtained but the original interaction relationship is not obtained, the target interaction relationship is synchronously added to the interaction relationship recorded by the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account recorded by the first account as the second interaction behavior occurs, and the target interaction attribute is used to indicate the degree of intimacy of the target interaction relationship, thereby achieving the purpose of synchronously adding the target interaction relationship to the interaction relationship recorded by the first account, thereby realizing the technical effect of improving the efficiency of data synchronization processing.
[0084] As an optional solution, the first interaction data is synchronously processed based on the second interaction data, including:
[0085] S3-1, when the target interaction relationship is obtained but the original interaction relationship is not obtained, obtaining the current relationship restriction condition of the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account recorded by the first account as the second interaction behavior occurs, and the relationship restriction condition is used to restrict the interaction relationship to be established by the first account;
[0086] S3-2, when the target interaction relationship satisfies the relationship restriction condition, obtain data exception information, and send the data exception information to the client of the second account, wherein the data exception information is used to prompt the client of the second account to roll back the data corresponding to the target interaction relationship.
[0087] It should be noted that in order to improve the synchronization accuracy of the interactive relationship, when the target interactive relationship is obtained but the original interactive relationship is not obtained, it is necessary to first determine whether the current relationship restriction conditions of the first account restrict the first account from establishing the target interactive relationship. If so, data anomaly information needs to be sent to the client of the second account.
[0088] Through the embodiments provided by the present application, when the target interaction relationship is obtained but the original interaction relationship is not obtained, the current relationship restriction condition of the first account is obtained, wherein the original interaction relationship is the interaction relationship between the first account and the second account recorded by the first account and established as the second interaction behavior occurs, and the relationship restriction condition is used to restrict the interaction relationship to be established by the first account; when the target interaction relationship satisfies the relationship restriction condition, data anomaly information is obtained and sent to the client of the second account, wherein the data anomaly information is used to prompt the client of the second account to roll back the data corresponding to the target interaction relationship, thereby achieving the purpose of first determining whether the current relationship restriction condition of the first account restricts the first account from establishing the target interaction relationship when the target interaction relationship is obtained but the original interaction relationship is not obtained, thereby achieving the technical effect of improving the synchronization accuracy of the interaction relationship.
[0089] As an optional solution, obtaining the account interaction data of the first account in the virtual game includes: reading first data matching the first identity identifier of the first account from a target database, and using the first data as the account interaction data;
[0090] As an optional solution, after obtaining the account interaction data of the first account in the virtual game, the method further includes:
[0091] S4-1, taking the changed interaction data in the account interaction data as dynamic interaction data;
[0092] S4-2, transmitting the dynamic interaction data to the target database and storing it according to the first identity identifier.
[0093] Optionally, in this embodiment, the target database may be divided into multiple storage spaces but is not limited thereto, and each storage space in the multiple storage spaces is confirmed according to the identity identifier of the account, such as Figure 7 As shown, the target database can be divided into multiple storage spaces (storage space 1, storage space 2, storage space n, etc.) without limitation, and the storage spaces are indexed and marked with different identity identifiers, so that when the identity identifier is obtained, the identity identifier can be used to index the corresponding storage space. For example, when identity identifier 1 is obtained, identity identifier 1 can be used to index the corresponding storage space 1.
[0094] It should be noted that, in order to improve the timeliness of account interaction data, the changed interaction data in the account interaction data is regarded as dynamic interaction data and transmitted to the target database for storage. At the same time, in order to improve the efficiency of data management, it will be stored according to the identity identifier.
[0095] Through the embodiments provided by the present application, first data matching the first identity identifier of the first account is read from the target database, and the first data is used as the account interaction data; the interaction data that has changed in the account interaction data is used as dynamic interaction data; the dynamic interaction data is transmitted to the target database and stored according to the first identity identifier, thereby achieving the purpose of transmitting the interaction data that has changed in the account interaction data as dynamic interaction data to the target database for storage, thereby realizing the technical effect of improving the timeliness of the account interaction data.
[0096] As an optional solution, after the first interaction data is synchronously processed based on the second interaction data, the method further includes:
[0097] S5-1, when the first interaction data changes, assigning a dynamic tag to the first interaction data;
[0098] S5-2, determining the interaction data carrying the dynamic tag in the account interaction data as dynamic interaction data.
[0099] It should be noted that after the first interaction data is synchronized based on the second interaction data, in order to improve the timeliness of the interaction data obtained by the synchronization, when the first interaction data changes, a dynamic label is assigned to the first interaction data, and the interaction data carrying the dynamic label in the account interaction data is determined as dynamic interaction data.
[0100] Through the embodiments provided by the present application, when the first interaction data changes, a dynamic tag is assigned to the first interaction data; the interaction data carrying the dynamic tag in the account interaction data is determined as dynamic interaction data, thereby achieving the technical effect of improving the data timeliness of the interaction data obtained by synchronization processing.
[0101] As an optional solution, obtaining the second interaction data of the second account in the virtual game includes:
[0102] Second data matching the second identity identifier of the second account is read from the target database, and the second data is used as second interaction data.
[0103] It should be noted that in order to improve the efficiency of obtaining multi-account interaction data, the interaction data is directly read from the target database.
[0104] Through the embodiments provided in the present application, second data matching the second identity identifier of the second account is read from the target database, and the second data is used as the second interaction data, thereby achieving the purpose of directly reading the interaction data from the target database, thereby realizing the technical effect of improving the efficiency of obtaining interaction data of multiple accounts.
[0105] As an optional solution, after obtaining the account interaction data of the first account in the virtual game, the method further includes:
[0106] When an interactive operation performed by the first account on the second account is obtained and the second account is online, an interactive request is obtained.
[0107] It should be noted that in order to improve the processing stability of interactive data, when the interactive operation performed by the first account on the second account is obtained, the interactive request is not triggered directly. Instead, the interactive request is triggered when the second account is online. On the contrary, when the second account is offline, data synchronization processing is temporarily not performed. This is because when the second account is offline, the second interactive data recorded by the second account may be inaccurate due to offline. Therefore, the first interactive data is synchronized using inaccurate interactive data, which naturally makes it impossible to guarantee the accuracy of the first interactive data, thereby reducing the processing stability of the interactive data.
[0108] Through the embodiments provided by the present application, when an interactive operation performed by a first account on a second account is obtained and the second account is online, an interactive request is obtained, thereby achieving the purpose of temporarily not performing data synchronization processing when the second account is offline, thereby achieving the technical effect of improving the processing stability of interactive data.
[0109] As an optional solution, obtaining account interaction data of the first account in the virtual game includes: obtaining first target interaction data and second target interaction data of the first account in the virtual game, wherein the first target interaction data is interaction data stored according to interaction identifiers between accounts in the virtual game, the second target interaction data is interaction data stored according to identity identifiers of the accounts in the virtual game, and the second target interaction data includes the first interaction data;
[0110] As an optional solution, after obtaining the account interaction data of the first account in the virtual game, the method also includes: in response to a target interaction request triggered by the first account to the second account, determining interaction data carrying a target interaction identifier from the first target interaction data, wherein the target interaction identifier is used to indicate that an interaction occurs between the first account and the second account.
[0111] Optionally, in this embodiment, the interaction identifiers between accounts in the virtual game are used to indicate which pair or multiple accounts interact to generate data. The identity identifiers of accounts in the virtual game are used to indicate which account records the data generated by the interaction with other party accounts.
[0112] It should be noted that in order to improve the processing efficiency of interactive data, during the data synchronization process, a separate category of interactive data (first target interactive data) can be set up. Regardless of which account the data is recorded in, it is stored uniformly according to the interactive identifier. There is no need to consider the differences in data records between different accounts, and there is no need to perform data synchronization processing.
[0113] To further illustrate, the optional Figure 8 As shown, it is assumed that the target database 802 is divided into multiple storage spaces, wherein the multiple storage spaces are divided into two categories, one for storing the first target interaction data 804, and the other for storing the second target interaction data 806. For example, storage space m stores the first target interaction data 804 according to the interaction identifier, and storage space 1, storage space 2, storage space n, etc. store the second target interaction data 806 according to the identity identifier. Then, the corresponding first target interaction data 804 can be indexed in storage space m by using the interaction identifier, the corresponding storage space can be determined by using the identity identifier, and then the corresponding second target interaction data 806 can be obtained from the corresponding storage space.
[0114] Through the embodiments provided by the present application, first target interaction data and second target interaction data of a first account in a virtual game are obtained, wherein the first target interaction data is interaction data stored according to interaction identifiers between accounts in the virtual game, and the second target interaction data is interaction data stored according to identity identifiers of accounts in the virtual game, and the second target interaction data includes the first interaction data; in response to a target interaction request triggered by the first account to the second account, interaction data carrying the target interaction identifier is determined from the first target interaction data, wherein the target interaction identifier is used to indicate that an interaction occurs between the first account and the second account, thereby achieving the purpose of separately setting a type of interaction data (first target interaction data) in the process of data synchronization processing, regardless of which account records them, but uniformly storing them according to the interaction identifier, thereby achieving the technical effect of improving the processing efficiency of interaction data.
[0115] As an optional solution, for ease of understanding, the above data synchronization method is applied to the player's social data processing scenario. The player's social data is usually the data of both players, such as friend data, close relationship data, etc. Both parties will maintain relevant data with their friends, and their data should usually be consistent. The social data will be recorded in the players' respective databases. Since the data is stored in different players, there will be inconsistencies in the player data. This embodiment proposes an efficient data synchronization solution, which allows players to synchronize social data with each other in a timely manner during normal games to ensure the consistency of each other's data.
[0116] Normally, social data needs to be relatively consistent between both players; however, player data is managed separately by each server, so it is very likely that the data update of one party fails due to an abnormality in the server process, resulting in inconsistent player data. For example, when the process where player A is located sends a friend request to player B, and player B agrees, the consent request is sent to the process of player A. However, a network abnormality causes communication failure. In this case, A is a friend of B, but B is not a friend of A. This results in player A not being included in B's friend list when displayed on the game client, affecting the player's gaming experience.
[0117] To further illustrate, optionally, since players log in to different service processes, the communication between processes is closely related to the network and other environments. For example, when player B sends a friend request to player A, the process where player A is located successfully receives the request and agrees to the friend request. Player A adds player B as his game friend and sends the request of approval to player B. At this time, if the request sent to B is lost due to network fluctuations, process abnormalities, or DB errors, then for player A, player B is his game friend, but player B is not A's friend. In addition, for some players who cancel the game authorization of platform friends on the platform side, one-way friends may also occur.
[0118] Furthermore, the close friends system is a derivative system based on the friend system. Both the friend system and the intimacy system are important modules in the social system. Both parties of the social interaction maintain a copy of the social data. When teaming up with friends, the corresponding intimacy will be increased. However, when one-way friends appear, there will be inconsistency in the increase in intimacy. Because one party thinks that the other party is a friend, the intimacy is increased, while the other party does not increase the corresponding intimacy because they do not have the other party as a friend, resulting in inconsistency in the intimacy between the two parties. Similarly, when establishing an intimate relationship, a one-way intimate relationship may also occur.
[0119] In order to bring players a better gaming experience and ensure the robustness and problem-solving of the social system, this embodiment proposes an efficient synchronization solution for inconsistent player social data. When players log in to the game to view friend information, play team games with friends, etc., the process will actively compare the player's data with the other party's data and repair inconsistent data to ensure the consistency of the player's social data and repair the player's social data. When players open the friend list, click on a friend's profile, and play team games with friends, the system will automatically compare their social data with the other party's data to complete the data synchronization.
[0120] Optionally, in this embodiment, in addition to repairing social data including intimacy, intimacy, relationship level, etc. in the friend intimacy system, the player's friend relationship data is also automatically repaired during data synchronization. When increasing intimacy, intimacy is normally increased only when the other party is a friend. Therefore, while repairing the inconsistency of intimacy, the player's friends will be automatically added. The next time the player logs in, the other party's friends will appear in the friend list.
[0121] It should be noted that when a player logs in to the game through the game client, he will be assigned to one of the many Zonesvr. After the player logs in, most of the key data will be cached on the Zonesvr and written back to the DB at regular intervals. The most important key data mentioned here is the player role data obtained from RoleInDB. So when the player logs in to the game, the client will obtain the role data from the Zonesvr. After receiving the request, the Zonesvr will send the request to the DB proxy server Tcaproxy, asking it to request the RoleInDB data from the DB and return the data to the Zonesvr. Zonesvr will load the RoleInDB data returned from the DB into the memory, which will become the player's real-time role data, and send this part of the data to the client. The client's operations on the player will directly modify the role data in the memory, and then write back to the DB at regular intervals to make the player's data land.
[0122] After logging into the game, in addition to obtaining their own data for client display and processing, players also need to interact with other players, such as displaying the friend list, displaying other players' personal information, etc. The data of other players is mainly displayed through RoleSimpleDataDB and RoleInDB. RoleSimpleDataDB is the player's brief data, which is a subset of RoleInDB and is mainly used to display basic information such as the player's character nickname, avatar, level, and rank in the friend list. When clicking on the player's personal information, this embodiment will access the detailed data of other players, including: detailed personal information, intimate data, hero data, favorite data, etc., which requires access to RoleInDB to obtain.
[0123] Unlike accessing one's own data, when a player logs in, the RoleInDB of one's own data has been loaded from the DB into the memory, and subsequent access and processing are directly based on the memory data. When accessing other players' data, if the other party is not online, there is no memory data of the other party in Zonesvr; even if the other party is online, the zonesvr where the other party is located is likely to be different from the zonesvr where one is located. Therefore, if one wants to access the other party's memory data, in addition to knowing the Zonesvr where the other party is located, if one needs to obtain the memory data, one also needs to communicate with the other party's Zonesvr, which increases the communication overhead between servers. Therefore, when accessing the detailed data of other players, this embodiment can directly notify the Zonesvr where one is located, allowing it to directly query the RoleInDB data of the DB and return it to the client for implementation.
[0124] To further illustrate, the optional Fig. 9The interaction between the client and the server regarding player data involves the player's client, server (Zonesvr), proxy server (Tcaproxy), and database (DB). The player data may refer to, but is not limited to, detailed data of the player, which is feedback based on the query of RoleInDB. The specific steps are as follows:
[0125] Step S902, when the player logs into the game, when the client requests its own data, it requests the RoleInDB data of the database (DB) through the server (Zonesvr), caches the data in the Zonesvr memory, and returns the player data to the client.
[0126] Step S904, during the online game, the player regularly writes back his role data to the RoleInDB table of the DB to ensure that the player's latest data can be saved regularly. When the player exits the game, he will also write back to RoleInDB once.
[0127] Step S906, the interactive process of the player querying other players' message data in the game, is mainly the process of returning RoleInDB data of the DB to the client through the Zonesvr where the player is located.
[0128] Step S908 is a key step for data synchronization. The premise of step S908 is the execution of step S906. After obtaining the RoleInDB of other players in step S906, Zonesvr will compare the social data of the other party's RoleInDB with its own data, synchronize its own social data according to certain rules, and return the synchronized results to the client for refreshing. Subsequently, it updates its own RoleInDB so that the latest data of the player can be implemented in time.
[0129] Optionally, in this embodiment, if Fig.10 As shown in the figure, when the client clicks on other players' profiles, views intimate data, views the other party's wish list, etc., the client will request the other party's RoleInDB from the server. After receiving the DB data returned by Tcaproxy, Zonesvr will return the player's RoleInDB to the client on the one hand, and synchronize its own social data on the other hand.
[0130] When synchronizing data, first check whether the other party is online. If the other party is not online, there may be offline messages that have not been processed in time. For example, A gave player B a gift to increase intimacy, but player B is not online, then this message will be stored in player B's EventlogDB in the form of an offline message Eventlog. Wait for player B to log in and process it, thereby increasing the corresponding intimacy. If player A pulls B's RoleInDB synchronization data before B comes online, B's data cannot be guaranteed to be the most real-time data.
[0131] After logging into the game, the player will obtain the online status of his friends and record it in the memory of his Zonesvr. After confirming that the other party is online, data synchronization can be continued. The other party's RoleInDB data and his own memory data in Zonesvr have a data structure called SnsInfo, which stores all the social data of the player.
[0132] Currently, RoleSnsInfo mainly includes game friend data, close friend data, and special attention data. Among them, special attention does not need to be synchronized because it is not a two-way relationship chain. After Zonesvr obtains the other party's RoleInDB, it obtains the RoleSnsInfo data from the data structure and compares this part of the data with the player's own RoleSnsInfo data and synchronizes the data.
[0133] Optionally, in this embodiment, if Fig.11 As shown, RoleSnsInfo can include, but is not limited to, game friend data, close friend data, and special attention data. Among them, special attention does not need to be synchronized because it is not a two-way relationship chain. After Zonesvr obtains the other party's RoleInDB, it obtains the RoleSnsInfo data from the data structure, and compares this part of the data with the player's own RoleSnsInfo data and synchronizes the data. The specific steps are as follows:
[0134] The first data that needs to be synchronized is the ItimateData intimate data. Intimate data mainly includes: intimacy data, intimate relationship data and weekly intimate data. This embodiment synchronizes these three data one by one. First, traverse the intimacy data list in the other party's SnsInfo to find the intimacy data related to yourself recorded by the other party. At the same time, find the intimacy data related to the other party in the intimacy data of your own SnsInfo. The principle of synchronization is: if the other party does not have my intimacy data, synchronization is not required. The intimacy data recorded by the other party is smaller than the intimacy data recorded by yourself, and synchronization is not required. If the other party has my intimacy data and I do not have the other party's intimacy data, a new intimacy data will be added to keep it consistent with the other party. If the intimacy data recorded by the other party is larger than the intimacy data recorded by yourself, synchronization is required.
[0135] After synchronizing the intimacy data, in a similar manner, obtain the weekly intimacy data related to oneself from the other party's SnsInfo to complete the synchronization of the weekly intimacy data.
[0136] Finally, the data of intimate relationships is synchronized. Intimate relationships are a special relationship between two players, such as lovers, brothers, and girlfriends. Each person has a limited number of intimate relationships, and each person can have at most one couple relationship. Therefore, when synchronizing intimate relationships, there may be a situation in which the number of intimate relationships reaches the upper limit during the synchronization process, resulting in synchronization failure. If it is not handled, there will still be inconsistencies in the intimate relationships between the two players. Therefore, in order to ensure the consistency of the social data of both parties, the synchronization logic of data rollback is also introduced when synchronizing intimate relationships. Find the intimate relationship data related to yourself in the other party's record: If the other party does not have your own intimate relationship, do not synchronize. If you do not have the other party's intimate relationship, try to add the intimate relationship to your own intimate relationship data based on the intimate relationship recorded by the other party. Check whether the number of your intimate relationships exceeds the maximum limit or if the relationship to be synchronized is a couple relationship, you also need to check whether you already have a couple relationship. If not satisfied, you need to send an Eventlog data to player B to notify him to roll back the data. If both parties have an intimate relationship, synchronize the intimate data with a higher intimate relationship level based on the intimacy level of both parties.
[0137] In the game, when two players play together or give gifts, if they are friends, the corresponding intimacy will be increased. If the intimacy between the two parties is inconsistent, it is likely caused by the inconsistency of the friend data of the two parties. Therefore, when synchronizing the intimacy data, if there is a situation where the intimacy synchronization data needs to be increased, this embodiment will additionally judge and synchronize the friends, that is, check whether the other party is your friend. If the other party is not your friend, the friend data of the other party will be synchronized to yourself, thereby realizing the synchronization of friend data.
[0138] After data synchronization occurs, IsSnsInfoChange will be set to 1, indicating that the player's SnsInfo social data has changed. After data synchronization is completed, if IsSnsInfoChange = 1, the player's RoleInDB data will be written back to the DB, and the player's latest RoleIn data will be sent to the client for client updates.
[0139] If data rollback logic occurs, the other party will obtain a data rollback Evenlog data while online or logged into the game. After receiving this data, player B will delete the corresponding friend social data to keep the social data of both parties consistent. After deleting the data, player B will also perform a write-back operation on RoleInDB and send the player's latest RoleIn data to the client for client updates.
[0140] It is worth noting that under normal circumstances, players will periodically write back RoleInDB while online, so the RoleInDB data obtained from the DB may not be the latest during the two DB write-backs. Therefore, when a player's social data changes, it is necessary to actively write back to RoleInDB, so as to ensure that other players have the latest data when obtaining the SnsInfo data in the player's RoleInDB. For example, when player A and player B cancel their intimacy, the intimacy of both parties is deducted. After the relationship is canceled, if player B's RoleInDB is not written back in time, when player A pulls B's RoleInDB data, it finds that the intimacy value is 50 more than its own intimacy value, and will increase its own intimacy by 50, causing the logic of deducting 50 intimacy to fail, which is not in line with expectations. Therefore, players A and B can effectively avoid such problems by writing back to RoleInDB in time after the intimacy data changes.
[0141] Through the embodiments provided by the present application, the social data of players that are prone to inconsistency is synchronized without additional DB query overhead. Without the player's awareness, the consistency of the player's social relationship chain is guaranteed, and the user experience of the player in social networking is optimized. The inconsistency problem of social data and the resulting negative feedback and complaints from users can be greatly reduced.
[0142] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0143] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0144] According to another aspect of the embodiment of the present application, a data synchronization device for implementing the above data synchronization method is also provided. Fig.12 As shown, the device comprises:
[0145] A first acquisition unit 1202 is used to acquire account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account;
[0146] The second acquisition unit 1204 is configured to acquire second interaction data of the second account in the virtual game in response to an interaction request triggered by the first account to the second account, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account;
[0147] The synchronization unit 1206 is configured to perform synchronization processing on the first interaction data based on the second interaction data.
[0148] For the specific implementation, reference may be made to the example shown in the above data synchronization device, which will not be described in detail in this example.
[0149] As an optional solution, the second obtaining unit 1204 includes at least one of the following:
[0150] A first acquisition module is used to acquire a target interaction attribute of the second account in the virtual game, wherein the target interaction attribute is an attribute value recorded by the second account that changes between the first account and the second account as the first interaction behavior occurs, and the second interaction data includes data corresponding to the target interaction attribute;
[0151] The second acquisition module is used to obtain a target interaction relationship of the second account in the virtual game, wherein the target interaction relationship is an interaction relationship established between the first account and the second account recorded by the second account as the second interaction behavior occurs, and the second interaction data includes data corresponding to the target interaction relationship.
[0152] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0153] As an optional solution, the synchronization unit 1206 includes:
[0154] an updating module, configured to synchronously update the first attribute value to the second attribute value when an original interaction attribute and a target interaction attribute are obtained and a first attribute value corresponding to the original interaction attribute is less than a second attribute value corresponding to the target interaction attribute, wherein the original interaction attribute is an attribute value between the first account and the second account recorded by the first account that changes with the occurrence of the first interaction behavior; or,
[0155] The first adding module is used to synchronously add the target interaction attribute to the interaction attribute recorded in the first account when the target interaction attribute is obtained but the original interaction attribute is not obtained.
[0156] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0157] As an optional solution, the device also includes:
[0158] The second new module is used to synchronously add the target interaction attribute as the interaction attribute recorded in the first account, when the target interaction relationship is obtained but the original interaction relationship is not obtained, to synchronously add the target interaction relationship to the interaction relationship recorded in the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account recorded in the first account as the second interaction behavior occurs, and the target interaction attribute is used to indicate the degree of intimacy of the target interaction relationship.
[0159] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0160] As an optional solution, the synchronization unit 1206 includes:
[0161] a third acquisition module, configured to acquire the current relationship restriction condition of the first account when the target interaction relationship is acquired but the original interaction relationship is not acquired, wherein the original interaction relationship is the interaction relationship established between the first account and the second account as the second interaction behavior occurs and recorded by the first account, and the relationship restriction condition is used to restrict the interaction relationship to be established by the first account;
[0162] The fourth acquisition module is used to obtain data exception information when the target interaction relationship meets the relationship restriction condition, and send the data exception information to the client of the second account, wherein the data exception information is used to prompt the client of the second account to roll back the data corresponding to the target interaction relationship.
[0163] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0164] As an optional solution, the first acquisition unit 1202 includes: a first reading module, configured to read first data matching the first identity identifier of the first account from the target database, and use the first data as the account interaction data;
[0165] The device also includes:
[0166] A first determination module is used to, after acquiring the account interaction data of the first account in the virtual game, use the changed interaction data in the account interaction data as dynamic interaction data;
[0167] The storage module is used to transmit the dynamic interaction data to the target database after acquiring the account interaction data of the first account in the virtual game, and store it according to the first identity identifier.
[0168] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0169] As an optional solution, the device also includes:
[0170] an allocation module, configured to allocate a dynamic tag to the first interaction data after the first interaction data is synchronously processed based on the second interaction data, if the first interaction data changes;
[0171] The second determination module is used to determine the interaction data carrying the dynamic tag in the account interaction data as dynamic interaction data after synchronously processing the first interaction data based on the second interaction data.
[0172] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0173] As an optional solution, the second obtaining unit 1204 includes:
[0174] The second reading module is used to read second data matching the second identity identifier of the second account from the target database, and use the second data as second interaction data.
[0175] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0176] As an optional solution, the device also includes:
[0177] The third acquisition unit is used to acquire the account interaction data of the first account in the virtual game, and acquire the interaction request when the interaction operation performed by the first account on the second account is acquired and the second account is online.
[0178] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0179] As an optional solution, the first acquisition unit 1202 includes: a fifth acquisition module, used to acquire first target interaction data and second target interaction data of the first account in the virtual game, wherein the first target interaction data is interaction data stored according to interaction identifiers between accounts in the virtual game, the second target interaction data is interaction data stored according to identity identifiers of the accounts in the virtual game, and the second target interaction data includes the first interaction data;
[0180] The device also includes: a determination unit, which is used to determine, in response to a target interaction request triggered by the first account to the second account after obtaining the account interaction data of the first account in the virtual game, interaction data carrying a target interaction identifier from the first target interaction data, wherein the target interaction identifier is used to indicate that an interaction occurs between the first account and the second account.
[0181] For the specific implementation, reference may be made to the example shown in the above data synchronization method, which will not be described in detail in this example.
[0182] According to another aspect of the embodiment of the present application, an electronic device for implementing the above data synchronization method is also provided. The electronic device can be but is not limited to: Figure 1 The user device 102 or the server 112 shown in FIG. 1 is used as an example to illustrate the electronic device as the user device 102. Fig.13 As shown, the electronic device includes a memory 1302 and a processor 1304. The memory 1302 stores a computer program, and the processor 1304 is configured to execute the steps in any of the above method embodiments through the computer program.
[0183] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0184] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0185] S1, obtaining account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account;
[0186] S2, in response to an interaction request triggered by the first account to the second account, obtaining second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account;
[0187] S3: Synchronize the first interaction data based on the second interaction data.
[0188] Alternatively, a person skilled in the art may understand that: Fig.13 The structure shown is for illustration only. Fig.13 The structure of the electronic device is not limited. Fig.13 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.13 Different configurations are shown.
[0189] Among them, the memory 1302 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data synchronization method and device in the embodiments of the present application. The processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, to implement the above-mentioned data synchronization method. The memory 1302 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1302 may further include a memory remotely located relative to the processor 1304, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1302 may be specifically, but not limited to, used to store information such as first interaction data, interaction requests, and second interaction data. As an example, such as Fig.13 As shown, the memory 1302 may include but is not limited to the first acquisition unit 1202, the second acquisition unit 1204 and the synchronization unit 1206 in the data synchronization device. In addition, it may also include but is not limited to other module units in the data synchronization device, which will not be repeated in this example.
[0190] Optionally, the transmission device 1306 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1306 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0191] In addition, the electronic device further includes: a display 1308 for displaying information such as the first interaction data, interaction request and second interaction data; and a connection bus 1310 for connecting various module components in the electronic device.
[0192] In other embodiments, the user device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, a peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, user device, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0193] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0194] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0195] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0196] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory and the random access memory are connected to each other through a bus. The input / output interface (I / O interface) is also connected to the bus.
[0197] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a local area network card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0198] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.
[0199] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a 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-mentioned various optional implementations.
[0200] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0201] S1, obtaining account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account;
[0202] S2, in response to an interaction request triggered by the first account to the second account, obtaining second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account;
[0203] S3: Synchronize the first interaction data based on the second interaction data.
[0204] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0205] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0206] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0207] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0208] In the several embodiments provided in the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0209] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0210] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0211] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data synchronization method, characterized in that: include: Acquire account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account; In response to an interaction request triggered by the first account to the second account, obtaining second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account; The first interaction data is synchronously processed based on the second interaction data.
2. The method according to claim 1, characterized in that The obtaining of the second interaction data of the second account in the virtual game comprises at least one of the following: Obtaining a target interaction attribute of the second account in the virtual game, wherein the target interaction attribute is an attribute value recorded by the second account that changes between the first account and the second account as the first interaction behavior occurs, and the second interaction data includes data corresponding to the target interaction attribute; Obtain a target interaction relationship of the second account in the virtual game, wherein the target interaction relationship is an interaction relationship established between the first account and the second account as a second interaction behavior occurs, as recorded by the second account, and the second interaction data includes data corresponding to the target interaction relationship.
3. The method according to claim 2, characterized in that The synchronously processing the first interaction data based on the second interaction data includes: When the original interaction attribute and the target interaction attribute are obtained, and a first attribute value corresponding to the original interaction attribute is less than a second attribute value corresponding to the target interaction attribute, the first attribute value is synchronously updated to the second attribute value, wherein the original interaction attribute is an attribute value between the first account and the second account recorded by the first account that changes with the occurrence of the first interaction behavior; or, In a case where the target interaction attribute is obtained but the original interaction attribute is not obtained, the target interaction attribute is synchronously added to the interaction attribute recorded in the first account.
4. The method according to claim 3, characterized in that: In the process of synchronously adding the target interaction attribute as the interaction attribute of the first account record, the method further includes: In the case where the target interaction relationship is obtained but the original interaction relationship is not obtained, the target interaction relationship is synchronously added to the interaction relationship recorded by the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account recorded by the first account as the second interaction behavior occurs, and the target interaction attribute is used to indicate the degree of intimacy of the target interaction relationship.
5. The method according to claim 2, characterized in that: The synchronously processing the first interaction data based on the second interaction data includes: In the case where the target interaction relationship is obtained but the original interaction relationship is not obtained, obtaining the current relationship restriction condition of the first account, wherein the original interaction relationship is the interaction relationship established between the first account and the second account as a result of the occurrence of the second interaction behavior as recorded by the first account, and the relationship restriction condition is used to restrict the interaction relationship to be established by the first account; When the target interaction relationship satisfies the relationship restriction condition, data exception information is obtained and sent to the client of the second account, wherein the data exception information is used to prompt the client of the second account to roll back the data corresponding to the target interaction relationship.
6. The method according to claim 1, characterized in that The obtaining of the account interaction data of the first account in the virtual game includes: reading first data matching the first identity identifier of the first account from a target database, and using the first data as the account interaction data; After obtaining the account interaction data of the first account in the virtual game, the method further includes: using the changed interaction data in the account interaction data as dynamic interaction data; The dynamic interaction data is transmitted to the target database and stored according to the first identity identifier.
7. The method according to claim 6, characterized in that After the first interaction data is synchronously processed based on the second interaction data, the method further includes: When the first interaction data changes, assigning a dynamic tag to the first interaction data; The interaction data carrying the dynamic tag in the account interaction data is determined as the dynamic interaction data.
8. The method according to claim 6, characterized in that The obtaining of the second interaction data of the second account in the virtual game includes: Read second data matching the second identity identifier of the second account from the target database, and use the second data as the second interaction data.
9. The method according to any one of claims 1 to 8, characterized in that After obtaining the account interaction data of the first account in the virtual game, the method further includes: When an interaction operation performed by the first account on the second account is obtained and the second account is online, the interaction request is obtained.
10. The method according to any one of claims 1 to 8, characterized in that The obtaining of the account interaction data of the first account in the virtual game comprises: obtaining first target interaction data and second target interaction data of the first account in the virtual game, wherein the first target interaction data is interaction data stored according to interaction identifiers between accounts in the virtual game, the second target interaction data is interaction data stored according to identity identifiers of accounts in the virtual game, and the second target interaction data includes the first interaction data; After obtaining the account interaction data of the first account in the virtual game, the method further includes: in response to a target interaction request triggered by the first account to the second account, determining interaction data carrying a target interaction identifier from the first target interaction data, wherein the target interaction identifier is used to indicate that an interaction occurs between the first account and the second account.
11. A data synchronization device, characterized in that: include: A first acquisition unit, configured to acquire account interaction data of a first account in a virtual game, wherein the account interaction data includes first interaction data between the first account and a second account recorded by the first account; A second acquisition unit, configured to acquire, in response to an interaction request triggered by the first account to the second account, second interaction data of the second account in the virtual game, wherein the second interaction data is interaction data between the first account and the second account recorded by the second account; A synchronization unit is used to synchronize the first interaction data based on the second interaction data.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises a computer program, wherein the computer program executes the method according to any one of claims 1 to 10 when executed by an electronic device.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.
14. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 10 through the computer program.