Activity data control method and device in game, storage medium and electronic equipment

CN117180728BActive Publication Date: 2026-11-03SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311206397.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2026-11-03
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

In existing technologies, operational activities are difficult to scale horizontally in modern distributed game servers, and these activities exist as single points of failure, which means that the entire service becomes unavailable once a failure occurs, affecting the user experience.

Method used

By using the registration mechanism of the global activity controller and the local activity controller, and employing a distributed consistent hashing algorithm to determine the activity handle, the synchronization of activity data and status is achieved. Role business nodes can directly access the local controller to obtain data, reducing remote communication.

Benefits of technology

It solves the problem of single point of failure in distributed game servers for operational activities, improves disaster recovery capabilities, reduces the complexity of game business development, reduces the amount of internal communication in the server cluster, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117180728B_ABST
    Figure CN117180728B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a game activity data control method and device, a storage medium and an electronic device, and relates to the technical field of computers. The method comprises the following steps: determining a target operation activity for a target game, and registering a global activity handle of the target operation activity to a global activity controller and registering a local activity handle of the target operation activity to a local activity controller; in response to a global service node executing the target operation activity, acquiring activity data and an activity state related to the target operation activity through the global activity controller, and synchronizing the acquired activity data and the activity state to the local activity controller through the global activity controller, so that a role service node can execute a specified game service by accessing the local activity controller to acquire the activity data and the activity state. The present disclosure reduces the complexity of game service development and reduces the communication volume within a game server cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for controlling activity data in a game, a device for controlling activity data in a game, a storage medium, and an electronic device. Background Technology

[0002] Operational activities refer to a series of periodic and seasonal functions within a game designed to improve user retention or monetization. Many online games hold operational activities to boost operational data and improve operational quality. Operational activities come in various forms and are characterized by being developed once and used multiple times.

[0003] In related technologies, activity templates are pre-developed, and then different activity parameters are configured according to operational needs. The management of activity templates and parameters generally adopts a centralized approach, existing as a single point on the server, which is difficult to scale horizontally and is unsuitable for modern distributed game servers. In contrast, a server cluster consists of multiple machines and multiple processes, each process containing one or more services, with the single point being that only one service in the server cluster is used to manage operational activities.

[0004] Therefore, a new method for controlling activity data in games is needed.

[0005] It should be noted that the information in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] This disclosure provides a method for controlling activity data in a game, a device for controlling activity data in a game, a storage medium, and an electronic device, thereby overcoming, to at least a certain extent, the problem that operational activities in related technologies are not applicable to modern distributed game servers due to limitations and defects in related technologies.

[0007] According to one aspect of this disclosure, a method for controlling activity data in a game is provided, comprising:

[0008] Identify the target operational activity for the target game, and register the global activity handle of the target operational activity to the global activity controller and the local activity handle of the target operational activity to the local activity controller;

[0009] In response to the global business node executing the target operation activity, the global activity controller obtains the activity data and activity status related to the target operation activity, and synchronizes the obtained activity data and activity status to the local activity controller, so that the character business node can execute the specified game business by accessing the local activity controller to obtain the activity data and activity status.

[0010] In one exemplary embodiment of this disclosure, registering the global activity handle of the target operational activity to the global activity controller includes:

[0011] Determine the global activity handle for executing the global business logic of the target operational activity;

[0012] Obtain the activity type number of the target operation activity, perform hash calculation on the activity type number using a distributed consistent hash algorithm, and determine the global activity controller that matches the target operation activity;

[0013] Register the global activity handle to the global activity controller.

[0014] In one exemplary embodiment of this disclosure, registering the local activity handle of the target operational activity to the local activity controller includes:

[0015] Obtain the character business node in the server that executes the game business corresponding to the target operation activity, and the local activity handle of the character business node that executes the character business logic of the target operation activity;

[0016] Register the local activity handle to the local activity controller of the role business node that executes the target operational activity.

[0017] In one exemplary embodiment of this disclosure, the global business node executes the target operational activity, including:

[0018] The global activity controller acquires the activity data of the target operation activity, and obtains the time configuration data of the target operation activity based on the activity data;

[0019] The global business node executes the target operational activity based on the time configuration data.

[0020] In one exemplary embodiment of this disclosure, the global business node executes the target operational activity according to the time configuration data, including:

[0021] The global activity controller in the global business node obtains the current activity status of the target operation activity based on the time configuration data and the current time.

[0022] Based on the time parameter of the second activity state in the time configuration data, a timer is configured for the second activity state, and the target operation activity is executed based on the timer; wherein, the second activity state is the next activity state of the current activity state.

[0023] In one exemplary embodiment of this disclosure, after obtaining the current activity status of the target operational activity, the method further includes:

[0024] The activity data of the target operation and the current activity status are synchronized to the global activity controller.

[0025] In one exemplary embodiment of this disclosure, executing the target operational activity based on the timer includes:

[0026] The timer triggers the switch from the current activity state to the second activity state.

[0027] The state callback function corresponding to the second activity state of the global activity handle is invoked, and the global business logic corresponding to the target operation activity is triggered through the state callback function.

[0028] In one exemplary embodiment of this disclosure, after executing the global business logic corresponding to the target operational activity through the state callback function, the method further includes:

[0029] The activity data of the target operational activity is updated to obtain updated activity data.

[0030] In one exemplary embodiment of this disclosure, obtaining activity data and activity status related to the target operational activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller via the global activity controller, includes:

[0031] The updated activity data and the second activity status are synchronized to the local activity controller of the role's business node.

[0032] In one exemplary embodiment of this disclosure, a character service node executes a specified game service by accessing the local activity controller to obtain the activity data and activity status, including:

[0033] The local activity controller of the role business node calls the status callback function corresponding to the second activity state of the local activity handle according to the updated activity data and the second activity state;

[0034] The role business logic for executing the target operational activity is triggered by the status callback function corresponding to the second activity status.

[0035] According to one aspect of this disclosure, a device for controlling activity data in a game is provided, comprising:

[0036] The activity handle registration module is used to determine the target operation activity for the target game, and register the global activity handle of the target operation activity to the global activity controller and the local activity handle of the target operation activity to the local activity controller;

[0037] The operation activity implementation module is used to respond to the global business node executing the target operation activity by obtaining activity data and activity status related to the target operation activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller through the global activity controller, so that the role business node can obtain the activity data and activity status by accessing the local activity controller to execute the specified game business.

[0038] According to one aspect of this disclosure, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the activity data control method in a game as described in any of the exemplary embodiments above.

[0039] According to one aspect of this disclosure, an electronic device is provided, comprising:

[0040] Processor; and

[0041] Memory for storing the executable instructions of the processor;

[0042] The processor is configured to execute the activity data control method in the game according to any of the above exemplary embodiments by executing the executable instructions.

[0043] This disclosure provides a method for controlling activity data in a game. It determines a target operational activity for a target game, registers a global activity handle for the target operational activity with a global activity controller, and registers a local activity handle for the target operational activity with a local activity controller. In response to the global business node executing the target operational activity, it obtains activity data and activity status related to the target operational activity through the global activity controller, and synchronizes the obtained activity data and activity status to the local activity controller, enabling the character business node to execute a specified game service by accessing the activity data and activity status from the local activity controller. On one hand, by using both global and character business nodes, a target operational activity for the target game is implemented, solving the problem of operational activities existing in a single-point form in related technologies. On the other hand, by synchronizing the activity data and activity status related to the operational activity from the global activity controller to the local activity controller, the character business node does not need to communicate remotely with the global business node again when executing a specified game service; it only needs to access the activity data and activity status obtained from the local activity controller, reducing the complexity of game service development and the communication volume within the game server cluster.

[0044] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0046] Figure 1 The flowchart illustrates an activity data control method in a game according to an example embodiment of the present disclosure.

[0047] Figure 2 The diagram schematically illustrates a block diagram of an activity data control system in a game according to an example embodiment of the present disclosure.

[0048] Figure 3 The diagram illustrates a method flowchart for registering a global activity handle of a target operational activity to a global activity controller according to an example embodiment of the present disclosure.

[0049] Figure 4 The diagram illustrates a method flowchart for registering a local activity handle of a target operational activity to a local activity controller according to an example embodiment of the present disclosure.

[0050] Figure 5 This schematically illustrates a flowchart of a method for a global business node to perform a target operational activity according to an example embodiment of the present disclosure.

[0051] Figure 6 The flowchart illustrates a method for a global business node to perform target operational activities based on time configuration data, according to an example embodiment of the present disclosure.

[0052] Figure 7 The flowchart illustrates a method for performing a target operational activity based on a timer, according to an example embodiment of the present disclosure.

[0053] Figure 8 The flowchart illustrates a method for a role-based service node to execute a specified game service by accessing a local activity controller to obtain activity data and activity status, according to an example embodiment of the present disclosure.

[0054] Figure 9 The flowchart illustrates an activity data control method in a game according to an example embodiment of the present disclosure.

[0055] Figure 10 The diagram schematically illustrates a block diagram of an activity data control device in a game according to an example embodiment of the present disclosure.

[0056] Figure 11 An electronic device for controlling activity data in a game is illustrated schematically according to an exemplary embodiment of the present invention. Detailed Implementation

[0057] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make the invention more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of the invention. However, those skilled in the art will recognize that the technical solutions of the invention may be practiced with one or more of these specific details omitted, or other methods, components, apparatus, steps, etc., may be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the invention.

[0058] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0059] This example embodiment first provides a method for controlling activity data in a game, referencing... Figure 1 As shown, the following steps may be included:

[0060] Step S110. Determine the target operation activity for the target game, and register the global activity handle of the target operation activity to the global activity controller and register the local activity handle of the target operation activity to the local activity controller;

[0061] Step S120. In response to the global business node executing the target operation activity, obtain the activity data and activity status related to the target operation activity through the global activity controller, and synchronize the obtained activity data and activity status to the local activity controller through the global activity controller, so that the character business node can execute the specified game business by accessing the local activity controller to obtain the activity data and activity status.

[0062] The aforementioned activity data control method in the game identifies a target operational activity for the target game and registers the global activity handle of the target operational activity with the global activity controller and the local activity handle of the target operational activity with the local activity controller. In response to the global business node executing the target operational activity, the method obtains activity data and activity status related to the target operational activity through the global activity controller and synchronizes the obtained activity data and activity status to the local activity controller, enabling the character business node to execute specified game services by accessing the activity data and activity status from the local activity controller. On one hand, by implementing a target operational activity for the target game through global and character business nodes, the method solves the problem of operational activities existing in a single-point form in related technologies. On the other hand, by synchronizing the activity data and activity status related to the operational activity from the global activity controller to the local activity controller, the character business node does not need to communicate remotely with the global business node again when executing specified game services; it only needs to access the activity data and activity status obtained from the local activity controller, reducing the complexity of game service development and the communication volume within the game server cluster.

[0063] The following provides a detailed explanation and description of each step involved in the activity data control method in the game according to the example embodiment of this disclosure.

[0064] First, the application scenarios and purposes of the exemplary embodiments of this disclosure are explained and described. Specifically, the exemplary embodiments of this disclosure can ensure that operational activities within a game server cluster are executed correctly, on time, in sequence, and according to their lifecycle, and improve disaster recovery capabilities. The main research focuses on how to implement operational activities within a game server cluster, how to reduce the complexity of game business development, and how to reduce the communication volume within the game server cluster while implementing these activities.

[0065] In this disclosure, based on the target operational activity, a global activity handle and a local activity handle corresponding to the target operational activity are determined. The global activity handle is registered to the global activity controller of the business node to be globalized, and the local activity handle is registered to the local activity controller. After registration, the business node executes the target operational activity through the global activity controller and the global activity handle. During the execution of the target operational activity, the global activity controller synchronizes the activity data and activity status of the target operational activity to the local activity controller of the role business node. The role business node executes the specified game business according to the synchronized activity data and activity status.

[0066] Secondly, the activity data control system in the game involved in the embodiments of this disclosure will be explained and described. (Reference) Figure 2 As shown, the activity data control system in this game may include a database 210, multiple global business nodes 220, and multiple character business nodes 230. Each global business node 220 includes a global activity controller 221 and a global activity handle 222; each global business node 220 may include one or more global activity handles 222. Each character business node 230 includes a local activity controller 231 and a local activity handle 232; each character business node 230 may include one or more local activity handles 232. The database 230 stores the activity data of the target operation activity. The global nodes 220 retrieve the activity data of the target operation activity from the database 210, execute the global business logic of the target operation activity based on the activity data, and synchronize the activity data and activity status to the local nodes 230. The character business nodes 230 execute specified game operations based on the synchronized activity data and activity status.

[0067] The following will combine Figure 2 A detailed explanation and description of steps S110 and S120 are provided.

[0068] In step S110, a target operational activity for the target game is determined, and the global activity handle of the target operational activity is registered to the global activity controller and the local activity handle of the target operational activity is registered to the local activity controller.

[0069] In this example embodiment, there may be one or more operational activities with different opening durations within the game at the same time. The content of each operational activity will vary depending on the server progress. The number of target operational activities obtained can be one or more, and this example embodiment does not impose a specific limitation on this.

[0070] In this example embodiment, after the target operational activity is determined, the global activity handle of the target operational activity can be registered to the global activity controller, and the local activity handle of the target operational activity can be registered to the local activity controller.

[0071] Specifically, since the server cluster includes multiple global business nodes and multiple role business nodes, each global business node and role business node is independent of each other. After the global activity handle and local activity handle of the target operation activity are registered in the global activity controller of the global business node and the local activity controller of the role business node, respectively, the global business node knows which role business node to transmit activity data to.

[0072] The game server cluster has multiple global business nodes 220. Each global business node represents a process. Each global business node has a global activity controller deployed on it. Each global activity controller is independent of each other and is only responsible for the lifecycle management of the global activity handles registered on it.

[0073] In a game server cluster, multiple global activity controllers exist. These controllers synchronize their liveness status via heartbeats. When one instance of a global activity controller fails and exits, other instances will detect this and migrate the global activity handles managed by the failed instance. For example, instances can send heartbeats to each other; if a heartbeat times out, the instance is considered to have failed. Alternatively, middleware such as ETCD (a distributed, consistent storage system for shared configuration and service discovery), Zookeeper (an open-source distributed application coordination service), and Redis (Remote Dictionary Server) can be used to synchronize changes in the server cluster's topology. When an instance fails, the new topology information is synchronized to other nodes, allowing them to detect the failure. In this example embodiment, the failure detection method is not specifically limited. After a process in the server cluster detects a failure in an instance, a normal process can be selected through methods such as manager specification, election algorithms, and rehashing. A new service instance is then generated on this normal process. In this example embodiment, the failure migration method is not specifically limited. When a service is not a single point, that is, when there are multiple instances of the service executing the same code and handling the same business, these instances are independent of each other and provide interfaces to the outside world through distributed consistent hashing algorithms, round-robin, random placement, etc., to jointly provide services.

[0074] For example, the game server cluster has three global business nodes, running on different machines, each with a global activity controller instance, designated G1, G2, and G3; and four character business nodes, also running on different machines, each with a local activity controller instance, designated L1, L2, L3, and L4. Currently, the game has two types of operational activities: Activity A: During the activity, a monster is generated, and rewards are distributed based on player damage dealt to the monster; Activity B: During the activity, the experience points gained by players are doubled.

[0075] After the game server cluster starts, the global activity handle of activity A is registered to the global activity controller G1, the global activity handle of activity B is registered to the global activity controller G2, and there is no global activity handle on G3. If G1 fails, after G2 and G3 detect the failure, they will re-register the global activity handle of activity A to either G2 or G3 and reload the stored data.

[0076] refer to Figure 3 As shown, registering the global activity handle of the target operational activity to the global activity controller may include:

[0077] Step S310. Determine the global activity handle for executing the global business logic of the target operational activity;

[0078] Step S320. Obtain the activity type number of the target operation activity, perform hash calculation on the activity type number using a distributed consistent hash algorithm, and determine the global activity controller that matches the target operation activity;

[0079] Step S330. Register the global activity handle to the global activity controller.

[0080] The following will further explain and illustrate steps S310-S330. Specifically, firstly, the global activity handle for executing the global business logic of the target operational activity in the server cluster is determined; then, within the game server cluster, each global activity controller obtains a unique number within the cluster through a distributed consistent hash algorithm. For the target operational activity, its activity type number needs to be obtained. Based on the activity type number of the target operational activity, the unique number of the corresponding global activity controller can be determined through a distributed consistent hash algorithm. After determination, the global activity handle is registered to the global activity handle corresponding to the unique number.

[0081] refer to Figure 4 As shown, registering the local activity handle of the target operational activity to the local activity controller may include:

[0082] Step S410. Obtain the character business node in the server that executes the game business corresponding to the target operation activity, and the local activity handle of the character business node that executes the character business logic of the target operation activity;

[0083] Step S420. Register the local activity handle to the local activity controller of the role business node that executes the target operation activity.

[0084] The following will further explain and illustrate steps S410 and S420. Specifically, since the server cluster includes multiple role business nodes, the server first obtains the role business node of the game business corresponding to the target operation activity in the server cluster, as well as the local activity handle of the role business logic of the role business node executing the target operation activity; after obtaining the local activity handle of the role business logic, the local activity handle is registered in the corresponding local activity controller.

[0085] In this example embodiment, the use of global business nodes and role-based business nodes solves the problem in related technologies where operational activities exist as single points of failure and all operational activities become unavailable in the event of a failure, facilitating the horizontal expansion of the game and improving disaster recovery capabilities.

[0086] In step S120, in response to the global business node executing the target operation activity, the global activity controller obtains the activity data and activity status related to the target operation activity, and synchronizes the obtained activity data and activity status to the local activity controller, so that the role business node can execute the specified game business by accessing the local activity controller to obtain the activity data and activity status.

[0087] In this example embodiment, the global business node executes the global business logic of the target operation activity through its global activity handle, and the role business node executes the role business logic of the target operation activity through its local activity handle, so as to complete the game business corresponding to the target operation activity.

[0088] refer to Figure 5 As shown, the global business node executing the target operational activity may include:

[0089] Step S510. The global activity controller acquires the activity data of the target operation activity, and obtains the time configuration data of the target operation activity based on the activity data;

[0090] Step S520. The global business node executes the target operation activity according to the time configuration data.

[0091] The following will further explain and illustrate steps S510 and S520. Specifically, after the global activity handle is successfully registered, the global activity controller loads the activity data of the target operation activity and obtains the time configuration data of the target operation activity based on the configuration data in the activity data. After obtaining the time configuration data, the global business node can execute the target operation activity according to the time configuration data. The time configuration data refers to the time corresponding to different activity states of the target operation activity. The configuration data may include the opening time, settlement time, etc., of the target operation activity, or numerical configurations related to the gameplay of the target operation activity, such as reward configurations, monster configurations, etc. In this example embodiment, the configuration data is not specifically limited. The configuration data may also include stored data, which is a series of data generated during the target operation activity that needs to be persistently saved, such as activity progress, user operation records, random results, etc. This type of data is non-renewable and needs to be saved in a timely manner so that it can be reloaded and restored after the server cluster restarts or instance failure migration. The stored data can also be activity data from a certain period of time ago. Since this type of data is used for in-game display, when the target global activity controller obtains this type of data, it can synchronize the stored data to the local node. For example: leaderboard data corresponding to activities that ended last week needs to be publicized; or the basis for restoring the activity status recorded in the character data when a character returns after a long period of inactivity; or a character who received an activity task last week needs to have it cleaned up and rewards reissued when logging in this week, etc. This example embodiment does not make specific limitations on this.

[0092] Further reference Figure 6 As shown, the global business node executes the target operational activity based on the time configuration data, which may include:

[0093] Step S610. The global activity controller in the global business node obtains the current activity status of the target operation activity based on the time configuration data and the current time;

[0094] Step S620. Configure a timer for the second activity state according to the time parameter of the second activity state in the time configuration data, and execute the target operation activity based on the timer; wherein, the second activity state is the next activity state of the current activity state.

[0095] The following will further explain and illustrate steps S610 and S620. Specifically, after obtaining the time configuration data for the target operational activity, when the server starts, the global activity controller in the global business node calculates the current activity state of the target operational activity based on the current time and the time configuration data, and configures a corresponding timer based on the time parameter of the next state, i.e., the second activity state, and executes the target operational activity based on the timer. The activity state of the target operational activity can be activity start, end, settlement, etc., but in this example embodiment, the state of the target operational activity is not specifically limited.

[0096] Once the global activity controller of the global business node obtains the activity data of the target operational activity, it can synchronize the activity data to the local activity controller of the role business node.

[0097] Further, refer to Figure 7 As shown, executing the target operational activity based on the timer may include:

[0098] Step S710. Trigger the switching of the current activity state to the second activity state using the timer;

[0099] Step S720. Call the state callback function corresponding to the second activity state of the global activity handle, and trigger the execution of the global business logic corresponding to the target operation activity through the state callback function.

[0100] The following will further explain and illustrate steps S710 and S720. Specifically, when the time parameter of the second activity state is reached, a timer triggers a change in the current activity state, modifying it to the second activity state. When the activity state changes, the global activity controller calls the state callback function of the global activity handle. Through this state callback function and the stored data in the acquired activity data, the global business node is triggered to execute the global business logic corresponding to the target operation activity. For example, this could be triggering a series of lifecycle activities such as target operation activity initialization and activity settlement, which is not limited in this example embodiment. The state callback function is the callback function corresponding to the second activity state. For example, when the second activity state is "activity start," the state callback function can be the activity start callback function. This timer ensures the normal transition of the activity state of the target operation activity.

[0101] In this example embodiment, after executing the global business logic corresponding to the target operational activity through the state callback function, the activity data control method in the game further includes:

[0102] The activity data of the target operational activity is updated to obtain updated activity data.

[0103] Specifically, when executing the corresponding global business logic through the global activity handle, the activity data may be modified. Therefore, it is necessary to update the activity data of the target operational activity to obtain the updated activity data.

[0104] After receiving updated activity data, the global activity controller retrieves relevant activity data and activity status for the target operational activity, and synchronizes the retrieved activity data and activity status to the local activity controller via the global activity controller. This process may include:

[0105] The updated activity data and the second activity status are synchronized to the local activity controller of the role's business node.

[0106] Specifically, after receiving the updated activity data, the global activity controller can synchronize the updated activity data and second-state data to the local activity controller of the role's business node via RPC (Remote Procedure Call) communication. After data synchronization, refer to... Figure 8 As shown, the character service node executes specified game services by accessing the local activity controller to obtain activity data and activity status, which may include:

[0107] Step S810. The local activity controller of the role business node calls the status callback function corresponding to the second activity state of the local activity handle according to the updated activity data and the second activity state;

[0108] Step S820. Trigger the role business logic for executing the target operation activity by using the status callback function corresponding to the second activity state.

[0109] The following will further explain and illustrate steps S810 and S820. Specifically, after the local activity controller of the role business node obtains the updated activity data and the second activity status, it stores the updated activity data and the second activity status. It then compares the updated activity data and the second activity status with the activity data and the current activity status obtained when the server starts. When it finds that the updated activity data and the second activity data have changed, it calls the status callback function corresponding to the second activity status of the local activity handle. This allows the local activity handle to trigger the role business node to execute the role business logic corresponding to the target operational activity through the status callback function, based on the updated activity data, to complete the corresponding game business. The local activity controller acts as a local cache for the role business node. When the game business needs to access activity data, it can directly obtain it within the process without requesting it from the global activity controller via RPC communication, reducing the complexity of game business development and reducing the communication volume within the game server cluster.

[0110] Executing game-related tasks may include obtaining online virtual characters located at the character business node, and based on the execution results of the corresponding character business logic, notifying the online virtual characters or updating the character data of the online virtual characters.

[0111] For example, the game server cluster has three global business nodes, running on different machines, each with a global activity controller instance, designated G1, G2, and G3; and four character business nodes, also running on different machines, each with a local activity controller instance, designated L1, L2, L3, and L4. Currently, the game has two types of operational activities: Activity A: During the activity, a monster is generated, and rewards are distributed based on player damage dealt to the monster; Activity B: During the activity, the experience points gained by players are doubled.

[0112] After the game server cluster starts, local controllers L1 to L4 register local activity handles for activities A and B. G1 calculates the start and end times of activity A based on its configuration. At the start of activity A, it calls the status callback interface of the global activity handle for activity A. This callback interface can then be the activity start callback interface, initializing the leaderboard and notifying L1 to L4 of the activity status change. Upon receiving the notification of the activity status change, L1 to L4 call the status callback interface of the local activity handle for activity A to notify the online virtual objects on their respective nodes that the activity has started, and spawn activity monsters in the designated scene. The virtual objects attack the activity monsters, and the attack data is synchronized to the global activity controller for storage. The global activity handle periodically triggers the calculation of the leaderboard.

[0113] G2 calculates the start and end times of Activity B based on its configuration. At the start of Activity B, it calls the activity start callback interface of the global activity handle. The global activity handle calculates the experience bonus multiplier based on parameters such as server launch time and server level, and synchronizes this multiplier with the activity status to L1-L4. Upon receiving the notification of the Activity B status change, L1-L4 call the status callback interface of the local activity handle to notify the online virtual objects on their respective nodes that the activity has started. When online virtual objects gain experience during the activity, they read the experience bonus multiplier recorded on the local activity controller of their respective node and apply the bonus.

[0114] The following, combined with Figure 9 The activity data control method in a game according to the example embodiments of this disclosure will be further explained and described. The activity data control method in a game may include the following steps:

[0115] Step S910. The global activity controller sets a timer to calculate the activity status;

[0116] Step S920. When the activity state changes, request activity data from the database and load the activity data;

[0117] Step S930. Call the global activity handle's status callback interface;

[0118] Step S940. Synchronize the activity data and activity status to the local activity controller of the local node;

[0119] Step S950. If synchronization fails, retry the synchronization.

[0120] Step S960. The local activity controller calls the status callback interface of the local activity handle;

[0121] Step S970. Notify the online virtual character or change the character data;

[0122] Step S980. Store the character data in the database.

[0123] The activity data control method in games provided in this exemplary embodiment has at least the following advantages: On the one hand, it utilizes a global business node to execute the target operation activity and a character business node to execute the game business of the target operation activity. Through the global business node and the character business node, it solves the problem of single-point existence in related technologies. On the other hand, the operation activity exists in a single-point form. When the process where the operation activity is located crashes or the machine where it is located goes down, the service becomes unavailable, affecting the user experience. Through the global business node, it solves the problem of service unavailability when the process where the operation activity is located crashes or the machine where it is located goes down, improves disaster recovery capability, and enhances the user's game experience. Furthermore, the local activity controller stores the data synchronized by the global activity controller, so that when calling the status callback interface of the local activity handle, the data can be directly obtained in the character business node without requesting from the global activity controller of the target operation activity through RPC communication, reducing the complexity of game business development and reducing the communication volume within the game server cluster.

[0124] This disclosure also provides an example embodiment of an activity data control device for a game, see reference. Figure 10 As shown, it may include: an activity handle registration module 1010 and an operation activity implementation module 1020. Wherein:

[0125] The activity handle registration module 1010 is used to determine the target operation activity for the target game, and register the global activity handle of the target operation activity to the global activity controller and the local activity handle of the target operation activity to the local activity controller;

[0126] The operation activity implementation module 1020 is used to respond to the global business node executing the target operation activity by obtaining activity data and activity status related to the target operation activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller through the global activity controller, so that the role business node can obtain the activity data and activity status by accessing the local activity controller to execute the specified game business.

[0127] The specific details of each module in the activity data control device of the above-mentioned game have been described in detail in the corresponding game's activity data control method, so they will not be repeated here.

[0128] In one exemplary embodiment of this disclosure, registering the global activity handle of the target operational activity to the global activity controller includes:

[0129] Determine the global activity handle for executing the global business logic of the target operational activity;

[0130] Obtain the activity type number of the target operation activity, perform hash calculation on the activity type number using a distributed consistent hash algorithm, and determine the global activity controller that matches the target operation activity;

[0131] Register the global activity handle to the global activity controller.

[0132] In one exemplary embodiment of this disclosure, registering the local activity handle of the target operational activity to the local activity controller includes:

[0133] Obtain the character business node in the server that executes the game business corresponding to the target operation activity, and the local activity handle of the character business node that executes the character business logic of the target operation activity;

[0134] Register the local activity handle to the local activity controller of the role business node that executes the target operational activity.

[0135] In one exemplary embodiment of this disclosure, the global business node executes the target operational activity, including:

[0136] The global activity controller acquires the activity data of the target operation activity, and obtains the time configuration data of the target operation activity based on the activity data;

[0137] The global business node executes the target operational activity based on the time configuration data.

[0138] In one exemplary embodiment of this disclosure, the global business node executes the target operational activity according to the time configuration data, including:

[0139] The global activity controller in the global business node obtains the current activity status of the target operation activity based on the time configuration data and the current time.

[0140] Based on the time parameter of the second activity state in the time configuration data, a timer is configured for the second activity state, and the target operation activity is executed based on the timer; wherein, the second activity state is the next activity state of the current activity state.

[0141] In one exemplary embodiment of this disclosure, after obtaining the current activity status of the target operational activity, the method further includes:

[0142] The activity data of the target operation and the current activity status are synchronized to the global activity controller.

[0143] In one exemplary embodiment of this disclosure, executing the target operational activity based on the timer includes:

[0144] The timer triggers the switch from the current activity state to the second activity state.

[0145] The state callback function corresponding to the second activity state of the global activity handle is invoked, and the global business logic corresponding to the target operation activity is triggered through the state callback function.

[0146] In one exemplary embodiment of this disclosure, after executing the global business logic corresponding to the target operational activity through the state callback function, the method further includes:

[0147] The activity data of the target operational activity is updated to obtain updated activity data.

[0148] In one exemplary embodiment of this disclosure, obtaining activity data and activity status related to the target operational activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller via the global activity controller, includes:

[0149] The updated activity data and the second activity status are synchronized to the local activity controller of the role's business node.

[0150] In one exemplary embodiment of this disclosure, a character service node executes a specified game service by accessing the local activity controller to obtain the activity data and activity status, including:

[0151] The local activity controller of the role business node calls the status callback function corresponding to the second activity state of the local activity handle according to the updated activity data and the second activity state;

[0152] The role business logic for executing the target operational activity is triggered by the status callback function corresponding to the second activity status.

[0153] It should be noted that although several modules or units of the device for performing actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0154] Furthermore, although the steps of the method in this invention are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0155] In an exemplary embodiment of the present invention, an electronic device capable of implementing the above-described method is also provided.

[0156] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0157] The following reference Figure 11 To describe an electronic device 1100 according to this embodiment of the present invention. Figure 11 The electronic device 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0158] like Figure 11 As shown, the electronic device 1100 is manifested in the form of a general-purpose computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including storage unit 1120 and processing unit 1110), and a display unit 1140.

[0159] The storage unit stores program code that can be executed by the processing unit 1110, causing the processing unit 1110 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 1110 can perform actions such as... Figure 1Step S110: Determine the target operation activity for the target game, and register the global activity handle of the target operation activity to the global activity controller and the local activity handle of the target operation activity to the local activity controller; S120: In response to the global business node executing the target operation activity, obtain the activity data and activity status related to the target operation activity through the global activity controller, and synchronize the obtained activity data and activity status to the local activity controller through the global activity controller, so that the character business node can execute the specified game business by accessing the local activity controller to obtain the activity data and activity status.

[0160] Storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 11201 and / or cache memory 11202, and may further include a read-only memory (ROM) 11203.

[0161] Storage unit 1120 may also include a program / utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0162] Bus 1130 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0163] Electronic device 1100 can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1100, and / or any device that enables electronic device 1100 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1150. Furthermore, electronic device 1100 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1160. As shown, network adapter 1160 communicates with other modules of electronic device 1100 via bus 1130. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems.

[0164] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.

[0165] In exemplary embodiments of the present invention, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.

[0166] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0167] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0168] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0169] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF (Radio Frequency), etc., or any suitable combination thereof.

[0170] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0171] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0172] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.

Claims

1. A method for controlling activity data in a game, characterized in that, Applied to the server side, the server side includes global business nodes and role-based business nodes. The global business nodes deploy a global activity controller, and the role-based business nodes deploy a local activity controller. The method includes: Identify the target operational activity for the target game, and register the global activity handle of the target operational activity to the global activity controller and the local activity handle of the target operational activity to the local activity controller; In response to the global business node executing the target operation activity, the global activity controller obtains the activity data and activity status related to the target operation activity, and synchronizes the obtained activity data and activity status to the local activity controller, so that the character business node can execute the specified game business by accessing the local activity controller to obtain the activity data and activity status.

2. The method for controlling activity data in a game according to claim 1, characterized in that, Registering the global activity handle of the target operational activity to the global activity controller includes: Determine the global activity handle for executing the global business logic of the target operational activity; Obtain the activity type number of the target operation activity, perform hash calculation on the activity type number using a distributed consistent hash algorithm, and determine the global activity controller that matches the target operation activity; Register the global activity handle to the global activity controller.

3. The method for controlling activity data in a game according to claim 1, characterized in that, Registering the local activity handle of the target operational activity to the local activity controller includes: Obtain the character business node in the server that executes the game business corresponding to the target operation activity, and the local activity handle of the character business node that executes the character business logic of the target operation activity; Register the local activity handle to the local activity controller of the role business node that executes the target operational activity.

4. The method for controlling activity data in a game according to claim 1, characterized in that, The global business node executes the target operational activity, including: The global activity controller acquires the activity data of the target operation activity, and obtains the time configuration data of the target operation activity based on the activity data; The global business node executes the target operational activity based on the time configuration data.

5. The method for controlling activity data in a game according to claim 4, characterized in that, The global business node executes the target operational activity based on the time configuration data, including: The global activity controller in the global business node obtains the current activity status of the target operation activity based on the time configuration data and the current time. Based on the time parameter of the second activity state in the time configuration data, a timer is configured for the second activity state, and the target operation activity is executed based on the timer; wherein, the second activity state is the next activity state of the current activity state.

6. The method for controlling activity data in a game according to claim 5, characterized in that, After obtaining the current activity status of the target operational activity, the method further includes: The activity data of the target operation and the current activity status are synchronized to the global activity controller.

7. The method for controlling activity data in a game according to claim 5, characterized in that, Based on the timer, the target operational activity is executed, including: The timer triggers the switch from the current activity state to the second activity state. The state callback function corresponding to the second activity state of the global activity handle is invoked, and the global business logic corresponding to the target operation activity is triggered through the state callback function.

8. The method for controlling activity data in a game according to claim 7, characterized in that, After executing the global business logic corresponding to the target operational activity through the state callback function, the method further includes: The activity data of the target operational activity is updated to obtain updated activity data.

9. The method for controlling activity data in a game according to claim 8, characterized in that, The process includes obtaining activity data and activity status related to the target operational activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller via the global activity controller. The updated activity data and the second activity status are synchronized to the local activity controller of the role's business node.

10. The method for controlling activity data in a game according to claim 9, characterized in that, The character service node executes specified game services by accessing the local activity controller to obtain the activity data and activity status, including: The local activity controller of the role business node calls the status callback function corresponding to the second activity state of the local activity handle according to the updated activity data and the second activity state; The role business logic for executing the target operational activity is triggered by the status callback function corresponding to the second activity status.

11. A device for controlling activity data in a game, characterized in that, Applied to the server side, the server side includes global business nodes and role business nodes. The global business nodes are deployed with a global activity controller, and the role business nodes are deployed with local activity controllers. The device includes: The activity handle registration module is used to determine the target operation activity for the target game, and register the global activity handle of the target operation activity to the global activity controller and the local activity handle of the target operation activity to the local activity controller; The operation activity implementation module is used to respond to the global business node executing the target operation activity by obtaining activity data and activity status related to the target operation activity through the global activity controller, and synchronizing the obtained activity data and activity status to the local activity controller through the global activity controller, so that the role business node can obtain the activity data and activity status by accessing the local activity controller to execute the specified game business.

12. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing unit, it implements the activity data control method in the game as described in any one of claims 1-10.

13. An electronic device, characterized in that, include: Processing unit; as well as A storage unit for storing the executable instructions of the processing unit; The processing unit is configured to execute the activity data control method in the game according to any one of claims 1-10 by executing the executable instructions.

Citation Information

Patent Citations

  • Systems and methods for recording data representing multiple interactions

    CN110546939A

  • Data migration method and device

    CN112583864A