Activity management method, device and electronic equipment in a game
By introducing an activity framework model into the game to automatically generate activity objects, the problem of poor reusability of activity data structures is solved, the efficiency and quality of activity activation are improved, and manual costs are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-09-01
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, the data structure of game activities has poor reusability, resulting in low activity opening efficiency, requiring a lot of repetitive programming and manpower costs, and making it difficult to guarantee the quality of activities.
The activity framework model is used to generate activity objects, and the lifecycle of activities, including the start and end of activities, is managed through activity objects, which reduces redundant coding and unifies the management of activity data.
It improved event development efficiency, reduced labor costs, ensured event quality, simplified event management processes, and reduced the risk of bugs.
Smart Images

Figure CN115591248B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game design technology, and in particular to a method, apparatus and electronic device for managing activities in games. Background Technology
[0002] After a game is launched, the planners usually put forward a lot of activity requests to enliven the game environment. Among them, an activity refers to a small gameplay in the game, which can be a game task packaged based on a holiday or current hot topic to promote player activity.
[0003] In related technologies, planners typically build their own data structures based on their understanding of the event, managing the event's lifecycle, refresh logic, and performing basic security checks. However, different planners build different data structures, resulting in poor data reusability. Furthermore, when the same event is restarted, events with poor reusability design may require many parameter modifications to ensure compatibility with both old and new event data, leading to low event launch efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a method, device, and electronic device for managing activities in games, so as to improve the efficiency of activity activation and reduce labor costs.
[0005] In a first aspect, the present invention provides an activity management method for games, the method comprising: acquiring activity data of an activity to be generated; wherein the activity data includes the activity type and / or activity activation rules of the activity to be generated; inputting the activity data into a preset activity framework model, so that the activity framework model generates an activity object corresponding to the activity to be generated based on the activity data, and managing the life cycle of the activity to be generated through the activity object; wherein the life cycle includes at least an activity start and an activity end.
[0006] In an optional implementation, the activity data includes activity types; multiple activity base classes are pre-defined in the activity framework model; the step of generating an activity object corresponding to the activity to be generated based on the activity data includes: indexing a target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes in the activity framework model; and generating an activity object based on the target activity base class.
[0007] In an optional implementation, the steps of managing the lifecycle of an activity to be generated through an activity object include: determining whether the activity to be generated has ended through the activity object; if it has not ended, determining whether the activity to be generated has started; if the activity to be generated has started, determining whether the activity to be generated has been started; if the activity to be generated has been started, creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0008] In an optional implementation, the method further includes: if the activity to be generated has ended, executing the end logic and setting the activity status of the activity to be generated to invalid; transferring the game data corresponding to the activity to be generated to a preset database, compressing the game data in the preset database, and deleting the game data when the game data in the preset database meets the deletion conditions.
[0009] In optional implementations, the above termination logic includes several of the following: setting the activity status of the event to be generated to "End"; unlocking the listener for the event to be generated; sending unclaimed event rewards to the player's mailbox; reclaiming the event activation items corresponding to the event to be generated; and executing custom termination logic.
[0010] In an optional implementation, before the step of determining whether the activity to be generated has ended by using the activity object, the method includes: determining whether the activity status of the activity to be generated is invalid; if invalid, deleting the activity object corresponding to the activity to be generated; if valid, determining whether the activity to be generated has ended by using the activity object.
[0011] In an optional implementation, the method further includes: if the activity to be generated has not started, creating an activation timer based on the activity data, so as to activate the activity to be generated when the time set by the activation timer is reached.
[0012] In an optional implementation, the method further includes: if the activity to be generated is not started, executing start logic; creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0013] In optional implementations, the above-mentioned activation logic includes several of the following: setting the activity status of the activity to be generated to "activated"; initializing the game data corresponding to the activity to be generated; refreshing the activity task corresponding to the activity to be generated and registering a listener for the activity task; distributing the activity activation item corresponding to the activity to be generated; and executing custom activation logic.
[0014] In an optional implementation, after the steps of managing the lifecycle of the activity to be generated through the activity object, the method further includes: performing a security check on the activity object.
[0015] In an optional implementation, the above activity framework model encapsulates an activity interface, which is used to query activity tasks, claim activity rewards corresponding to activity tasks, and share activity rewards.
[0016] Secondly, the present invention provides an activity management device for a game, the device comprising: a data acquisition module for acquiring activity data of an activity to be generated; wherein the activity data includes the activity type and / or activity activation rules of the activity to be generated; and an activity management module for inputting the activity data into a preset activity framework model, so that the activity framework model generates an activity object corresponding to the activity to be generated based on the activity data, and manages the lifecycle of the activity to be generated through the activity object; wherein the lifecycle includes at least an activity start and an activity end.
[0017] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the activity management method in the above-mentioned game.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the activity management method described above in the game.
[0019] The embodiments of the present invention bring the following beneficial effects:
[0020] This invention provides a method, apparatus, and electronic device for managing activities in games. First, it acquires activity data for an activity to be generated. This activity data includes the activity type and / or activity activation rules. Then, it inputs the activity data into a preset activity framework model, enabling the model to generate activity objects corresponding to the activity. The activity objects manage the lifecycle of the activity, which includes at least an activity start and an activity end. In this method, the activity framework model can automatically generate activity objects based on the activity data and manage the activity's lifecycle through these objects. This improves the efficiency of developing new activities, eliminates the need for rewriting code when generating new activities, reuses the activity framework model, reduces labor costs, and ensures activity quality.
[0021] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 A flowchart of an activity management method in a game provided by an embodiment of the present invention;
[0025] Figure 2 A flowchart of another activity management method in a game provided by an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the structure of an activity management device in a game, provided by an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0030] After a game launches, developers typically request numerous events to invigorate the game environment. These events refer to small gameplay mechanics within the game, often packaged as events based on holidays or current trends, designed to boost player activity. For example, a jigsaw puzzle event could involve developers assigning tasks that players can complete to earn rewards.
[0031] Without a clear event framework, program planners will spend a significant amount of time reinventing the wheel, potentially generating a large amount of one-off code, which is detrimental to project management and iteration. Furthermore, due to the varying skill levels of different planners, the quality of the final event product may not be guaranteed. When the same event is restarted, events without proper reuse design may require extensive program modifications to ensure compatibility with both old and new event data.
[0032] In related technologies, event planners typically build their own data structures based on their understanding of the event, managing the event's lifecycle, refresh logic, and performing basic security checks. While planners may generalize certain interfaces, the logic for each event can still differ significantly, leading to the following shortcomings in event management within these technologies:
[0033] 1. Different activities require reprogramming, resulting in a huge workload for each function, including a lot of repetitive and useless work;
[0034] 2. Each activity procedure needs to implement its own security checks, and the accuracy of these security checks is difficult to guarantee;
[0035] 3. The quality of each event's external broadcast cannot be guaranteed, and the planners need to review all aspects.
[0036] 4. If the event is poorly designed, launching multiple events may be quite difficult.
[0037] 5. The relationship with other modules may become complex, ultimately making the project code difficult to read and prone to bugs;
[0038] 6. Data attached to players is generally not removed, causing player data to expand rapidly.
[0039] To address the aforementioned problems, embodiments of the present invention provide a method, apparatus, and electronic device for managing activities in games; this technology can be applied to various scenarios involving the generation, management, and security checks of game activities. To facilitate understanding of the embodiments of the present invention, a method for managing activities in games disclosed in this invention will first be described in detail, such as... Figure 1 As shown, the method includes the following specific steps:
[0040] Step S102: Obtain activity data for the activity to be generated; wherein, the activity data includes the activity type and / or activity activation rules for the activity to be generated.
[0041] The activity data mentioned above may include only the activity type, only the activity start rules, or both. Specifically, the activity start rules may include the activity start time, activity end time, and activity start conditions. These start conditions may include the time period during which the activity is started, the operating system on which the activity is started, and the player's level at which the activity is started.
[0042] In practical applications, the aforementioned activity data is typically uploaded by planners via a terminal device, such as a mobile phone, tablet, or computer. Specifically, the activity framework model corresponds to a data table, where planners can set activity data to enable the activity framework model to automatically generate activity objects based on that data.
[0043] Step S104: Input the activity data into the preset activity framework model so that the activity framework model generates the activity object corresponding to the activity to be generated based on the activity data, and manages the life cycle of the activity to be generated through the activity object; wherein, the life cycle includes at least the start of the activity and the end of the activity.
[0044] The aforementioned activity framework model is a general and reusable framework, pre-set by planners. Each planner can use this framework model, thereby saving time and costs in activity development, generation, and management. Specifically, the activity framework model can automatically generate activity objects corresponding to the activities to be generated based on received activity data. These activity objects can then be used to manage the lifecycle of the activities to be generated within the game, including the start, execution, and end of the activity.
[0045] In practical implementation, multiple phases of activities can use the same activity base class (the logic of the same activity base class is the same). Meanwhile, activities from different phases can be generated using either a single object (i.e., different phases of activities use the same activity object) or multiple objects (i.e., activities from different phases use different activity objects). Using a single object is similar to a solution without an activity framework model, but it considers the implementation of multi-phase logic. The data structure is similar to {phase number: data}. This implementation requires using different data based on different phase numbers within the logic. Using multiple objects typically distinguishes different phases of activities through an activity ID (Identity document). In this approach, the data of each phase of activity is naturally isolated, making logic writing smoother and eliminating concerns about polluting the data of other phases of activities. Expired activities can simply have their other activity object recycled; this is entirely determined by the activity framework model.
[0046] This invention provides a method for managing activities in a game. First, activity data for an activity to be generated is acquired. This activity data includes the activity type and / or activity activation rules. Then, the activity data is input into a preset activity framework model, which generates activity objects corresponding to the activity based on the activity data. The activity objects manage the lifecycle of the activity, which includes at least an activity start and an activity end. In this method, the activity framework model can automatically generate activity objects based on the activity data and manage the activity lifecycle through these objects. This improves the efficiency of developing new activities. When generating new activities, there is no need to repeatedly write code; the activity framework model can be reused, thereby reducing labor costs and ensuring activity quality.
[0047] This invention also provides another activity management method in games, which is implemented based on the above embodiments. This method focuses on describing the specific process by which the activity framework model generates activity objects corresponding to the activities to be generated based on activity data, and manages the lifecycle of the activities to be generated through these activity objects (specifically implemented through steps S206-S228 below); Figure 2 As shown, the method includes the following specific steps:
[0048] Step S202: Obtain activity data for the activity to be generated; wherein, the activity data includes the activity type and activity activation rules of the activity to be generated.
[0049] Step S204: Input the activity data into the preset activity framework model.
[0050] Step S206: From the multiple activity base classes of the activity framework model, index the target activity base class that matches the activity type of the activity to be generated.
[0051] In its implementation, the activity framework model pre-defines multiple activity base classes. Each base class has its own identifier; for example, different numbers or letters can be used to identify different base classes. Each base class is matched with an activity type, and the correspondence between base classes and activity types is pre-defined. In practical applications, the activity framework model can index the corresponding base class based on the activity type of the activity to be generated.
[0052] Step S208: Generate an activity object based on the target activity base class using the activity framework model.
[0053] In the activity framework model, an activity is positioned as a logical object within a data structure on the player. Its logic is triggered either by the player receiving a protocol or by a timer. Without a unified activity entry and exit point, each interface interacting with the outside world would need to have its own interface written at the player level to forward requests to the activity object for processing. This approach is practically difficult and makes monitoring the underlying logic challenging. Therefore, the activity framework model in this invention unifies several interfaces on the player, respectively forwarding protocols generated by the client, the player itself, and other server processes to the activity object. The caller only needs to know which activity type it needs to communicate with. For example, when a player clicks a button, it triggers the client to send a request to the server, which then processes the request and sends the data back to the client.
[0054] Step S210: Determine whether the activity status of the activity to be generated is invalid; if invalid, proceed to step S212; if valid, proceed to step S214.
[0055] In practice, when a player logs into the game, an activity object is generated based on the activity data of the event to be generated. Then, the game data of all activities is restored using the activity object, and it is determined that all activities have expired and are invalid. The activity objects corresponding to the expired and invalid activities are then removed. Specifically, after a player logs off, all of the player's data (including the game data corresponding to the activities) needs to be saved to the database. When the player logs back into the game, the data is retrieved from the database. At this time, the activity needs to restore itself to its state before logging off based on the retrieved game data.
[0056] Step S212: Delete the activity object corresponding to the activity to be generated.
[0057] If expired and invalid activities are not handled, player data will expand indefinitely, leading to increased storage consumption. Therefore, the activity framework model in this invention can safely remove useless activities through preset rules. Specifically, if an activity expires and becomes invalid, the activity object corresponding to that activity can be deleted, and then the game data corresponding to that activity can be transferred to a preset database. The game data in the preset database is compressed, and when the game data in the preset database meets the deletion conditions, the game data is deleted. In some embodiments, the game data corresponding to the expired and invalid activity can also be deleted directly. This game data is usually activity-related data, and the game data corresponding to each specific activity will be different. Typically, game data includes whether the player has shared the activity with friends, which tasks have been completed, and whether a certain task has been accepted, etc.
[0058] Step S214: Determine whether the activity to be generated has ended based on the activity object; if yes, proceed to step S216; otherwise, proceed to step S220.
[0059] In practical implementation, it can be determined whether an activity has ended by checking whether the activity managed by the activity object has reached the end time indicated in the activity rules.
[0060] Step S216: Execute the end logic and set the activity status of the activity to be generated to invalid; then execute step S218.
[0061] The above termination logic includes several of the following: setting the activity status of the event to be generated to "End"; unlocking the listener for the event to be generated; sending unclaimed event rewards to the player's mailbox; reclaiming the event activation items corresponding to the event to be generated; and executing custom termination logic.
[0062] In practice, some activities may involve tasks that players complete but fail to claim their rewards. In this case, the program will have variables `is_finish` set to `True` and `is_rewarded` set to `False`. This allows the program to determine if the player has not claimed their reward and to automatically send it to them via in-game mail.
[0063] In practice, the preset allocation table stores the event activation items distributed when the event starts. At the end of the event, the distributed event activation items can be recycled according to the preset allocation table. For example, for the Snow Festival event, the planners can configure the preset allocation table to set 10 "snowflakes" to equal 1 "gold coin". If a player still has 100 "snowflakes" that have not been redeemed when the Snow Festival event ends, they will be automatically redeemed for 10 "gold coins".
[0064] The custom ending logic mentioned above can be set by the game designer according to their needs. For example, it could be to let the player finish the animation or send an ending email.
[0065] Step S218: Transfer the game data corresponding to the activity to be generated to the preset database, compress the game data in the preset database, and delete the game data when the game data in the preset database meets the deletion conditions.
[0066] In practice, when an activity ends, its activity status needs to be set to invalid. Then, the game data for that activity is transferred to another data structure (equivalent to a pre-defined database) for compression to initially reduce storage pressure. When pre-defined deletion conditions are met, the game data is deleted. For example, if the game data has been transferred to the data structure for n days, it is considered completely useless and can be completely deleted. This method avoids mistakenly deleting game data that needs to be recovered. Furthermore, it allows for more information to be gathered when players provide feedback, thus delaying the actual deletion of the game data.
[0067] Step S220: Determine whether the activity to be generated has started; if yes, proceed to step S222; otherwise, proceed to step S226.
[0068] Step S222: Determine whether the activity to be generated has been started; if yes, proceed to step S224; otherwise, proceed to step S228.
[0069] Step S224: Create an end timer to terminate the activity to be generated when the timer is set.
[0070] In practice, the end timer can be set according to the end time of the activity in the activity rules of the activity to be generated, and the activity to be generated will end when the end time is reached.
[0071] Step S226: Based on the activity data, create an activation timer to activate the activity to be generated when the timer reaches the set time.
[0072] When it is detected that an activity to be generated has started, the start timer can be set according to the activity start time in the activity rules of the activity to be generated, and the activity to be generated will start when the activity start time is reached.
[0073] Step S228: Execute the start logic; create an end timer to terminate the activity to be generated when the end timer is set.
[0074] In specific implementation, the above-mentioned activation logic includes several of the following: setting the activity status of the activity to be generated to "activated"; initializing the game data corresponding to the activity to be generated; refreshing the activity task corresponding to the activity to be generated and registering a listener for the activity task; distributing the activity activation item corresponding to the activity to be generated; and executing custom activation logic.
[0075] Different event activation items can be set for different events. For example, a winter festival event will be launched, where players need to complete tasks to obtain "snowflake" items, which can be used to exchange for some rewards. The planners may want players to experience the exchange action first, so when the event starts, they will give players 100 "snowflake" items without completing any tasks.
[0076] In practice, the activity framework model typically only includes commonly used logic, such as distributing activity start-up items as mentioned above. Some activities may require players to watch an animation, send them an email, etc., and this custom start-up logic requires additional program code.
[0077] After creating the end timer, it is also necessary to trigger the letter logic and register the activity task listener. Among them, the refresh logic includes: refreshing the task completion status, and resending the reward via email if the player has not claimed it; if the task needs to be refreshed, refresh and register the new task listener; and activity-specific refresh logic (that is, refresh logic customized according to requirements).
[0078] In practical implementation, security checks are also required for the activity object. Security checks protect the activity object by proactively intercepting invalid protocols, reducing the probability of bugs caused by incomplete consideration by developers and planners. Specifically, for interfaces called outside the activity, a decorator needs to be registered to indicate whether the response scope of this interface is the client, other server processes, or this avatar. The usage is as follows:
[0079] @Proto.client()
[0080] defclient_function(self):
[0081] xxx
[0082] Because the interfaces for entering and exiting the activity framework model are unified, it's easy to determine whether to respond to a request when the activity framework model receives a request to call an interface within the activity. Furthermore, optional validation items for the interface can be specified based on the decorator's optional parameters. Currently, the following two optional validation items are supported:
[0083] The first approach is to control the call frequency, avoiding frequent calls caused by bugs on the client side.
[0084] The second option is to avoid responding to the agreement after the event ends, during the event period.
[0085] In its implementation, the activity framework model not only manages the lifecycle of activities through activity objects, but also encapsulates an activity interface. This interface is used to query activity tasks, claim activity rewards corresponding to activity tasks, and share activity rewards.
[0086] When no custom activity functionality is available, the program requires no work; it can be completed directly using the pre-defined activity framework model, requiring only the input of activity data. If custom activity functionality is available, the program inherits from the activity base class, develops its own functionality, and then registers the activity class into a data structure, thereby improving the efficiency of activity development. Furthermore, this invention supports multi-phase activities, unified management of the coupling relationship between other modules and the activity module, provides a certain level of security verification, and clears expired and deemed useless activity data.
[0087] The activity management method described above significantly reduces the time required to develop a new activity, freeing up more manpower; the activity-related code is concise and easy to write, reducing the development difficulty of other related systems; after the activity framework model is launched, there are fewer activity-related bugs, and deleting expired and invalid data also prevents the activity data from expanding indefinitely.
[0088] Corresponding to the above method embodiments, this invention also provides an activity management device for games, such as... Figure 3 As shown, the device includes:
[0089] The data acquisition module 30 is used to acquire activity data of the activity to be generated; wherein, the activity data includes the activity type and / or activity activation rules of the activity to be generated.
[0090] The activity management module 31 is used to input activity data into a preset activity framework model, so that the activity framework model generates activity objects corresponding to the activities to be generated based on the activity data, and manages the life cycle of the activities to be generated through the activity objects; wherein, the life cycle includes at least the start of the activity and the end of the activity.
[0091] The activity management device in the aforementioned game first acquires activity data for the activity to be generated. This activity data includes the activity type and / or activity activation rules. Then, the activity data is input into a preset activity framework model, which generates activity objects corresponding to the activity based on the activity data. The activity objects manage the lifecycle of the activity, which includes at least an activity start and an activity end. In this method, the activity framework model can automatically generate activity objects based on the activity data and manage the activity lifecycle through these objects. This improves the efficiency of developing new activities. When generating new activities, there is no need to repeatedly write code; the activity framework model can be reused, thereby reducing labor costs and ensuring activity quality.
[0092] Specifically, the above-mentioned activity framework model has multiple activity base classes pre-set; the above-mentioned activity management module 31 is also used to: index the target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes of the activity framework model; and generate an activity object according to the target activity base class.
[0093] Furthermore, the activity management module 31 described above is also used to: determine whether the activity to be generated has ended based on the activity object; if it has not ended, determine whether the activity to be generated has started; if the activity to be generated has started, determine whether the activity to be generated has been started; if the activity to be generated has been started, create an end timer to end the activity to be generated when the time set by the end timer is reached.
[0094] In a specific implementation, the above device also includes an activity removal module, which is used to: if the activity to be generated has ended, execute the end logic and set the activity status of the activity to be generated to invalid; transfer the game data corresponding to the activity to be generated to a preset database, compress the game data in the preset database, and delete the game data when the game data in the preset database meets the deletion conditions.
[0095] In practical applications, the above termination logic includes several of the following: setting the activity status of the event to be generated to "End"; unlocking the listener for the event to be generated; sending unclaimed event rewards to the player's mailbox; reclaiming the event activation items corresponding to the event to be generated; and executing custom termination logic.
[0096] Furthermore, the above-mentioned device also includes an invalidity determination module, used to: determine whether the activity status of the activity to be generated is invalid before determining whether the activity to be generated has ended through the activity object; if invalid, delete the activity object corresponding to the activity to be generated; if valid, determine whether the activity to be generated has ended through the activity object.
[0097] Furthermore, the above-mentioned device also includes an activation timer setting module, used to: if the activity to be generated has not started, create an activation timer based on the activity data, so as to start the activity to be generated when the timer is set.
[0098] Specifically, the above-mentioned device also includes an end timer creation module, which is used to: execute start logic if the activity to be generated has not been started; and create an end timer to end the activity to be generated when the time set by the end timer is reached.
[0099] In specific implementation, the above-mentioned activation logic includes several of the following: setting the activity status of the activity to be generated to "activated"; initializing the game data corresponding to the activity to be generated; refreshing the activity task corresponding to the activity to be generated and registering a listener for the activity task; distributing the activity activation item corresponding to the activity to be generated; and executing custom activation logic.
[0100] Furthermore, the above-mentioned device also includes a security verification module, used to perform security verification on the activity object after managing the lifecycle of the activity to be generated through the activity object management.
[0101] In its implementation, the above activity framework model encapsulates an activity interface, which is used to query activity tasks, claim activity rewards corresponding to activity tasks, and share activity rewards.
[0102] The activity management device for games provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0103] This invention also provides an electronic device, such as... Figure 4 As shown, the electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the activity management method in the game described above.
[0104] Specifically, the activity management method in the above game includes: acquiring activity data of the activity to be generated; wherein the activity data includes the activity type and / or activity start rules of the activity to be generated; inputting the activity data into a preset activity framework model, so that the activity framework model generates the activity object corresponding to the activity to be generated based on the activity data, and managing the life cycle of the activity to be generated through the activity object; wherein the life cycle includes at least the start of the activity and the end of the activity.
[0105] In the activity management method described above, the activity framework model can automatically generate activity objects based on activity data and manage the lifecycle of activities through these activity objects. This method improves the efficiency of developing new activities. When generating new activities, there is no need to rewrite code, as the activity framework model can be reused, thereby reducing labor costs and ensuring the quality of activities.
[0106] In an optional implementation, the activity data includes activity types; multiple activity base classes are pre-defined in the activity framework model; the step of generating an activity object corresponding to the activity to be generated based on the activity data includes: indexing a target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes in the activity framework model; and generating an activity object based on the target activity base class.
[0107] In an optional implementation, the steps of managing the lifecycle of an activity to be generated through an activity object include: determining whether the activity to be generated has ended through the activity object; if it has not ended, determining whether the activity to be generated has started; if the activity to be generated has started, determining whether the activity to be generated has been started; if the activity to be generated has been started, creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0108] In an optional implementation, the method further includes: if the activity to be generated has ended, executing the end logic and setting the activity status of the activity to be generated to invalid; transferring the game data corresponding to the activity to be generated to a preset database, compressing the game data in the preset database, and deleting the game data when the game data in the preset database meets the deletion conditions.
[0109] In an optional implementation, the above termination logic includes: setting the activity status of the activity to be generated to "End"; unlocking the listener for the activity to be generated; sending the unclaimed activity rewards to the player's mailbox; reclaiming the activity activation items corresponding to the activity to be generated; and executing custom termination logic.
[0110] In an optional implementation, before the step of determining whether the activity to be generated has ended by using the activity object, the method includes: determining whether the activity status of the activity to be generated is invalid; if invalid, deleting the activity object corresponding to the activity to be generated; if valid, determining whether the activity to be generated has ended by using the activity object.
[0111] In an optional implementation, the method further includes: if the activity to be generated has not started, creating an activation timer based on the activity data, so as to activate the activity to be generated when the time set by the activation timer is reached.
[0112] In an optional implementation, the method further includes: if the activity to be generated is not started, executing start logic; creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0113] In an optional implementation, the above-mentioned activation logic includes: setting the activity status of the activity to be generated to "activated"; initializing the game data corresponding to the activity to be generated; refreshing the activity task corresponding to the activity to be generated and registering a listener for the activity task; distributing the activity activation item corresponding to the activity to be generated; and executing custom activation logic.
[0114] In an optional implementation, after the steps of managing the lifecycle of the activity to be generated through the activity object, the method further includes: performing a security check on the activity object.
[0115] In an optional implementation, the above activity framework model encapsulates an activity interface, which is used to query activity tasks, claim activity rewards corresponding to activity tasks, and share activity rewards.
[0116] Furthermore, Figure 4 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0117] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0118] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0119] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the activity management method described above in the game. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0120] Specifically, the activity management method in the above game includes: acquiring activity data of the activity to be generated; wherein the activity data includes the activity type and / or activity start rules of the activity to be generated; inputting the activity data into a preset activity framework model, so that the activity framework model generates the activity object corresponding to the activity to be generated based on the activity data, and managing the life cycle of the activity to be generated through the activity object; wherein the life cycle includes at least the start of the activity and the end of the activity.
[0121] In the activity management method described above, the activity framework model can automatically generate activity objects based on activity data and manage the lifecycle of activities through these activity objects. This method improves the efficiency of developing new activities. When generating new activities, there is no need to rewrite code, as the activity framework model can be reused, thereby reducing labor costs and ensuring the quality of activities.
[0122] In an optional implementation, the activity data includes activity types; multiple activity base classes are pre-defined in the activity framework model; the step of generating an activity object corresponding to the activity to be generated based on the activity data includes: indexing a target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes in the activity framework model; and generating an activity object based on the target activity base class.
[0123] In an optional implementation, the steps of managing the lifecycle of an activity to be generated through an activity object include: determining whether the activity to be generated has ended through the activity object; if it has not ended, determining whether the activity to be generated has started; if the activity to be generated has started, determining whether the activity to be generated has been started; if the activity to be generated has been started, creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0124] In an optional implementation, the method further includes: if the activity to be generated has ended, executing the end logic and setting the activity status of the activity to be generated to invalid; transferring the game data corresponding to the activity to be generated to a preset database, compressing the game data in the preset database, and deleting the game data when the game data in the preset database meets the deletion conditions.
[0125] In an optional implementation, the above termination logic includes: setting the activity status of the activity to be generated to "End"; unlocking the listener for the activity to be generated; sending the unclaimed activity rewards to the player's mailbox; reclaiming the activity activation items corresponding to the activity to be generated; and executing custom termination logic.
[0126] In an optional implementation, before the step of determining whether the activity to be generated has ended by using the activity object, the method includes: determining whether the activity status of the activity to be generated is invalid; if invalid, deleting the activity object corresponding to the activity to be generated; if valid, determining whether the activity to be generated has ended by using the activity object.
[0127] In an optional implementation, the method further includes: if the activity to be generated has not started, creating an activation timer based on the activity data, so as to activate the activity to be generated when the time set by the activation timer is reached.
[0128] In an optional implementation, the method further includes: if the activity to be generated is not started, executing start logic; creating an end timer to end the activity to be generated when the time set by the end timer is reached.
[0129] In an optional implementation, the above-mentioned activation logic includes: setting the activity status of the activity to be generated to "activated"; initializing the game data corresponding to the activity to be generated; refreshing the activity task corresponding to the activity to be generated and registering a listener for the activity task; distributing the activity activation item corresponding to the activity to be generated; and executing custom activation logic.
[0130] In an optional implementation, after the steps of managing the lifecycle of the activity to be generated through the activity object, the method further includes: performing a security check on the activity object.
[0131] In an optional implementation, the above activity framework model encapsulates an activity interface, which is used to query activity tasks, claim activity rewards corresponding to activity tasks, and share activity rewards.
[0132] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0133] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0134] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for managing activities in a game, characterized in that, The method includes: Obtain activity data for the activity to be generated; wherein, the activity data includes the activity type and / or activity activation rules for the activity to be generated; The activity data is input into a preset activity framework model, so that the activity framework model generates an activity object corresponding to the activity to be generated based on the activity data, and manages the life cycle of the activity to be generated through the activity object; wherein, the life cycle includes at least an activity start and an activity end; The activity framework model has multiple activity base classes pre-defined; the step of generating an activity object corresponding to the activity to be generated based on the activity data includes: indexing a target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes of the activity framework model; and generating the activity object according to the target activity base class.
2. The method according to claim 1, characterized in that, The step of managing the lifecycle of the activity to be generated through the activity object includes: The activity to be generated is determined based on the activity object; If the process has not ended, determine whether the activity to be generated has started; if the activity to be generated has started, determine whether the activity to be generated has been initiated. If the activity to be generated has been started, create an end timer to terminate the activity when the time set by the end timer is reached.
3. The method according to claim 2, characterized in that, The method further includes: If the activity to be generated has ended, execute the end logic and set the activity status of the activity to be generated to invalid; The game data corresponding to the activity to be generated is transferred to a preset database. The game data in the preset database is compressed. When the game data in the preset database meets the deletion conditions, the game data is deleted.
4. The method of claim 3, wherein, The termination logic includes several of the following: Set the activity status of the activity to be generated to "End"; Unlock the listening to the activity to be generated; Send any unclaimed in-game event rewards to the player's in-game mailbox; Reclaim the event activation items corresponding to the event to be generated; Execute custom termination logic.
5. The method according to claim 2, characterized in that, Before the step of determining whether the activity to be generated has ended through the activity object, the method includes: Determine whether the activity status of the activity to be generated is invalid; If invalid, delete the activity object corresponding to the activity to be generated; If valid, determine whether the activity to be generated has ended based on the activity object.
6. The method according to claim 2, characterized in that, The method further includes: If the activity to be generated has not started, an activation timer is created based on the activity data to activate the activity when the timer is set.
7. The method according to claim 2, characterized in that, The method further includes: If the activity to be generated is not enabled, execute the enabling logic; Create the end timer to terminate the activity to be generated when the time set by the end timer is reached.
8. The method according to claim 7, characterized in that, The enabling logic includes several of the following: Set the activity status of the activity to be generated to "enabled"; Initialize the game data corresponding to the activity to be generated; Refresh the activity task corresponding to the activity to be generated, and register a listener for the activity task; Distribute the event activation items corresponding to the event to be generated; Execute custom startup logic.
9. The method according to claim 1, characterized in that, After the step of managing the lifecycle of the activity to be generated through the activity object, the method further includes: Perform a security check on the active object.
10. The method of claim 1, wherein, The activity framework model encapsulates an activity interface, which is used to query activity tasks, claim the activity rewards corresponding to the activity tasks, and share the activity rewards.
11. An activity management device for games, characterized in that, The device includes: The data acquisition module is used to acquire activity data of the activity to be generated; wherein, the activity data includes the activity type and / or activity activation rules of the activity to be generated; The activity management module is used to input the activity data into a preset activity framework model, so that the activity framework model generates an activity object corresponding to the activity to be generated based on the activity data, and manages the life cycle of the activity to be generated through the activity object; wherein, the life cycle includes at least an activity start and an activity end; The activity framework model has multiple activity base classes pre-defined; the activity management module is further configured to: index a target activity base class that matches the activity type of the activity to be generated from the multiple activity base classes of the activity framework model; and generate the activity object according to the target activity base class.
12. An electronic device, comprising: The device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the activity management method in a game as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the activity management method in the game as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and computer readable medium
CN111450536A
Game activity management method and device and storage medium
CN112130821A