CN113476853A - Data processing method and device for interactive tasks, electronic equipment and storage medium - Google Patents

Data processing method and device for interactive tasks, electronic equipment and storage medium Download PDF

Info

Publication number
CN113476853A
CN113476853A CN202110846821.7A CN202110846821A CN113476853A CN 113476853 A CN113476853 A CN 113476853A CN 202110846821 A CN202110846821 A CN 202110846821A CN 113476853 A CN113476853 A CN 113476853A
Authority
CN
China
Prior art keywords
virtual resource
account
data processing
task
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110846821.7A
Other languages
Chinese (zh)
Other versions
CN113476853B (en
Inventor
刘硕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202110846821.7A priority Critical patent/CN113476853B/en
Publication of CN113476853A publication Critical patent/CN113476853A/en
Application granted granted Critical
Publication of CN113476853B publication Critical patent/CN113476853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/79Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
    • A63F13/795Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories for finding other players; for building a team; for providing a buddy list
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/847Cooperative playing, e.g. requiring coordinated actions from several players to achieve a common goal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/273Asynchronous replication or reconciliation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5526Game data structure
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5546Details of game data or player data management using player registration data, e.g. identification, account, preferences, game history
    • A63F2300/5566Details of game data or player data management using player registration data, e.g. identification, account, preferences, game history by matching opponents or finding partners to build a team, e.g. by skill level, geographical area, background, play style
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The disclosure relates to a data processing method, a data processing device, an electronic device and a storage medium for an interactive task, wherein the method comprises the following steps: responding to a data processing request sent by a first account in the first account set, and creating a data processing task corresponding to the data processing request; executing a data processing task and generating a data processing event corresponding to the data processing task; storing the data processing event into a first database, generating first data corresponding to a first account according to the data processing event, and updating the first data into a second database; and responding to the data query request of the second account, querying the second database to obtain target data, and returning the target data to the second account. According to the scheme disclosed by the invention, through carrying out read-write separation processing, the system has the capability of processing high concurrent data processing requests and data query requests generated when interactive tasks need to be executed by multiple persons, so that the overall performance of the system architecture is improved.

Description

Data processing method and device for interactive tasks, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data processing method and apparatus for an interactive task, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Currently, each application platform provides interaction tasks to users, which need to be completed by a plurality of teams and a plurality of teams, for example, a multi-team PK (battle) game, so as to realize strong social interaction, thereby achieving the purposes of prolonging the user duration, improving the user stickiness, and the like.
Taking a multi-team PK game as an example, in the related art, when a system of the multi-team PK game processes a request of a client, the interaction in the system is related to data query and storage in a database. For example, when the system processes a game data query request of any client, the game data is acquired from the database through the data access layer, and then the queried game data is transmitted to the presentation layer through the data transmission object. When the system processes the competition data updating request of any client, the competition data is transmitted to the object model through the data transmission object, and then the competition data is written back to the database through the data access layer. For a multi-team PK game, due to the fact that a large amount of data simultaneously accesses the system in the interaction process, performance bottlenecks are easy to generate by adopting a system architecture in the related technology.
Disclosure of Invention
The present disclosure provides a data processing method, an apparatus, an electronic device, a computer-readable storage medium, and a computer program product for an interactive task, so as to at least solve a problem in the related art that a system architecture is prone to performance bottleneck when a plurality of people form a team PK. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a data processing method for an interactive task, including:
in the process of executing an interactive task by a first account set and a second account set, responding to a data processing request sent by a first account in the first account set, and creating a data processing task corresponding to the data processing request;
executing the data processing task and generating a data processing event corresponding to the data processing task;
storing the data processing event into a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data into a second database;
and responding to a data query request of a second account, querying target data from the second database, and returning the target data to the second account, wherein the second account is any one of the first account set or the second account set.
In one embodiment, the data processing request is a virtual resource change request, the executing the data processing task and generating a data processing event corresponding to the data processing task includes:
executing a virtual resource changing task corresponding to the virtual resource changing request, changing the first virtual resource value for the virtual resource of the first account, and generating a virtual resource changing event corresponding to the virtual resource changing task.
In one embodiment, the storing the data processing event in a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data in a second database includes:
storing the virtual resource change event in the first database;
and according to the virtual resource change event, asynchronously generating a second virtual resource value corresponding to the first account, and updating the second virtual resource value corresponding to the first account into the second database.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the method further comprises the following steps:
acquiring a generated second virtual resource value corresponding to the account of the first account set from the second database, and acquiring the sum of the second virtual resource values as a first total virtual resource value of the first account set;
after each preset time period is finished, acquiring the sum of first virtual resource values of the first account set;
when the sum of the first virtual resource values is different from the sum of the second virtual resource values, replacing the first total virtual resource value with the sum of the first virtual resource values.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the method further comprises the following steps:
after each preset time period is finished, acquiring a first total virtual resource value of the first account set and a second total virtual resource value of the second account set, wherein the second total virtual resource value is determined according to virtual resource values corresponding to accounts of the second account set in the first database and the second database;
comparing the first total virtual resource value with the second total virtual resource value, and when the first total virtual resource value is greater than the second total virtual resource value, allocating a resource reward to an account belonging to the first account set;
allocating the resource award to accounts belonging to the second set of accounts when the second total virtual resource value is greater than the first total virtual resource value.
In one embodiment, the method further comprises:
acquiring a virtual resource changing task with a current state being an unfinished state from existing virtual resource changing tasks at regular time;
re-executing the virtual resource changing task in the uncompleted state, and generating a virtual resource changing event corresponding to the virtual resource changing task in the uncompleted state;
storing the virtual resource change event in the first database, and updating the second database according to the virtual resource change event.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the method further comprises the following steps:
in a non-preset time period, acquiring a virtual resource changing task of which the current state is a finished state from the existing virtual resource changing tasks;
and deleting the virtual resource changing task in the finished state.
In one embodiment, the storing the data processing event in a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data in a second database includes:
and asynchronously synchronizing the data processing event to a first message queue, wherein the first message queue is used for storing the data processing event for a view processor corresponding to the first message queue, and the view processor is used for processing the data processing event, generating first view data corresponding to the first account, and updating the first view data to the second database.
In one embodiment, before responding to the data processing request sent by the first account in the first account set, the method further includes:
responding to an account set matching request sent by any account in the first account set, and sending account set information carried in the account set matching request to a second message queue, wherein the second message queue is used for storing the account set information for an account set matching service, and the account set matching service is used for determining a second account set matched with the first account set from a candidate account set pool;
and responding to an account set matching confirmation request sent by a third account, and starting the interaction task to be executed jointly by the first account set and the second account set, wherein the third account is any one of the first account set or the second account set.
In one embodiment, the account set matching confirmation request is a request sent by the third account periodically and actively.
In one embodiment, the data query request is a request periodically and actively sent by the second account.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus for an interactive task, including:
the task creating module is configured to respond to a data processing request sent by a first account in a first account set in the process of executing an interactive task in the first account set and a second account set, and create a data processing task corresponding to the data processing request;
the event generation module is configured to execute the data processing task and generate a data processing event corresponding to the data processing task;
the storage module is configured to store the data processing event into a first database, generate first data corresponding to the first account according to the data processing event, and update the first data into a second database;
and the query module is configured to execute data query requests responding to a second account, query target data from the second database and return the target data to the second account, wherein the second account is any one of the first account set or the second account set.
In one embodiment, the data processing request is a virtual resource change request, and the event generating module is configured to execute a virtual resource change task corresponding to the virtual resource change request, change a first virtual resource value for a virtual resource of the first account, and generate a virtual resource change event corresponding to the virtual resource change task.
In one embodiment, the storage module includes:
a first storage unit configured to perform storing the virtual resource change event in the first database;
a virtual resource value generating unit configured to perform asynchronous generation of a second virtual resource value corresponding to the first account according to the virtual resource change event;
a second storage unit configured to perform updating a second virtual resource value corresponding to the first account into the second database.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the device further comprises:
a first obtaining module configured to obtain, from the second database, a generated second virtual resource value corresponding to the accounts of the first account set, and obtain a sum of the second virtual resource values as a first total virtual resource value of the first account set;
the second obtaining module is configured to obtain the sum of the first virtual resource values of the first account set after each preset time period is finished;
a replacement module configured to perform a replacement of the first total virtual resource value with the first sum of virtual resource values when the first sum of virtual resource values is different from the second sum of virtual resource values.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the device further comprises:
a third obtaining module, configured to obtain, after each preset time period is ended, a first total virtual resource value of the first account set and a second total virtual resource value of the second account set, where the second total virtual resource value is determined according to virtual resource values corresponding to accounts of the second account set in the first database and the second database;
a comparison module configured to perform a comparison of the first total virtual resource value and the second total virtual resource value;
a resource reward allocation module configured to perform allocation of a resource reward to accounts belonging to the first account set when the first total virtual resource value is greater than the second total virtual resource value; allocating the resource award to accounts belonging to the second set of accounts when the second total virtual resource value is greater than the first total virtual resource value.
In one embodiment, the apparatus further comprises:
the task obtaining module is configured to execute a virtual resource changing task which is obtained from existing virtual resource changing tasks at regular time and has the current state of unfinished state;
an event regeneration module configured to execute the virtual resource change task in the uncompleted state again, and generate a virtual resource change event corresponding to the virtual resource change task in the uncompleted state;
an update module configured to perform storing the virtual resource change event in the first database and updating the second database according to the virtual resource change event.
In one embodiment, the first account set and the second account set interact within at least one preset time period; the device further comprises:
the task obtaining module is configured to execute a virtual resource changing task of which the current state is a finished state from the existing virtual resource changing tasks in a non-preset time period;
a deletion module configured to execute a virtual resource change task of deleting the completed state.
In one embodiment, the storage module is configured to perform asynchronous synchronization of the data processing event to a first message queue, where the first message queue is configured to store the data processing event for a view processor corresponding to the first message queue, and the view processor is configured to process the data processing event, generate first view data corresponding to the first account, and update the first view data to the second database.
In one embodiment, the apparatus further comprises:
an account matching module configured to execute an account set matching request sent in response to any account in the first account set, and send account set information carried in the account set matching request to a second message queue, where the second message queue is used to store the account set information for an account set matching service, and the account set matching service is used to determine, from a pool of candidate account sets, the second account set matching the first account set;
a task starting module configured to execute the interactive task to be executed jointly by the first account set and the second account set in response to an account set matching confirmation request sent by a third account, wherein the third account is any one of the first account set or the second account set.
In one embodiment, the account set matching confirmation request is a request sent by any account periodically and actively.
In one embodiment, the data query request is a request periodically and actively sent by the second account.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of the interactive task as described in any embodiment of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of the interaction task as described in any one of the embodiments of the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, where the computer program is configured to implement, when executed by a processor, the data processing method for an interactive task described in any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
by introducing a CQRS (Command Query response separation) idea and combining an Event Sourcing mode to design and realize system architecture, in the process of executing interaction tasks by a first account set and a second account set, responding to a data processing request sent by the first account set, creating a data processing task corresponding to the data processing request, executing the data processing task, generating a data processing Event corresponding to the data processing task, and using the Event as an engine for state change, the multitask concurrent processing can be realized. And storing the data processing event into a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data into a second database. And after receiving the data query request, querying the second database to obtain target data, and returning the target data to the second account. By performing read-write separation processing, the system has the capability of processing high concurrent data processing requests and data query requests generated when interactive tasks need to be executed by multiple persons, so that the overall performance of the system architecture is improved, and the system architecture has the characteristics of high cohesion, low coupling, clear boundary and strong expansibility.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a diagram illustrating an application environment for a data processing method of an interactive task, according to an illustrative embodiment.
FIG. 2 is a model diagram illustrating an interaction task domain, according to an example embodiment.
FIG. 3 is a flow diagram illustrating a data processing method of an interactive task in accordance with an exemplary embodiment.
FIG. 4 is a flowchart illustrating a process for handling a virtual resource change request in accordance with an illustrative embodiment.
FIG. 5 is a flowchart illustrating a process for handling a virtual resource change task in an incomplete state in accordance with an illustrative embodiment.
FIG. 6 is a schematic diagram illustrating an interactive broadcast station, according to an example embodiment.
FIG. 7 is an interaction diagram illustrating one type of account set matching in accordance with an exemplary embodiment.
FIG. 8 is a flowchart illustrating a data processing method of an interactive task, according to an example embodiment.
Fig. 9 is a schematic diagram illustrating a multi-team PK system, according to an example embodiment.
Fig. 10 is an interaction diagram illustrating a multi-team PK process, according to an example embodiment.
FIG. 11 is a diagram illustrating a PK phase update integration value in accordance with an exemplary embodiment.
FIG. 12 is a block diagram illustrating a data processing device interacting with tasks in accordance with an illustrative embodiment.
FIG. 13 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are both information and data that are authorized by the user or sufficiently authorized by various parties.
The data processing method of the interactive task provided by the present disclosure can be applied to the application environment shown in fig. 1. The application environment comprises n first terminals 110 belonging to a first team, a server 120, m second terminals 130 belonging to a second team. Wherein n and m are any integer greater than 1. The first terminal 110 interacts with the server 120 through the network; the second terminal 130 interacts with the server 120 through the network. The first terminal 110 and the second terminal 130 have installed therein an application program that can be used to perform an interactive task. The applications installed in the first terminal 110 and the second terminal 130 for performing the interactive tasks may be the same application; for example, the application for performing the interactive task in the first terminal 130 is an applet, and the application for performing the interactive task in the second terminal 130 is an applet bound to the instant messaging application.
The server 120 is pre-deployed with an interactive task system supporting the operation of the interactive task. The overall design of the interactive task system is based on a micro-service architecture and by using the thought of domain-driven design, for example, based on a CQRS mode in the domain-driven design and combined with an Event Source (Event tracing) mode for design and implementation.
The domain may represent an integrated interactive task system, or a core domain or a support domain thereof. In domain driven design, a domain is divided into several sub-domains and a domain model is developed in a bounded context.
The subdomains are finer-grained division of the field, and the field is divided into a plurality of subdomains of three general types according to importance and functions, namely a core subdomain, a support subdomain and a general subdomain. The core sub-domain is the main contributing factor to the success of the service, the main competitiveness, which may be one in number. The support sub-region is for supporting the core sub-region and may be plural in number. And the common subdomain is a common part of the service system. Of course, other subfields are not necessary except for the core subfield.
Bound contexts encompass a system, an application, a business service, and a series of complex components that implement a business. A bound context may be contained within one sub-domain or may be contained within multiple sub-domains, such as an interactive task system including an interactive core sub-domain, a matching sub-domain, a team sub-domain, a virtual resource value sub-domain, a wallet sub-domain, a level sub-domain, and so forth. Wherein the content of the first and second substances,
an interaction core sub-domain (namely PK sub-domain) for completing interaction model core data management;
the matching subdomain is used for completing team relation matching;
a team subdomain for completing team, member management, group chat management and the like;
a virtual resource value sub-domain for completing task completion, virtual resource value management, etc.;
a wallet subdomain: for completing account wallet management, team wallet management, etc.;
a level sub-domain: for completing session, level maintenance management, etc.
If the background field of the interactive task system is divided into: interaction context (i.e., PK context), matching context, team context, virtual resource value context, wallet context, level context, then modeling of the interaction task domain may be as shown in fig. 2. Referring to fig. 2, each module bound context is reasonably divided through the idea of domain-driven design, so that each bound context is highly cohesive in the system, and a clear boundary is established for developers to develop functions, interface designs and dependence modes respectively.
Specifically, after creating the interactive tasks for the first team and the second team, the server 130 generates a first set of accounts from the plurality of accounts belonging to the first team and a second set of accounts from the plurality of accounts belonging to the second team. When the server 120 receives a data processing request sent by a first account in a first account set in the process of executing an interactive task by a first team and a second team, creating a data processing task corresponding to the data processing request; and executing the data processing task and generating a data processing event corresponding to the data processing task. The server 120 stores the data processing event in the first database, and generates first data corresponding to the first account according to the data processing event, and updates the first data in the second database. The server 120 queries the second database for target data in response to a data query request of the second account, and returns the target data to the second account, wherein the second account can be any one of the first account set or the second account set.
The first terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices; the server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers; the second terminal 130 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, portable wearable devices.
Of course, the data processing method of the interactive task disclosed by the disclosure can also be applied to interactive tasks executed by more than two teams. The data processing procedure and the data query procedure applied to more than two teams are similar to the procedure applied to two teams for the server, and thus, are not described in detail herein.
Fig. 3 is a flowchart illustrating a data processing method of an interactive task, which is used in a server as illustrated in fig. 3, according to an exemplary embodiment, and includes the following steps.
In step S310, in the process of executing the interactive task by the first account set and the second account set, in response to the data processing request sent by the first account in the first account set, a data processing task corresponding to the data processing request is created.
The first account set refers to a set including all accounts of the first team, and correspondingly, the second account set refers to a set including all accounts of the second team. The first team and the second team are a relative concept, and one of the two teams participating in the interactive task is the first team, and the other is the second team.
The first account may be any account in the first set of accounts. It is understood that the present embodiment is exemplified by a data processing request sent by a first account in the first account set, and for a data processing request from any account in the first account set or the second account set, the server may perform parallel processing on the data processing request in the manner of the present embodiment.
The data processing request is a message sent by the client and requesting data processing. The specific types of data processing are various, and depend on the current execution scenario of the interaction task, for example, when the client where the first account is located obtains the current first account to complete an interaction task, a virtual resource change request for the first account is sent to the server to request the server to add a corresponding virtual resource value to the first account. Or the client of the first account acquires the team name changing operation sent by the first account, and sends a team name changing request to the server to request the server to change the name of the first team.
Specifically, in the process of executing an interaction task by a first account set and a second account set, a server receives a data processing request sent by a first account in the first account set, where the first data processing request carries content such as account information and context information of the first account. The server parses the data processing request through a preset command processor to determine a data processing aggregation instance (i.e. a data processing task). The data processing tasks are characterized using unique data processing task identifiers.
In step S320, a data processing task is executed, and a data processing event corresponding to the data processing task is generated.
Specifically, the server executes a data processing task and generates a series of data processing events corresponding to the data processing task in the process of executing the data processing task.
For example, the data processing request is a team name change request of the first team. After the server receives the team name change request, a team name change task is created by the command processor. The server executes the team name changing task, generates a team name starting changing event, and creates a team name changing command to change the team name. And after the server finishes the change operation, generating a team name change event.
In step S330, the data processing event is stored in the first database, and first data corresponding to the first account is generated according to the data processing event and is updated in the second database.
The first database may be a database for writing data, and may be implemented by one of a relational database, a non-relational database, and the like. The first database stores data processing events generated by processing a plurality of data processing tasks.
The second database may be a database for reading data, and may be implemented by one of a relational database, a non-relational database, and the like. The second database may store data that can be returned directly to the client, for example, a modified name of the first team.
Specifically, after obtaining at least one data processing event corresponding to the data processing task, the server performs persistence processing on the data processing event, and may store the data processing event corresponding to the data processing task in the first database according to the time sequence of the occurrence of the data processing event.
And after the data processing event is subjected to persistence processing, the server asynchronously sends the data processing event corresponding to the data processing task to the event processor. And generating first data according to the data processing event through the event processor, and storing the first data into a second database.
In step S340, in response to the data query request of the second account, the target data is queried from the second database, and the target data is returned to the second account.
The second account may be any one of the first account set or the second account set, and the second account may be the same as or different from the first account.
The data query request may be a request automatically sent by the client where the second account is located, for example, a virtual resource value query request automatically sent periodically; the request can also be a request sent in response to a triggering operation of the user, for example, a history query request of the interaction task is sent to the server when the user is detected to click the history control.
Specifically, after the server receives the data query request from the second account, the data query request is analyzed by the query processor to obtain the relevant index information carried in the data query request. And the query processor retrieves the target data corresponding to the relevant index information from the second database according to the relevant index information, and returns the target data to the second account so as to enable the client side where the second account is located to display the target data.
In the data processing method of the interaction task, by introducing a CQRS thought and combining an Event souring mode to realize the design and implementation of a system architecture, in the process of interacting a first account set and a second account set, responding to a data processing request sent by a first account, creating a data processing task corresponding to the data processing request, executing the data processing task, generating a data processing Event corresponding to the data processing task, and using the Event as an engine of state change, the multitask concurrent processing can be realized. And storing the data processing event into a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data into a second database. And after receiving the data query request, querying the second database to obtain target data, and returning the target data to the second account. By performing read-write separation processing, the system has the capability of processing high concurrent data processing requests and data query requests generated when interactive tasks need to be executed by multiple persons, so that the overall performance of the system is improved, and the system has the characteristics of high cohesion, low coupling, clear boundary and strong expansibility.
In an exemplary embodiment, the data query request is a request periodically and actively sent by the second account.
Specifically, because the front-end page (e.g., HTML5 page, HyperText markup language 5 page) of the interactive task is switched frequently, the user's remaining time is short, and the requirement on the real-time performance of the service data is not particularly strict, in this embodiment, the front-end interacts with the server in a manner of HTTP (HyperText Transfer Protocol) timed polling. For example, a data query request is triggered by default for 10 seconds to request the data of the main page of the interactive task to be refreshed. The interaction between the client and the server is realized by adopting a timing polling mode, and meanwhile, the realizability of the interaction task system can be improved by comprehensively considering the aspects of user magnitude, server cost, difficulty degree of realization and the like.
In an exemplary embodiment, as shown in fig. 4, when the data query requests a virtual resource change request sent after the interactive task is executed for the first account, processing the virtual resource change request may be implemented by:
step S410, in response to the virtual resource change request sent after the first account executes the interactive task, determining a first virtual resource value obtained by the first account executing the interactive task, and creating a virtual resource change task.
The number of the interactive tasks to be executed by each account participating in the interaction may be one or more, for example, three interactive tasks are set to be completed by each account. The virtual resource value may be characterized by an integral value, a virtual currency, and the like. The corresponding relation between the interaction task and the virtual resource value is configured in the server in advance, so that the server can quickly query the virtual resource value corresponding to the currently executed interaction task as the first virtual resource value according to the corresponding relation.
Specifically, each time the first account completes one interactive task, the client where the first account is located may send a virtual resource change request to the server, where the virtual resource change request carries context information corresponding to the currently completed interactive task. The server inquires a virtual resource value corresponding to the currently completed interactive task according to the context information, and analyzes the virtual resource change request through the command processor to determine a virtual resource change aggregation instance (namely a virtual resource change task). The virtual resource change task may be characterized by a unique virtual resource change task identifier.
Step S420, executing the virtual resource changing task, changing the first virtual resource value for the virtual resource of the first account, and generating a virtual resource changing event corresponding to the virtual resource changing task during the execution process.
Wherein, changing the virtual resource value may be decreasing or increasing the virtual resource value, depending on the specific execution condition of the interactive task. For example, if the first account completes a certain interaction task preferentially, the first virtual resource value may be added to the first account; if the account in the second account set completes the interactive task preferentially, the first virtual resource value can be reduced for the first account.
Specifically, the server generates at least one virtual resource change event corresponding to the virtual resource change task in the process of executing the virtual resource change task. For example, after the server receives the virtual resource change request, the virtual resource change task is created by the command handler. The server executes the virtual resource changing task, generates a virtual resource changing starting event, and creates a virtual resource changing command to change the virtual resource value, so as to change the first virtual resource value for the first account virtual resource. And after the change operation is completed, generating a virtual resource change event.
In this embodiment, step S320, storing the data processing event in the first database, generating first data corresponding to the first account according to the data processing event, and updating the first data in the second database includes:
step S430, storing the virtual resource change event in the first database.
Specifically, after obtaining the virtual resource change event, the server performs persistence processing on the virtual resource change event, and may store the virtual resource change event corresponding to the virtual resource change task identifier in the first database according to the time sequence of the occurrence of the virtual resource change event.
Step S440, asynchronously generate a second virtual resource value corresponding to the first account according to the virtual resource change event, and update the second virtual resource value corresponding to the first account into the second database.
Specifically, after the virtual resource change event is subjected to persistence processing, the server asynchronously sends the virtual resource change event corresponding to the virtual resource change task identifier to the event handler. And generating a second virtual resource value corresponding to the second account according to the virtual resource change event through the event processor, and storing the second virtual resource value corresponding to the second account into the second database.
In this embodiment, by using the event as the engine of the state change, concurrent processing of multiple virtual resource change tasks can be realized, and the processing efficiency and accuracy of the virtual resource change tasks are improved. The virtual resource change event is stored in the first database, the second virtual resource value corresponding to the first account is generated according to the virtual resource change event, the second virtual resource value is updated to the second database, and the capacity of the system for processing high-concurrency virtual resource change tasks can be improved by performing read-write separation processing on the change of the virtual resources.
In an exemplary embodiment, the first set of accounts and the second set of accounts interact for at least one preset time period. For example, the effective duration of the interactive task is one month after the interactive task is started. During this month, the first account set and the second account set interact for a preset time period of each day (e.g., 9 am to 22 pm), and the rest of the day does not interact. The method also includes a verification process of a first total virtual resource value of the first account set and a second total virtual resource value of the second account set.
Specifically, the first total virtual resource value of the first account set may be obtained by summing all second virtual resource values currently generated in the second database and belonging to the first account set. For example, if the first account set includes account 1 and account 2, the second virtual resource values corresponding to account 1 that have been generated currently are A1 and A2, and the second virtual resource values corresponding to account 2 that have been generated currently are B, then the first total virtual resource value for the first account set may be the sum of A1, A2 and B. After the server executes a virtual resource change task corresponding to the accounts in the first account set, the first total virtual resource value corresponding to the first account set can be synchronously changed.
Accordingly, the second total virtual resource value of the second account set may be a sum of all third virtual resource values currently generated in the second database and belonging to the second account set. The specific manner of obtaining the third virtual resource value may refer to the manner of obtaining the second virtual resource value of the first account set, which is not described in detail herein. For example, the second account set includes account 3 and account 4, all of the third virtual resource values corresponding to account 3 that have been currently generated are C1, C2, and all of the third virtual resource values corresponding to account 4 that have been currently generated are D1, D2, then the second total virtual resource value for the second account set may be the sum of C1, C2, D1, D2. And after the server executes a virtual resource change task corresponding to the account in the second account set, synchronously changing the first total virtual resource value corresponding to the second account set.
After each preset time period, for example, after 9 am to 22 pm of each day, the server obtains all the currently generated first virtual resource values corresponding to each account in the first account set from the first database after 22 pm of each day, and obtains the sum of all the first virtual resource values. And the server compares the sum of the first virtual resource values with the sum of the second virtual resource values, and replaces the first total virtual resource value in the second database with the sum of the first virtual resource values of the first account set when the sum of the first virtual resource values is different from the sum of the second virtual resource values.
Correspondingly, after each preset time period is finished, the server acquires all the fourth virtual resource values which are generated currently and correspond to each account in the second account set from the first database, and acquires the sum of all the fourth virtual resource values. The specific manner of acquiring the fourth virtual resource value may refer to the manner of acquiring the first virtual resource value of the first account set, which is not described in detail herein. The server compares the sum of the third virtual resource values with the sum of the fourth virtual resource values, and replaces the second total virtual resource value in the second database with the sum of the fourth virtual resource values of the second account set when the sum of the third virtual resource values is different from the sum of the fourth virtual resource values.
In the embodiment, after each preset time period is finished, the total virtual resource value corresponding to each account set is verified, so that the operation pressure of the server in the preset time period can be reduced, and excessive processing resources of the server are not occupied; when the total virtual resource value is different from the standard value (i.e. the first virtual resource value), the total virtual resource value corresponding to the account set is updated, so that the consistency and accuracy of the data can be ensured.
In an exemplary embodiment, the method further comprises: after each preset time period is finished, comparing the first total virtual resource value with the second total virtual resource value; when the first total virtual resource value is greater than the second total virtual resource value, allocating a resource reward to an account belonging to the first account set; allocating a resource award to an account belonging to the second set of accounts when the second total virtual resource value is greater than the first total virtual resource value.
The resource reward can be a red packet reward, a gift reward, a prop reward and the like. The corresponding relation between the virtual resource value and the resource reward is configured in the server in advance, so that the server can quickly inquire the resource reward needing to be distributed according to the corresponding relation.
Specifically, after each preset time period is ended, the server compares a first total virtual resource value corresponding to the first account set with a second total virtual resource value corresponding to the second account set. It is to be understood that the first total virtual resource value and the second total virtual resource value are checked values herein. If the first total virtual resource value is larger than the second total virtual resource value, the first team is the winner, and the account belonging to the first account set is distributed with the resource reward corresponding to the first total virtual resource value. If the first total virtual resource value is less than the second total virtual resource value, the second team is the winner, and the account belonging to the second account set is distributed with the resource reward corresponding to the second total virtual resource value.
Further, after the server determines the winner, the server can also calculate the account set of the winner, the proportion of the virtual resource value of each account to the total virtual resource value, divide the resource rewards according to the proportion, and distribute the divided resource rewards to each account.
In the embodiment, the resource rewards are distributed after each preset time period is finished, so that the running pressure of the server in the preset time period can be reduced, and excessive processing resources of the server are not occupied additionally. By rewarding resources, the enthusiasm of the user for participating in interaction can be improved, and the user retention duration is favorably prolonged.
In an exemplary embodiment, as shown in fig. 5, the method further comprises:
in step S510, a virtual resource change task whose current state is an uncompleted state is periodically acquired from existing virtual resource change tasks.
Specifically, in the process of executing the virtual resource change task, a current state corresponding to the virtual resource change task is marked along with a current processing progress, for example, when the virtual resource change starts, the current state is processing start; when the virtual resource changing operation is in progress, the current state is in progress; and after the virtual resource changing operation is completed, the current state is completed. The server scans the states of the existing virtual resource change tasks at regular time (for example, every 2 seconds), and acquires the virtual resource change task of which the current state is an incomplete state from the existing virtual resource change tasks. The incomplete state may refer to a state other than the completed state.
In step S520, the uncompleted virtual resource change task is re-executed, and a virtual resource change event corresponding to the uncompleted virtual resource change task is generated.
Specifically, the server re-executes the virtual resource change task in an uncompleted state, and generates a series of virtual resource change events corresponding to the virtual resource change task in the execution process. The specific execution process of the virtual resource change task may be according to the above embodiments, and is not specifically described herein.
In step S530, the virtual resource change event is stored in the first database, and the second database is updated according to the virtual resource change event.
Specifically, after obtaining the virtual resource change event, the server performs persistence processing on the virtual resource change event, and may store the virtual resource change event corresponding to the virtual resource change task identifier in the first database according to the time sequence of the occurrence of the virtual resource change event. And after the virtual resource change event is subjected to persistence processing, the server asynchronously sends the virtual resource change event corresponding to the virtual resource change task identifier to the event processor. And generating a second virtual resource value corresponding to the second account according to the virtual resource change event through the event processor, and storing the second virtual resource value corresponding to the second account into the second database.
Furthermore, the server can also change the task identifier and the like by the unique virtual resource to ensure idempotent, so that data errors can not be caused when the task is repeatedly executed.
Further, for other types of tasks, the other types of tasks may be scanned and re-executed in the same manner as described with reference to the present embodiment.
In the embodiment, by adding a task scanning and re-executing mechanism, each created task can be completely executed, so that the accuracy of data in the database can be ensured.
In an exemplary embodiment, the method further comprises: in a non-preset time period, acquiring a virtual resource changing task of which the current state is a finished state from existing virtual resource changing tasks; and deleting the virtual resource changing task in the finished state.
The non-preset time period may refer to any time period except for the preset time period within the effective period of the interactive task, for example, the preset time period is from 9 am to 22 am of each day, and then the non-preset time period may be from 22 am to 9 am of the next day. Specifically, in a non-preset time period, the server scans the current state of the existing virtual resource change task. And acquiring the virtual resource changing task in the finished state at the current state, and deleting the virtual resource changing task in the finished state at the current state.
Further, for other types of tasks, other types of tasks in the completed state may also be deleted in the manner described with reference to this embodiment.
In this embodiment, by performing hard deletion on the virtual resource change task in the completed state, more space can be cleared for the server, which is helpful for increasing the execution speed of the server.
In an exemplary embodiment, storing the data processing event in a first database, and generating first data corresponding to the first account according to the data processing event and updating the first data in a second database includes: and asynchronously synchronizing the data processing events to a first message queue, wherein the first message queue is used for storing the data processing events for a view processor corresponding to the first message queue, and the view processor is used for processing the data processing events, generating first view data corresponding to a first account, and updating the first view data to a second database.
The event backtracking is mainly characterized in that the latest state of the object is not stored, but all events generated by the object are stored, and the latest state of the object is obtained through event backtracking. The data stored based on event backtracking can be stored in the form of view snapshot, so that efficient data query can be realized. The types of views may include a variety of, for example, interactive kiosk views, game detail views, team battle performance views, session detail views, and the like.
In particular, the event handler may include at least one view handler. After the server performs persistent processing on the data processing event, the server asynchronously sends the data processing event corresponding to the data processing task to the first message queue, so that the first message queue stores the data processing event corresponding to the data processing task. And the view processor performs event backtracking on the data processing events according to the generation time of the data processing events by consuming the data processing events in the first message queue, generates first view data corresponding to the first account, and updates the first view data to the second database. For example, if the application includes an interactive broadcast table function, the broadcast table pipeline based on the event may be constructed by using the event of the completed task corresponding to each account in the first account set and the second account set. Since event backtracking usually requires a certain time, an interactive broadcast station data view snapshot is generated by subscribing to a task completion event (as shown in fig. 6), and data in the interactive broadcast station data view snapshot is stored in a cache, so that query efficiency can be improved, and a way for a user to know an interactive task execution process is improved.
In an exemplary embodiment, a process of matching a first set of accounts with a second set of accounts is described. In step S310, before responding to the data processing request sent by the first account in the first account set, the method further includes: responding to an account set matching request sent by any account in the first account set, and sending account set information carried in the account set matching request to a second message queue, wherein the second message queue is used for storing the account set information for an account set matching service, and the account set matching service is used for determining a second account set matched with the first account set from a candidate account set pool; in response to an account set matching confirmation request sent by a third account, the interactive task to be performed jointly by the first account set and the second account set is started, and the third account is any one of the first account set or the second account set.
The candidate account set pool comprises at least one submitted account set matching request and an account set waiting for a matching result. The information related to the account set may include, but is not limited to, information including the number of accounts in the account set, attribute information of the accounts (e.g., gender, region, age, etc.), and the like. The account matching service refers to a service for determining two account sets that match each other. The third account is any one of the first set of accounts or the second set of accounts.
Specifically, the matching process of the account set adopts a synchronous submission request and an asynchronous matching mode. The first account set perspective is used as an example for explanation. After the first team has successfully created, any account in the first account set may send an account set matching request to the server, where the account set matching request includes information about the account set of the first account set. Further, after the account set matching request is sent from any account, the client of any account can send an account set matching confirmation request to the server according to a preset policy to obtain a central account set matching result. The preset policy may be a timed active transmission, for example, an account set matching confirmation request is actively transmitted to the server every 10 seconds.
The server sends the account set-related information for the first account set to the second message queue after receiving the account set matching request, so that the second message queue stores the account set-related information for the account set matching service. Account matching strategies are deployed in the account set matching service in advance, and can be realized based on deep learning theory, search theory and the like. Taking deep learning theory as an example, the corresponding account set feature vector can be generated according to the account set related information of each account set. And calculating the similarity between the account set feature vector of the first account set and the account set feature vector corresponding to each account set in the candidate account set pool by adopting a deep learning model. And taking the account set with the highest similarity as a second account set. And when the server receives an account set matching confirmation request sent from the third account, starting the interactive tasks to be executed jointly by the first account set and the second account set, and sending starting notifications of the interactive tasks to the accounts in the first account set and the second account set.
FIG. 7 illustrates a diagram of matching account sets. As shown in fig. 7, after any account in the first account set reports an account set matching request, the server matches the first account set with a second account set in the candidate account set pool based on an asynchronous matching policy. Meanwhile, when any account in the first account set and the second account set polls a matching result, the server starts the round of interaction tasks.
Further, after the current round of interaction task is started, the server may also automatically initialize interaction task data, for example, issuing a starting virtual resource value for each account, and the like.
In the embodiment, the first account set is matched with the corresponding second account set by adopting a synchronous submission request and an asynchronous matching mode, so that the parallel processing capacity of the server can be improved, the matching speed of the account sets is increased, and the waiting time of a user is shortened.
Fig. 8 is a flowchart illustrating a data processing method of an interactive task according to an exemplary embodiment, for example, the data processing method of the interactive task is applied to the multi-team PK system illustrated in fig. 9. As shown in fig. 9, the multi-team PK system is designed and implemented based on CQRS pattern in domain-driven design, and in combination with Event souring pattern. The read model and the write model of the multi-team PK system are greatly different, for example, the write model can be used for processing the assistance data, team data, point value data, exit account set data, modifying account set name, etc. of a single account; and the reading model can be used for processing the related data of the account sets of the two parties in the current round of competition, including the details of the account sets, the details of the point values, PK reports, field information and the like.
The interaction phases of the client and the server in the process of the multi-team PK shown in fig. 10 are described, as shown in fig. 8, and include the following steps.
An account set creation phase:
in step S802, a first account set and a second account set are created.
Specifically, the enqueue request can be sent to other accounts by means of sharing team link, two-dimensional code invitation enqueue and the like, and after an enqueue confirmation message from other accounts is received, the first account set and the second account set are determined.
And an account set matching stage:
in step S804, in response to an account set matching request sent by any account in the first account set, sending account set information carried in the account set matching request to a second message queue, where the second message queue is used to store the account set information for an account set matching service, and the account set matching service is used to determine, from a candidate account set pool, a second account set matching the first account set.
In step S806, in response to the account set matching confirmation request sent by the third account, the team PK task for the first account set and the second account set is initiated. The third account is any one of the first set of accounts or the second set of accounts.
PK phase (refer to a schematic diagram of PK phase modified integration value shown in fig. 11):
in step S808, in response to the value-of-integration change request transmitted after the first account executes the PK task, the first value of integration obtained by the first account executing the PK task is determined, and the value-of-integration change task is created.
In step S810, the execution of the point change task adds a first integral value to the point of the first account, and during execution, a point change event corresponding to the point change task is generated.
In step S812, the point change event is stored in the first database.
In step S814, the score change event is asynchronously synchronized to a first message queue, where the first message queue is configured to store the score change event for a view processor corresponding to the first message queue, and the view processor is configured to process the score change event, generate first view data corresponding to a first account, and update the first view data to a second database.
In step S816, the point change task in the current state of incomplete state is periodically obtained, the point change task in the incomplete state is executed again, and the first database and the second database are updated according to the obtained point change event.
In step S818, after each preset time period ends, the first total score value corresponding to the first account set and the second total score value corresponding to the second account set in the second database are verified.
And (3) settlement stage:
in step S820, after each preset time period ends, comparing the first total integrated value with the second total integrated value; allocating a resource award to an account belonging to the first set of accounts when the first total credit value is greater than the second total credit value; allocating a resource award to an account belonging to the second set of accounts when the second total credit value is greater than the first total credit value.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
FIG. 12 is a block diagram illustrating a data processing device 1200 of an interactive task, according to an example embodiment. Referring to FIG. 12, the apparatus includes a task creation module 1202, an event generation module 1204, a storage module 1206, and a query module 1208.
A task creating module 1202 configured to perform, in the process of performing an interactive task in the first account set and the second account set, in response to a data processing request sent by a first account in the first account set, creating a data processing task corresponding to the data processing request; an event generating module 1204 configured to execute the execution data processing task and generate a data processing event corresponding to the data processing task; the storage module 1206 is configured to store the data processing event into a first database, generate first data corresponding to the first account according to the data processing event, and update the first data into a second database; and the query module 1208, configured to execute a data query request in response to the second account, query the second database for the target data, and return the target data to the second account, where the second account is any one of the first account set or the second account set.
In an exemplary embodiment, the data processing request is a virtual resource change request, and the event generating module 1204 is configured to execute a virtual resource change task corresponding to the virtual resource change request, add a first virtual resource value to a virtual resource of the first account, and generate a virtual resource change event corresponding to the virtual resource change task.
In an exemplary embodiment, the storage module 1206 includes: a first storage unit configured to perform storing of a virtual resource change event in a first database; a virtual resource value generation unit configured to perform asynchronous generation of a second virtual resource value corresponding to the first account according to the virtual resource change event; a second storage unit configured to perform updating a second virtual resource value corresponding to the first account into a second database.
In an exemplary embodiment, the first set of accounts and the second set of accounts interact for at least one preset time period; the apparatus 1200 further comprises: a first obtaining module configured to obtain a generated second virtual resource value corresponding to the account of the first account set from a second database, and obtain a sum of the second virtual resource values as a first total virtual resource value of the first account set; the second obtaining module is configured to obtain the sum of the first virtual resource values of the first account set after each preset time period is finished; a replacement module configured to perform a replacement of the first total virtual resource value with the first virtual resource value sum when the first virtual resource value sum is different from the second virtual resource value sum.
In an exemplary embodiment, the first set of accounts and the second set of accounts interact for at least one preset time period; the apparatus 1200 further comprises: the third obtaining module is configured to obtain a first total virtual resource value of a first account set and a second total virtual resource value of a second account set after each preset time period is finished, wherein the second total virtual resource value is determined according to virtual resource values corresponding to accounts of the second account set in the first database and the second database; a comparison module configured to perform a comparison of the first total virtual resource value and the second total virtual resource value; a resource reward allocation module configured to perform allocation of a resource reward to accounts belonging to the first account set when the first total virtual resource value is greater than the second total virtual resource value; allocating a resource award to an account belonging to the second set of accounts when the second total virtual resource value is greater than the first total virtual resource value.
In an exemplary embodiment, the apparatus 1200 further comprises: the task obtaining module is configured to execute a virtual resource changing task which is obtained from existing virtual resource changing tasks at regular time and has the current state of unfinished state; the event regeneration module is configured to execute virtual resource changing tasks in an uncompleted state again and generate virtual resource changing events corresponding to the virtual resource changing tasks in the uncompleted state; and the updating module is configured to store the virtual resource change event into the first database and update the second database according to the virtual resource change event.
In an exemplary embodiment, the first set of accounts and the second set of accounts interact for at least one preset time period; the apparatus 1200 further comprises: the task obtaining module is configured to execute a virtual resource changing task in which the current state is a finished state from existing virtual resource changing tasks in a non-preset time period; a deletion module configured to perform a virtual resource change task of deleting the completed state.
In an exemplary embodiment, the storage module 1206 is configured to perform asynchronous synchronization of the data processing event to a first message queue, the first message queue being configured to store the data processing event for a view processor corresponding to the first message queue, the view processor being configured to process the data processing event, generate first view data corresponding to the first account, and update the first view data into a second database.
In an exemplary embodiment, the apparatus 1200 further comprises: the account matching module is configured to execute an account set matching request sent by any account in the first account set, and send account set information carried in the account set matching request to a second message queue, wherein the second message queue is used for storing the account set information for an account set matching service, and the account set matching service is used for determining a second account set matched with the first account set from a candidate account set pool; and the task starting module is configured to execute an interactive task to be executed by the first account set and the second account set together in response to an account set matching confirmation request sent by a third account, wherein the third account is any one of the first account set or the second account set.
In an exemplary embodiment, the account set matching confirmation request is a request that is sent by any account periodically and actively.
In an exemplary embodiment, the data query request is a request periodically and actively sent by the second account.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 13 is a block diagram illustrating an electronic device S00 for data processing of interactive tasks, according to an example embodiment. For example, the electronic device S00 may be a server. Referring to FIG. 13, electronic device S00 includes a processing component S20 that further includes one or more processors and memory resources represented by memory S22 for storing instructions, such as applications, that are executable by processing component S20. The application program stored in the memory S22 may include one or more modules each corresponding to a set of instructions. Further, the processing component S20 is configured to execute instructions to perform the method of data processing of the above-described interaction task.
The electronic device S00 may also include a power supply assembly S24 configured to perform power management of the electronic device S00, a wired or wireless network interface S26 configured to connect the electronic device S00 to a network, and an input-output (I/O) interface S28. The electronic device S00 may operate based on an operating system stored in the memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory S22 comprising instructions, executable by the processor of the electronic device S00 to perform the above method is also provided. The storage medium may be a computer-readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises a computer program, which when executed by a processor implements the data processing method of the interaction task described in any of the above embodiments.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A data processing method of an interactive task is characterized by comprising the following steps:
in the process of executing an interactive task by a first account set and a second account set, responding to a data processing request sent by a first account in the first account set, and creating a data processing task corresponding to the data processing request;
executing the data processing task and generating a data processing event corresponding to the data processing task;
storing the data processing event into a first database, generating first data corresponding to the first account according to the data processing event, and updating the first data into a second database;
and responding to a data query request of a second account, querying target data from the second database, and returning the target data to the second account, wherein the second account is any one of the first account set or the second account set.
2. The method for processing data of an interactive task according to claim 1, wherein the data processing request is a virtual resource change request, and the executing the data processing task generates a data processing event corresponding to the data processing task includes,
and executing a virtual resource changing task corresponding to the virtual resource changing request, changing a first virtual resource value for the virtual resource of the first account, and generating a virtual resource changing event corresponding to the virtual resource changing task.
3. The data processing method of the interactive task according to claim 2, wherein the storing the data processing event in a first database, and generating first data corresponding to the first account according to the data processing event and updating the first data in a second database comprises:
storing the virtual resource change event in the first database;
and according to the virtual resource change event, asynchronously generating a second virtual resource value corresponding to the first account, and updating the second virtual resource value corresponding to the first account into the second database.
4. The data processing method of an interaction task of claim 3, wherein the first set of accounts and the second set of accounts interact for at least one preset time period; the method further comprises the following steps:
acquiring a generated second virtual resource value corresponding to the account of the first account set from the second database, and acquiring the sum of the second virtual resource values as a first total virtual resource value of the first account set;
after each preset time period is finished, acquiring the sum of first virtual resource values of the first account set;
when the sum of the first virtual resource values is different from the sum of the second virtual resource values, replacing the first total virtual resource value with the sum of the first virtual resource values.
5. The data processing method of an interaction task of claim 3, wherein the first set of accounts and the second set of accounts interact for at least one preset time period; the method further comprises the following steps:
after each preset time period is finished, acquiring a first total virtual resource value of the first account set and a second total virtual resource value of the second account set, wherein the second total virtual resource value is determined according to virtual resource values corresponding to accounts of the second account set in the first database and the second database;
comparing the first total virtual resource value with the second total virtual resource value, and when the first total virtual resource value is greater than the second total virtual resource value, allocating a resource reward to an account belonging to the first account set;
allocating the resource award to accounts belonging to the second set of accounts when the second total virtual resource value is greater than the first total virtual resource value.
6. The data processing method of an interactive task according to claim 2, characterized in that the method further comprises:
acquiring a virtual resource changing task with a current state being an unfinished state from existing virtual resource changing tasks at regular time;
re-executing the virtual resource changing task in the uncompleted state, and generating a virtual resource changing event corresponding to the virtual resource changing task in the uncompleted state;
storing the virtual resource change event in the first database, and updating the second database according to the virtual resource change event.
7. A data processing apparatus for interactive tasks, comprising:
the task creating module is configured to respond to a data processing request sent by a first account in a first account set in the process of executing an interactive task in the first account set and a second account set, and create a data processing task corresponding to the data processing request;
the event generation module is configured to execute the data processing task and generate a data processing event corresponding to the data processing task;
the storage module is configured to store the data processing event into a first database, generate first data corresponding to the first account according to the data processing event, and update the first data into a second database;
and the query module is configured to execute data query requests responding to a second account, query target data from the second database and return the target data to the second account, wherein the second account is any one of the first account set or the second account set.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of the interaction task of any of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of the interaction task of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the data processing method of the interaction task of any one of claims 1 to 6.
CN202110846821.7A 2021-07-26 2021-07-26 Data processing method and device for interactive task, electronic equipment and storage medium Active CN113476853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110846821.7A CN113476853B (en) 2021-07-26 2021-07-26 Data processing method and device for interactive task, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110846821.7A CN113476853B (en) 2021-07-26 2021-07-26 Data processing method and device for interactive task, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113476853A true CN113476853A (en) 2021-10-08
CN113476853B CN113476853B (en) 2023-10-03

Family

ID=77943815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110846821.7A Active CN113476853B (en) 2021-07-26 2021-07-26 Data processing method and device for interactive task, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113476853B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217899A (en) * 2021-12-15 2022-03-22 平安国际智慧城市科技股份有限公司 Data persistence method and device, electronic equipment and storage medium
CN117632922A (en) * 2023-11-22 2024-03-01 东风日产数据服务有限公司 Service operation platform based on high concurrency task processing and data processing method
CN117632922B (en) * 2023-11-22 2024-04-30 东风日产数据服务有限公司 Service operation platform based on high concurrency task processing and data processing method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815218A (en) * 2015-11-27 2017-06-09 华为技术有限公司 Data bank access method, device and Database Systems
US20180150504A1 (en) * 2016-11-30 2018-05-31 Sap Se Write Access Control in a Database
CN108121782A (en) * 2017-12-18 2018-06-05 新华三云计算技术有限公司 Distribution method, database middleware system and the electronic equipment of inquiry request
CN109241067A (en) * 2018-08-21 2019-01-18 中国平安人寿保险股份有限公司 transaction data management method and device
CN110827001A (en) * 2019-11-07 2020-02-21 深圳乐信软件技术有限公司 Accounting event bookkeeping method, system, equipment and storage medium
CN111611308A (en) * 2020-06-11 2020-09-01 上海乾臻信息科技有限公司 Information processing method, device and system
US20210064503A1 (en) * 2019-08-29 2021-03-04 Snowflake Inc. Decoupling internal and external tasks in a database environment
CN112667716A (en) * 2020-12-30 2021-04-16 京东数字科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN113076343A (en) * 2021-04-30 2021-07-06 北京京东振世信息技术有限公司 Data query method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815218A (en) * 2015-11-27 2017-06-09 华为技术有限公司 Data bank access method, device and Database Systems
US20180150504A1 (en) * 2016-11-30 2018-05-31 Sap Se Write Access Control in a Database
CN108121782A (en) * 2017-12-18 2018-06-05 新华三云计算技术有限公司 Distribution method, database middleware system and the electronic equipment of inquiry request
CN109241067A (en) * 2018-08-21 2019-01-18 中国平安人寿保险股份有限公司 transaction data management method and device
US20210064503A1 (en) * 2019-08-29 2021-03-04 Snowflake Inc. Decoupling internal and external tasks in a database environment
CN110827001A (en) * 2019-11-07 2020-02-21 深圳乐信软件技术有限公司 Accounting event bookkeeping method, system, equipment and storage medium
CN111611308A (en) * 2020-06-11 2020-09-01 上海乾臻信息科技有限公司 Information processing method, device and system
CN112667716A (en) * 2020-12-30 2021-04-16 京东数字科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN113076343A (en) * 2021-04-30 2021-07-06 北京京东振世信息技术有限公司 Data query method, device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217899A (en) * 2021-12-15 2022-03-22 平安国际智慧城市科技股份有限公司 Data persistence method and device, electronic equipment and storage medium
CN114217899B (en) * 2021-12-15 2023-10-17 深圳平安智慧医健科技有限公司 Data persistence method, device, electronic equipment and storage medium
CN117632922A (en) * 2023-11-22 2024-03-01 东风日产数据服务有限公司 Service operation platform based on high concurrency task processing and data processing method
CN117632922B (en) * 2023-11-22 2024-04-30 东风日产数据服务有限公司 Service operation platform based on high concurrency task processing and data processing method

Also Published As

Publication number Publication date
CN113476853B (en) 2023-10-03

Similar Documents

Publication Publication Date Title
US9740761B2 (en) Management of application state data
US11213760B2 (en) Managing game sessions in a social network system
US11058946B2 (en) System and method for managing event data in a multi-player online game
CN102449602A (en) System and method for reducing startup cost of a software application
CN102449628A (en) Architectural pattern for persistent web application design
CN106325978A (en) Distributed transaction processing method and apparatus
US10147042B2 (en) Synchronization for context-aware complex event processing
US20180280812A1 (en) Managing game sessions in a social network messaging system
CN103765387A (en) Distributed resource management in a portable computing device
EP3507705B1 (en) Query restartability
CN111625353B (en) Virtual resource distribution processing method, device, server and storage medium
CN110908793A (en) Long-time task execution method, device, equipment and readable storage medium
CN110377611B (en) Method and device for ranking scores
CN113476853B (en) Data processing method and device for interactive task, electronic equipment and storage medium
CN110233843B (en) User request processing method and device
US11797697B1 (en) Sharing with multiple people access to one or more resources each conveyed in a single NFT
CN113238860B (en) Task request processing method and device, electronic equipment and storage medium
CN110354504B (en) Method, device, server and storage medium for obtaining matching group
CN113157714A (en) List data updating method and device, electronic equipment and storage medium
Seputra et al. A Design of Patient Registration Apps using Flutter, Laravel and, Vue JS
Singh et al. Priority Heuristic in MDRTDBS
CN112925578B (en) Task processing method, device and storage medium
CN115297336B (en) Task processing method and device, electronic equipment, storage medium and program product
WO2014173105A1 (en) Systems and methods for reward issuance
US11941421B1 (en) Evaluating and scaling a collection of isolated execution environments at a particular geographic location

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant