Business time round management method and device, equipment, storage medium and product

By determining the stage based on the current time and round information in the time round management and creating a new time round in the preset round generation stage, the problem of insufficient flexibility in the existing technology is solved, and flexible management and high availability in dynamic and high concurrency scenarios are achieved to ensure business continuity and user experience.

CN120407102APending Publication Date: 2025-08-01GUANGZHOU BAIGUOYUAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510375431.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In the prior art, time round management solutions lack flexibility in dynamic and high concurrency scenarios, and are difficult to adapt to complex and changeable business needs, resulting in a lack of flexibility in time round management, affecting user experience and system stability.

Method used

During the execution of the round state task, the current round stage is determined based on the current time, round information and sub-round duration, and a new time round is created in the preset round generation stage, which supports dynamic generation and management of time rounds, and uses the multi-computer room main selection mechanism to ensure system stability and consistency.

Benefits of technology

It improves the flexibility and adaptability of time round management, ensures timely creation of new time rounds in dynamic and high concurrency scenarios, ensures business continuity and user experience coherence, and enhances the system's high availability and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407102A_ABST
    Figure CN120407102A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a business time round management method and device, equipment, a storage medium and a product. According to the technical scheme provided by the embodiment of the invention, in the process of executing the round state task, the current round stage is determined according to the current time, the round time in the current round information and the sub-round duration, and the new time round is created when the current round stage is the preset round generation stage; according to the method, the new time round can be flexibly created in a dynamic and high-concurrency scene without waiting for the end of the fixed time round to generate the new time round, so that the business processing can be carried out in time according to the newly created time round when the next business round is entered, and the business processing efficiency is improved. The flexibility of business time round management is effectively improved, and complex and changeable business requirements are effectively met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technologies, and particularly to a method, apparatus, device, storage medium, and product for managing business time rounds. Background Art

[0002] With the booming rise of many Internet business fields, in many businesses, especially in business scenarios with strong interactivity and high real-time requirements such as games, there are often related gameplay that requires time round control. The generation and management of time rounds directly affect task triggering, resource allocation, and user experience. Therefore, the generation and management related to time rounds have become a crucial part of the business.

[0003] The time round management solutions of related technologies often divide rounds based on fixed time intervals, such as based on a task queue or a time wheel algorithm. The time round management solutions of related technologies perform well in processing fixed tasks, but in dynamic and highly concurrent scenarios, they cannot flexibly manage time rounds, and the time round management lacks flexibility and is difficult to adapt to complex and changeable business requirements. Summary of the Invention

[0004] The embodiments of the present application provide a method, apparatus, device, storage medium, and product for managing business time rounds to solve the technical problem that the business time round management in related technologies lacks flexibility and is difficult to adapt to complex and changeable business requirements, and can effectively improve the flexibility of business time round management and effectively adapt to complex and changeable business requirements.

[0005] In a first aspect, the embodiments of the present application provide a method for managing business time rounds, including:

[0006] During the execution of the round status task, determine the current round information of the current time round, where the current time round includes one or more sub-rounds;

[0007] Determine the current round stage according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds;

[0008] In the case where the current round stage is a preset round generation stage, create a new time round for the business side to perform business processing according to the created time round. The preset round generation stage includes one or more combinations of the last sub-round stage, the preset fallback expiration round stage, and the preset sub-round stage. Among them, the time period of the preset fallback expiration round stage is longer than the time period of the current time round, and the preset sub-round stage corresponds to the sub-round stage in the current time round before the last sub-round stage.

[0009] In a second aspect, an embodiment of the present application provides a service time round management device, including a round detection module, a phase determination module, and a round creation module, where:

[0010] The round detection module is configured to determine the current round information of the current time round during the execution of the round status task, and the current time round includes one or more sub-rounds;

[0011] The phase determination module is configured to determine the current round phase according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds;

[0012] The round creation module is configured to create a new time round when the current round phase is a preset round generation phase, for the service end to perform service processing according to the created time round.

[0013] In a third aspect, an embodiment of the present application provides a service time round management device, including: a memory and one or more processors;

[0014] The memory is used to store one or more programs;

[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the service time round management method as described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present application provides a non-volatile storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the service time round management method as described in the first aspect when executed by a computer processor.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the service time round management method as described in the first aspect.

[0018] In the embodiments of the present application, during the process of executing the round status task, the current round stage is determined according to the current time, the round time in the current round information, and the sub-round duration, and a new time round is created when the current round stage is a preset round generation stage, so that the business side can perform business processing according to the created time round. By accurately determining the current round stage of the time round at the current time and timely creating a new time round when the current round stage is a preset round generation stage, new time rounds can be flexibly created in dynamic and high-concurrency scenarios without waiting for the end of a fixed time round to generate a new time round, which can ensure that business processing can be carried out in a timely manner according to the newly created time round when entering the next business round, effectively improving the flexibility of business time round management and effectively adapting to complex and changeable business requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flowchart of a business time round management method provided by an embodiment of the present application;

[0020] Figure 2 is a flowchart of another business time round management method provided by an embodiment of the present application;

[0021] Figure 3 is a schematic structural diagram of a business time round management device provided by an embodiment of the present application;

[0022] Figure 4 is a schematic structural diagram of a business time round management device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] In order to make the objectives, technical solutions, and advantages of the present application clearer, the following further describes the specific embodiments of the present application in detail with reference to the accompanying drawings. It can be understood that the specific embodiments described herein are only used to explain the present application, rather than limiting the present application. Additionally, it should be noted that for the sake of description, only parts related to the present application are shown in the drawings rather than all the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be performed in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The above process can be terminated when its operations are completed, but there can also be additional steps not included in the drawings. The above process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0024] The business time round management method provided by this application can be applied to business processing scenarios based on time rounds (such as highly interactive gameplay scenarios on social platforms, game platforms, etc., and can implement real-time interactive games, lightweight gameplay nested in live broadcasts, task-driven services, etc.). The purpose is to determine the current round stage during the execution of round status tasks according to the current time, the round time in the current round information, and the sub-round durations of one or more sub-rounds, and create a new time round when generating a stage for a preset round in the current round stage, improving the flexibility of business time round management and adapting to complex and changeable business requirements.

[0025] In existing time round generation schemes, generally, round division is based on fixed time intervals, such as based on a task queue or a time wheel algorithm. Such time round division schemes perform well in dealing with fixed tasks, but in dynamic and high-concurrency scenarios, they cannot generate flexible rounds according to real-time events, lack flexibility, and are difficult to adapt to complex and changeable business requirements. In a highly available environment, it is difficult to ensure the consistency and continuity of time round generation. The time round management schemes in related technologies lack the ability to efficiently monitor and process user behavior events, are difficult to flexibly generate dynamic rounds, and have imperfect event-driven support; in a multi-data center environment, a failure in the main data center may cause the interruption of round generation, affecting the stability of the system, and the high availability guarantee of time round management is relatively weak; time round management cannot efficiently predict business behavior, resulting in delays in real-time round generation, affecting the user experience, with limited real-time performance and scalability, and the time range management is not flexible, making it difficult to support custom time ranges and dynamic adjustments; the fast recovery and fault tolerance mechanism in abnormal scenarios is imperfect, making it difficult to ensure the continuity and stability of the business. Based on this, a business time round management method according to an embodiment of this application is provided to solve the technical problem that the existing business time round management lacks flexibility and is difficult to adapt to complex and changeable business requirements.

[0026] Figure 1 The flowchart of a business time round management method provided by an embodiment of this application is given. The business time round management method provided by an embodiment of this application can be executed by a business time round management device. The business time round management device can be implemented in a hardware and / or software manner and integrated in a business time round management device (such as a data center with a distributed configuration).

[0027] The following describes the business time round management method with the business time round management device executing the business time round management method as an example.

[0028] Refer to Figure 1 , the business time round management method includes:

[0029] S110: During the execution of the round status task, determine the current round information of the current time round, where the current time round includes one or more sub-rounds.

[0030] Exemplarily, during the execution of the round status task, determine the current round information of the current time round. Here, the round status task can be understood as a task indicating the generation of time rounds. During the execution of the round status task, the creation and management of time rounds will be continuously carried out based on the business time round management method provided in this application. In one embodiment, the round information of the time round may include one or more combinations of the start time, duration, end time, and round identifier (round ID) corresponding to the time round. Optionally, for each service, the generation and stop trigger events of the time round can be defined through configuration, and it is supported to achieve personalized requirements through configuration extension. The service can customize the time allocation of sub-rounds through the API interface, and at the same time support the operation of forcibly stopping the current time round, improving the flexibility and scalability of time round generation. It is also possible to flexibly generate and manage dynamic time rounds based on event-driven to adapt to the real-time changes of user behavior events and system states, and meet complex and changeable business requirements.

[0031] The time round provided in this application includes one or more sub-rounds. The business logic can be divided into multiple business sub-logics. The service side can configure different preset business sub-logics for different sub-rounds. In a time round, execute the corresponding preset business sub-logic according to the sub-round corresponding to the current time, and provide continuous and complete business services through the preset business sub-logics of multiple sub-rounds. This application can divide a single time round into multiple small time nodes to obtain multiple sub-rounds. The service side can customize the time round splitting granularity according to actual needs to more accurately allocate and manage tasks. Among them, the time length of the entire time round (i.e., the overall time range) is equal to the sum of the times of all sub-rounds, which can ensure the accuracy and efficiency of time management.

[0032] Within the time range corresponding to each time round, the service side can execute the corresponding service. Taking the small rocket casual game in the live broadcast scenario as an example, within a time round, the service side can execute the small rocket casual game logic to provide the corresponding game interaction function for the user (for example, the user can control the flight direction, trajectory, speed, time, etc. of the rocket through game interaction operations). After a round of the game ends, it can jump to the next time round, and the service side can continue to execute the corresponding small rocket casual game logic in the new time round, and the user can carry out a new round of game interaction.

[0033] In the small rocket casual game, the core game logic is implemented based on time rounds. After the user participates in the game, the game logic dynamically controls the flight and explosion process of the rocket according to the time rounds. The rocket will reach the end point and explode after the predetermined flight time, and then seamlessly connect to the next round of the game to ensure the coherence and interest of the game rhythm. Optionally, two time round mechanisms, namely normal rounds and special detonation points, can be integrated into the small rocket casual game to meet the requirements in different scenarios. The normal round can be understood as the time round when the game proceeds normally according to the game logic for one round (for example, the user controls the rocket to fly to the end point within the predetermined flight time). After the rocket flies for the preset time and explodes normally, the current round ends. When the current round ends, the game automatically enters the next round and notifies all users of the start time and rules of the new round. The special detonation point can be understood as that during the rocket flight, if it is detected that a specific business condition fails to meet the standard (such as the player makes a mistake in operation, fails to reach the specified target, etc.), the special detonation point is immediately triggered, forcibly ending the current round and immediately starting a new round of the game to ensure the real-time nature and interactivity of the game.

[0034] For example, the sub-rounds of the normal round in the small rocket casual game can include the participation round, the flight waiting round, the flight round, and the data cleaning round. The small rocket casual game performs the transfer of time sub-rounds in the order of the participation round, the flight waiting round, the flight round, and the data cleaning round to achieve multiple rounds of playing the game. Among them, the participation round is the participation stage of the game. During this period, the player can participate in or withdraw from the game. The flight waiting round (for example, lasting for 5s) is used to calculate the number of players participating in the game and the initial detonation point (for example, the explosion position of the rocket when the player does not operate). The flight round is the time elapsed from the takeoff of the rocket to the explosion (for example, at most 76s, with an additional 7s buffer). The data cleaning round (for example, lasting for 2s) is used to execute the game data cleaning logic, such as creating the next round after the rocket explodes and cleaning the data of this round. Optionally, preset fallback expiration rounds can be built into the information of each round to indicate that the time round has timed out and a new time round needs to be created as a fallback. Among them, the participation round and the data cleaning round in the small rocket casual game are the starting sub-round and the last sub-round of the time round respectively, and the remaining sub-rounds are intermediate sub-rounds.

[0035] S120: Determine the current round stage according to the current time, the round time in the current round information, and the sub-round durations of one or more sub-rounds.

[0036] Exemplarily, after determining the current round information of the current time round, according to the current time, the round time in the current round information (for example, the round start time of the current time round), and the sub-round durations of one or more sub-rounds (that is, the time periods during which the sub-rounds last), determine the current round stage of the current time round (that is, determine the sub-round stage to which the current time has flowed).

[0037] For example, determine the time difference between the current time and the start time of the current round, determine the sub-round duration range corresponding to the time difference, and determine the current round stage according to the sub-round duration range corresponding to the time difference. For example, when the time difference corresponds to the duration range of the last sub-round, the current round stage is the last sub-round stage; when the time difference exceeds the total duration range of the time round, the current round stage is the preset fallback expiration round stage; when the time difference corresponds to the duration range of other sub-rounds, the current round stage is the corresponding sub-round stage.

[0038] S130: When the current round stage is the preset round generation stage, create a new time round for the business side to perform business processing based on the created time round.

[0039] The preset round generation stage provided by this application includes one or a combination of more of the last sub-round stage, the preset fallback expiration round stage, and the preset sub-round stage. The last sub-round stage is the last sub-round of the current time round. The time period of the preset fallback expiration round stage is longer than the time period of the current time round. The preset sub-round stage corresponds to the sub-round stage before the last sub-round stage among the multiple sub-round stages corresponding to the current time round. Among them, the preset fallback expiration round stage can be understood as the stage for fallback creation of a new time round. For example, if the preset fallback expiration round stage is set to be after a time round, then when no new time round is detected after a time round ends, a new time round needs to be created in a timely manner to ensure the normal operation of the business.

[0040] Exemplarily, after determining the current round stage, determine whether the current round stage is the preset round generation stage. When the current round stage is not the preset round generation stage, the current business time round management process can be ended, and it can be put into sleep or proceed to the next business time round management process. When the current round stage is the preset round generation stage, a new time round can be created. After creating the new time round, the corresponding round information can be fed back to the business side based on the newly created time round (for example, sending the round information to the round management database, and the business side can obtain the latest round information from the round management database). The business side can perform business processing based on the created time round (for example, executing game-related business logic within the time round to provide game services to users). After the business side completes the business processing of one time round, it can perform the next round of business processing according to the new time round.

[0041] As described above, during the execution of the round status task, the current round stage is determined according to the current time, the round time in the current round information, and the sub-round duration, and a new time round is created when the current round stage is the stage of the preset round, so that the business side can perform business processing according to the created time round. By accurately determining the current round stage of the time round of the current time and creating a new time round in time when the current round stage is the stage of the preset round, a new time round can be flexibly created in a dynamic and highly concurrent scenario without waiting for the end of a fixed time round to generate a new time round, which can ensure that the business processing can be performed in time according to the newly created time round when entering the next business round, effectively improving the flexibility of business time round management and effectively adapting to complex and changeable business requirements.

[0042] Based on the above embodiments, Figure 2 The flowchart of another business time round management method provided by the embodiment of the present application is given. This business time round management method is a concretization of the above business time round management method. Refer to Figure 2 and this business time round management method includes:

[0043] S210: Determine whether the round task start condition is satisfied according to the preset time round configuration information. The preset time round configuration information is configured with the round task start condition and the round task stop condition of the time round.

[0044] S220: When it is detected that the round task start condition is satisfied, start the round status task according to the preset time round configuration information.

[0045] In one embodiment, one or more preset time round configuration information can be pre-configured. The preset time round configuration information can be configured with the round task start condition, the round task stop condition of the time round, the sub-rounds included in the time round, and the sub-round duration of each sub-round. Different business scenarios can configure different preset time round configuration information, and each preset time round configuration information can correspond to different business sides. Among them, the round task start condition can be used to indicate the timing of starting the time round generation process, and the round task stop condition can be used to indicate the termination condition of the time round generation process, ensuring that the generation of the time round stops at an appropriate time and avoiding resource waste.

[0046] Optionally, the startup timing of the time round generation process can be automatically triggered. For example, the upstream service actively starts the round generation process through the API interface. The startup timing of the time round generation process can also be triggered by user interaction, such as a user click operation or a login behavior. By using a message middleware such as Kafka to listen to user actions in real time and automatically respond to preset user actions to start the time round generation process. The termination timing of the time round generation process can be not stopped. For example, for permanent activities, the termination timing can be not set (for example, set the termination timing to the default value) to ensure continuous generation of time rounds. The termination timing of the time round generation process can also be triggered by user behavior. For example, when the user exits the page or logs out, message components such as Kafka can immediately sense and respond to the user behavior and stop the generation of time rounds in a timely manner. This application supports setting the generation and stop timing of time rounds corresponding to the business, as well as planning the total round time and finely allocating the sub-round time. The setting mechanism for the generation and stop timing can list multiple scenarios through enumeration and reserve the scalability of the preset time round configuration to support subsequent addition of monitoring conditions, so as to meet the requirements of complex business scenarios.

[0047] Exemplarily, it is monitored in real time whether there is preset time round configuration information that meets the round task startup condition. When it is detected that there is preset time round configuration information that meets the round task startup condition, the round status task is started according to the preset time round configuration information. During the execution of the round status task, time rounds will be created based on the preset time round configuration information corresponding to the round status task.

[0048] In one embodiment, after the business time round management method provided by this application starts the round status task according to the preset time round configuration information, it further includes: determining whether the round task stop condition is met according to the preset time round configuration information; when it is detected that the round task stop condition is met, stopping the round status task corresponding to the preset time round configuration information.

[0049] Exemplarily, it is monitored in real time whether there is preset time round configuration information that meets the round task stop condition. When it is detected that there is preset time round configuration information that meets the round task stop condition, the round status task corresponding to the preset time round configuration information is stopped, and the time round generation corresponding to the round status task is no longer executed. This application flexibly configures the startup timing and stop timing of time round generation through the round task startup condition, effectively improving the flexibility and efficiency of time round management.

[0050] S230: Determine the master data node among multiple data centers.

[0051] S240: During the execution of the round status task, when the current data center is the master data node, determine the current round information of the current time round, where the current time round includes one or more sub-rounds.

[0052] Exemplarily, after starting the round status task, the master data node is elected among multiple data centers. The finally elected master data node can be the current data center or other data centers. In one embodiment, during the execution of the round status task, when the master data node is another data center, the current data center can perform a sleep operation for a preset time, and the data center serving as the master data node executes the time round management process of this round. When the current data center is the master data node, the current data center executes the time round management process of this round, that is, determines the current round information of the current time round, and executes the subsequent time round management process according to the current round information.

[0053] For example, in a global business, a database (such as a Codis database) and an execution script (such as a Lua script) are used to implement the master node election of multiple data centers, and the renewal time of the master node election can be set to 2 seconds. If the execution result of the execution script returns the first preset information (such as true), the current data center is identified as the master data node and continues to execute the subsequent tasks; if the execution result of the execution script returns the second preset information (such as false), the current data center is not the master data node, and the task will directly return and perform a sleep operation. When it is determined that the current data center is the master data node, the nodes inside the current data center can create a time round through a competitive lock mechanism to ensure that only one process can execute this time round creation task at any given time point. In the process of executing the round status task of this application, the time round is managed by the data center serving as the master data node, and the robustness and consistency in the multi-data center deployment are strengthened through the multi-machine room master selection mechanism, effectively avoiding data conflict and inconsistency problems, and effectively ensuring the consistency of round generation in the multi-machine room environment.

[0054] In a possible embodiment, the business time round management method provided by this application is characterized in that determining the current round information of the current time round includes: retrieving from the round management database the round information whose start time is earlier than the current time and whose round identifier is the largest, and determining the retrieved round information as the current round information, where the round management database records the round information corresponding to multiple time rounds.

[0055] In one embodiment, after the creation of a time wheel round in the data center, the round information of the created time wheel is saved to a preset round management database (such as a redis database). In the normal generation process of the time wheel, the data center, as the main data node, will create the next round of the time wheel in the last sub-round stage and save it to the round management database. It can also generate the next round of the time wheel in the preset fallback expiration round stage or the preset sub-round stage, or generate the next round of the time wheel in the middle sub-round stage in response to a business-side request to end the round (for example, the rocket explodes midway in the small rocket casual game). Before creating the next round of the time wheel, the round management database records the round information corresponding to the currently ongoing time wheel.

[0056] Exemplarily, in the preset round management database, retrieve the round information whose start time is earlier than the current time and whose round identifier is the largest. If the start time corresponding to the round information with the largest round identifier is later than the current time, it can be considered that the next round of the time wheel has been created, and the task can be directly returned and a sleep operation can be executed.

[0057] In one embodiment, when the round information whose start time is earlier than the current time and whose round identifier is the largest is retrieved in the round management database, the retrieved round information can be determined as the current round information. By using the round information whose start time is earlier than the current time and whose round identifier is the largest as the current round information, the present application ensures the correct determination of the current round stage and the accurate determination of the timing for creating the time wheel.

[0058] S250: Determine the current round stage according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds.

[0059] In a possible embodiment, the business time wheel management method provided by the present application determines the current round stage according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds, including at least one of the following:

[0060] S251: When the round end time in the current round information is less than or equal to a preset value, and the time length between the current time and the round start time of the current time wheel is longer than the total round duration of the current time wheel, determine that the current round stage is the preset fallback expiration round stage.

[0061] S252: When the round end time in the current round information is greater than the preset value, and the time length between the round end time and the current time is less than or equal to the duration of the last sub-round, determine that the current round stage is the last sub-round stage.

[0062] Exemplarily, it is determined whether the round end time in the current round information is greater than a preset value. Optionally, the preset value can be configured as 0. When the data center creates a time round, it can determine the round identifier and round start time of the time round. When it is determined that the current round stage is the last sub-round stage, the round end time is calculated based on the round start time and the total round duration of the corresponding time round (the sum of the durations of each sub-round). Based on this, before entering the last sub-round stage, the corresponding round end time is not calculated and set. At this time, the round end time in the current round information is less than or equal to the preset value (for example, the round end time is default configured as 0). After entering the last sub-round stage and calculating and setting the corresponding round end time, the round end time in the current round information is greater than the preset value.

[0063] In one embodiment, when the round end time in the current round information is less than or equal to the preset value, it is determined whether the time length between the current time and the round start time of the current time round (the time length from the round start time of the current time round to the current time, for example, the difference between the current time and the round start time of the current time round) is longer than the total round duration of the current time round. When the time length between the current time and the round start time of the current time round is longer than the total round duration of the current time round, it can be determined that the current round stage is a preset fallback expiration round stage. When the time length between the current time and the round start time of the current time round is shorter than or equal to the total round duration of the current time round, it can be determined that the current round stage is an intermediate sub-round stage.

[0064] When the round end time in the current round information is greater than the preset value, it is determined whether the time length between the round end time and the current time (the time length from the current time to the round end time, for example, the difference between the round end time and the current time) is shorter than or equal to the duration of the last sub-round. When the time length between the round end time and the current time is shorter than or equal to the duration of the last sub-round, it can be determined that the current round stage is the last sub-round stage. When the time length between the round end time and the current time is longer than the duration of the last sub-round, it can be determined that the current round stage is an abnormal stage round (for example, an abnormal stage round is built in for each round information to indicate that there is an abnormality in the time round management and an alarm process can be performed). This application accurately determines the current round stage based on the current time, the round time in the current round information, and the sub-round durations of one or more sub-rounds, accurately determines the timing of creating a time round, and improves the accuracy of business time round management.

[0065] For example, in the small rocket casual game, the sub-rounds of the time round include the participation round (corresponding duration is T1), the flight waiting round (corresponding duration is T2), the flight round (corresponding duration is T3), and the data cleaning round (corresponding duration is T4). The start time of the current time round is startTime, the current time is currentTime, and the end time of the round is endTime. Among them, the participation round is the starting sub-round, the data cleaning round is the last sub-round, and the flight waiting round and the flight round are the intermediate sub-rounds. When endTime > 0 and endTime - currentTime ≤ T4, it can be determined that the current round stage is the last sub-round stage (T4 stage). When endTime > 0 and endTime - currentTime > T4, it can be determined that the current round stage is the abnormal stage round (T5 stage). When endTime ≤ 0 and currentTime - startTime > the total round duration, it can be determined that the current round stage is the preset fallback expired round stage (T0 stage). When endTime ≤ 0, currentTime - startTime ≤ the total round duration, and currentTime - startTime ≤ T1, it can be determined that the current round stage is the starting sub-round stage (T1 stage). When endTime ≤ 0, currentTime - startTime ≤ the total round duration, and currentTime - startTime ≤ (T1 + T2), it can be determined that the current round stage is the flight waiting round stage (T2 stage). When endTime ≤ 0, currentTime - startTime ≤ the total round duration, and currentTime - startTime > (T1 + T2), it can be determined that the current round stage is the flight round stage (T3 stage).

[0066] In a possible implementation, after the business time round management method provided by this application determines the current round stage according to the current time, the round time in the current round information, and the sub-round durations of one or more sub-rounds, it further includes at least one of the following: when the current round stage is the last sub-round stage and there is no round information in the round management database whose round start time is later than the round end time of the current round, create a new time round; when the current round stage is the preset fallback expired round stage and there is no round information in the round management database whose round start time is later than the round start time of the current round, create a new time round.

[0067] Exemplarily, when the current round stage is the last sub-round stage, determine whether there is round information in the round management database whose round start time is later than the round end time of the current round. When there is round information in the round management database whose round start time is later than the round end time of the current round, it can be determined that the time round of the next round has been created, and the business time round management process of this round can be ended. When there is no round information in the round management database whose round start time is later than the round end time of the current round, there may be an abnormal situation in time round creation. Then, a new time round is created to ensure the timely creation of the time round and ensure the continuity of the business and the coherence of the user experience.

[0068] When the current round stage is the preset fallback expiration round stage, determine whether there is round information in the round management database whose round start time is later than the round start time of the current round. When there is round information in the round management database whose round start time is later than the round start time of the current round, it can be determined that the time round of the next round has been created, and the business time round management process of this round can be ended. When there is no round information in the round management database whose round start time is later than the round start time of the current round, there may be an abnormal situation in time round creation. Then, a new time round is created to ensure the timely creation of the time round and ensure the continuity of the business and the coherence of the user experience.

[0069] S260: When the current round stage is the preset round generation stage, create a new time round for the business side to perform business processing according to the created time round.

[0070] In a possible embodiment, the business time round management method provided by this application further includes: when receiving a round end request sent by the business side, create a new time round. Exemplarily, when the business side needs to temporarily end the current time round and enter the next time round, it can send a round end request to the data center. After receiving the round end request, the data center determines the master data node among multiple data centers, and the master data node creates a new time round. The business side will execute the corresponding business with the newly created time round.

[0071] For example, when the rocket explodes midway (at this time, it is in the flight round stage) in the small rocket casual game, it is necessary to end the current time round and enter the next time round to start a new round of the game. The business side can send a round end request to the data center to create a new time round, and the business side will execute the game logic with the newly created time round. When this application receives a round end request sent by the business side, it creates a new time round to ensure that the business side can start the next round of business according to the new time round, and ensure the timely creation of the time round and the continuity of the business and the coherence of the user experience.

[0072] In a possible embodiment, before creating a new time round, the service time round management method provided by this application further includes: determining the round request frequency of the round generation request, where the round generation request is generated by the service side; and configuring a preset sub-round stage when the round request frequency reaches a preset frequency threshold.

[0073] Exemplarily, record the received round generation request, and determine the round request frequency based on the round generation requests received within a preset time period. Among them, when the service side needs to generate a time round, it can send a round generation request to the data center. When the round request frequency reaches the preset frequency threshold, the preset sub-round stage is configured. Subsequently, when it is detected that the current round stage is the preset sub-round stage, a new time round will be created. Among them, the preset sub-round stage is the sub-round stage before the last sub-round stage (such as the starting sub-round stage, the intermediate sub-round stage).

[0074] In one embodiment, before configuring the preset sub-round stage, the data center creates a new time round when the current round stage is the last sub-round stage and the preset fallback expiration round stage. After setting the preset sub-round stage, the creation time of the time round is advanced to the preset sub-round stage, reducing the latency of real-time generation of the time round and ensuring high availability and response speed of time round management in high-concurrency scenarios. Optionally, when the duration for which the round request frequency reaches the preset frequency threshold reaches a preset duration threshold, the preset sub-round stage is moved to the previous sub-round stage to further advance the pre-generation time of the time round and reduce the latency of real-time generation of the time round.

[0075] For example, during the business peak period, since a single business may instantaneously trigger a large number of generation requests in a short period, the system load will increase sharply, delaying the timely continuation of the next time round. An alarm can be triggered when the real-time generation round demand is detected 5 times or more within 1 minute. If this situation occurs repeatedly within 5 consecutive minutes (i.e., the alarm is triggered 5 times in total), it is considered that the round request frequency reaches the preset frequency threshold. The pre-generation timing can be advanced to the middle sub-round stage of the previous round to initiate the creation of the next time round in advance. If continuous alarm signals are received in the next 5 minutes, the pre-generation timing can be further advanced, and so on, forming a gradually advancing strategy. At the same time, the alarm data can be reported in real time for subsequent analysis of the correlation between the business round generation rate and the pre-generation time node. The average rate at the time of alarm occurrence within a preset time period (in the past 7 days) can also be statistically analyzed to calculate the average rate of round generation when the pre-generation timing is advanced to different sub-round stages. When the current generation rate reaches a preset proportion (e.g., 80%) of the advanced alarm trigger threshold, the pre-generation timing can be actively adjusted in advance, effectively reducing the occurrence of alarms while further reducing the latency of real-time generation, ensuring the high availability and response speed of the system in high-concurrency scenarios. By dynamically associating the time round generation rate of the service with the pre-generation node and combining the alarm escalation and pre-generation timing advancement mechanisms, the latency of real-time time round generation can be significantly reduced, and the response speed and processing capacity of the system in high-concurrency scenarios can be improved.

[0076] In a possible embodiment, the business time round management method provided by the present application for creating a new time round may be: determining a candidate round identifier according to the round identifier of the current time round, and determining the maximum round identifier recorded in the round management database; in the case where the candidate round identifier is less than or equal to the maximum round identifier, determining a target round identifier according to a preset step size and the candidate round identifier; and creating a new time round according to the target round identifier.

[0077] Exemplarily, determine a candidate round identifier based on the round identifier of the current time round, and determine the maximum round identifier recorded in the round management database, where the candidate round identifier can be obtained by adding a preset value to the round identifier of the current time round (for example, candidate round identifier = round identifier of the current time round + 1). When the candidate round identifier is less than or equal to the maximum round identifier, there may be a situation of synchronization delay in the main computer room (for example, after the main computer room process freezes, the secondary computer room is upgraded to the main, and the old main computer room data has not been synchronized to the new main computer room), then determine the target round identifier according to the preset step size (for example, a step size greater than 1) and the candidate round identifier, that is, target round identifier = candidate round identifier + preset step size, and then create a new time round with the target round identifier as the final round identifier, which can effectively reduce the conflict situation of the round identifier written into the round management database due to the synchronization delay of the database and ensure the normal operation of the service.

[0078] In one embodiment, in the case where the main computer room process in the data center freezes after the election of the master is successful, the master data node can be re-determined among multiple data centers, and the timestamp of the successful election of the master is updated to the round management database. If the election of the master fails in other computer rooms, check whether the time from the successful election of the master in the round management database to the current time exceeds the preset time threshold. If it exceeds the preset time threshold, upgrade itself to the main computer room. In the case where the non-main computer room process freezes or all computer room processes freeze in the data center, after each execution of the business time round management process, report the execution result of the computer room ID and increase the monitoring and warning of the computer room. This application provides an efficient detection, diagnosis, and recovery mechanism for possible abnormal scenarios, and at the same time provides an efficient fault tolerance strategy, effectively ensuring the reliability of round generation and the stability of the system, and ensuring the continuity of the service and the coherence of the user experience.

[0079] As described above, during the execution of the round status task, the current round stage is determined based on the current time, the round time in the current round information, and the sub-round duration. When a new time round is created at the current round stage for the preset round generation stage, the business side can perform business processing according to the created time round. By accurately determining the current round stage of the time round at the current time and promptly creating a new time round at the current round stage for the preset round generation stage, new time rounds can be flexibly created in dynamic and high-concurrency scenarios without waiting for the fixed time round to end before generating a new one. It can ensure that when entering the next business round, business processing can be promptly carried out according to the newly created time round, effectively improving the flexibility of business time round management and effectively adapting to complex and changing business requirements. Based on the high-availability master selection mechanism in a multi-data center environment, it is ensured that the system can seamlessly switch to the standby data center when the main data center fails. By providing an API interface to the upstream business segment, it supports the business side to forcibly interrupt the current round and immediately regenerate the time round. The refinement and independent status management of sub-rounds are also utilized to ensure the complete flow of the round task status and ensure the uniqueness, traceability, and trend incrementality of each round identifier, enhancing the reliability and operability of time round management. The generation rate of the business time round can also be dynamically associated with the pre-generation node. By combining the alarm escalation and the mechanism of advancing the pre-generation time, the pre-generation of future time rounds can be precisely controlled, further improving the efficiency and accuracy of business processing.

[0080] Figure 3 It is a schematic structural diagram of a business time round management device provided by an embodiment of the present application. Refer to Figure 3 The business time round management device includes a round detection module 31, a stage determination module 32, and a round creation module 33.

[0081] Among them, the round detection module 31 is configured to determine the current round information of the current time round during the execution of the round status task, and the current time round includes one or more sub-rounds; the stage determination module 32 is configured to determine the current round stage according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds; the round creation module 33 is configured to create a new time round when the current round stage is the preset round generation stage, for the business side to perform business processing according to the created time round.

[0082] As described above, during the execution of the round status task, the current round stage is determined based on the current time, the round time in the current round information, and the sub-round duration, and a new time round is created when the current round stage generates a stage for the preset round, so that the business side can perform business processing according to the created time round. By accurately determining the current round stage of the time round at the current time and creating a new time round in time when the current round stage generates a stage for the preset round, a new time round can be flexibly created in a dynamic and highly concurrent scenario without waiting for the fixed time round to end before generating a new time round, which can ensure that the business processing can be performed in time according to the newly created time round when entering the next business round, effectively improving the flexibility of business time round management and effectively adapting to complex and changeable business requirements.

[0083] In a possible embodiment, the business time round management device includes a master node election module, and the master node election module is configured to determine the master data node among multiple data centers;

[0084] Correspondingly, the round detection module 31 determines the current round information of the current time round and is configured as follows:

[0085] In the case where the current data center is the master data node, determine the current round information of the current time round.

[0086] In a possible embodiment, the round detection module 31 determines the current round information of the current time round and is configured to: retrieve the round information whose start time is earlier than the current time and whose round identifier is the largest from the round management database, and determine the retrieved round information as the current round information, where the round management database records the round information corresponding to multiple time rounds.

[0087] In a possible embodiment, the stage determination module 32 determines the current round stage according to the current time, the round time in the current round information, and the sub-round durations of one or more sub-rounds, and is configured as at least one of the following:

[0088] In the case where the round end time in the current round information is less than or equal to a preset value, and the time length between the current time and the round start time of the current time round is longer than the total round duration of the current time round, determine the current round stage as the preset fallback expired round stage;

[0089] In the case where the round end time in the current round information is greater than the preset value, and the time length between the round end time and the current time is shorter than or equal to the duration of the last sub-round, determine the current round stage as the last sub-round stage.

[0090] In a possible embodiment, the business time round management device further includes a pre-generation configuration module, and the pre-generation configuration module is configured to:

[0091] Determine the round request frequency of the round generation request, where the round generation request is generated by the service side;

[0092] When the round request frequency reaches the preset frequency threshold, configure the preset sub-round stage.

[0093] In a possible embodiment, the service time round management device further includes an exception handling module, and the exception handling module is configured as at least one of the following:

[0094] When the current round stage is the last sub-round stage and there is no round information in the round management database whose round start time is later than the round end time of the current round, create a new time round;

[0095] When the current round stage is the preset fallback expiration round stage and there is no round information in the round management database whose round start time is later than the round start time of the current round, create a new time round.

[0096] In a possible embodiment, the service time round management device further includes a task start module, and the task start module is configured as:

[0097] Determine whether the round task start condition is satisfied according to the preset time round configuration information, where the preset time round configuration information is configured with the round task start condition and the round task stop condition of the time round;

[0098] When it is detected that the round task start condition is satisfied, start the round status task according to the preset time round configuration information;

[0099] The service time round management device further includes a task stop module, and the task stop module is configured as:

[0100] Determine whether the round task stop condition is satisfied according to the preset time round configuration information;

[0101] When it is detected that the round task stop condition is satisfied, stop the round status task corresponding to the preset time round configuration information.

[0102] In a possible embodiment, the service time round management device further includes an end response module, and the end response module is configured as: when receiving the round end request sent by the service side, create a new time round.

[0103] In a possible embodiment, the round creation module 33 creates a new time round and is configured as:

[0104] Determine the candidate round identifier according to the round identifier of the current time round, and determine the maximum round identifier recorded in the round management database;

[0105] When the candidate round identifier is less than or equal to the maximum round identifier, determine the target round identifier according to a preset step size and the candidate round identifier;

[0106] Create a new time round according to the target round identifier.

[0107] It should be noted that in the embodiments of the above service time wheel management device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiments of the present application.

[0108] The embodiments of the present application also provide a service time wheel management device, and the service time wheel management device can integrate the service time wheel management device provided by the embodiments of the present application. Figure 4 It is a schematic structural diagram of a service time wheel management device provided by the embodiments of the present application. Refer to Figure 4 , the service time wheel management device includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when the one or more programs are executed by the one or more processors 41, the one or more processors 41 implement the service time wheel management method provided in the above embodiments. The above-provided service time wheel management device, device, and computer can be used to execute the service time wheel management method provided in any of the above embodiments, and have the corresponding functions and beneficial effects.

[0109] The embodiments of the present application also provide a non-volatile storage medium storing computer-executable instructions, and the computer-executable instructions are used to execute the service time wheel management method provided in the above embodiments when executed by a computer processor. Of course, for the non-volatile storage medium storing computer-executable instructions provided by the embodiments of the present application, the computer-executable instructions are not limited to the service time wheel management method provided above, and can also execute the related operations in the service time wheel management method provided in any embodiment of the present application. The service time wheel management device, device, and storage medium provided in the above embodiments can execute the service time wheel management method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, reference can be made to the service time wheel management method provided in any embodiment of the present application.

[0110] Based on the above embodiments, the embodiments of the present application further provide a computer program product. Essentially, or the part that contributes to the prior art, or all or part of the technical solution of the present application can be embodied in the form of a software product. The computer program product is stored in a storage medium and includes several instructions to enable a computer device, a mobile terminal, or a processor therein to execute all or part of the steps of the business time wheel management method provided in each embodiment of the present application.

Claims

1. A method for managing business time rounds, characterized in that, Including: During the execution of the round status task, determine the current round information of the current time round, where the current time round includes one or more sub-rounds; Determine the current round phase according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds; In the case where the current round phase is a preset round generation phase, create a new time round for the business side to perform business processing according to the created time round.

2. The service time wheel management method according to claim 1, wherein The preset round generation phase includes one or more combinations of the last sub-round phase, the preset fallback expired round phase, and the preset sub-round phase. Among them, the time period of the preset fallback expired round phase is longer than the time period of the current time round, and the preset sub-round phase corresponds to the sub-round phase in the current time round before the last sub-round phase.

3. The service time wheel management method according to claim 1, wherein Before determining the current round information of the current time round, it further includes: Determine the master data node among multiple data centers; Correspondingly, the determination of the current round information of the current time round includes: In the case where the current data center is the master data node, determine the current round information of the current time round.

4. The service time wheel round management method according to claim 1, wherein The determination of the current round information of the current time round includes: Retrieve the round information with a start time earlier than the current time and the largest round identifier from the round management database, and determine the retrieved round information as the current round information, where the round management database records the round information corresponding to multiple time rounds.

5. The service time wheel management method according to claim 1, wherein The determination of the current round phase according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds includes at least one of the following: In the case where the round end time in the current round information is less than or equal to a preset value, and the time length between the current time and the round start time of the current time round is longer than the total round duration of the current time round, determine that the current round phase is the preset fallback expired round phase; In the case where the round end time in the current round information is greater than the preset value, and the time length between the round end time and the current time is less than or equal to the last sub-round duration, determine that the current round phase is the last sub-round phase.

6. The service time wheel round management method according to claim 1, wherein Before creating the new time round, it further includes: Determine the round request frequency of the round generation request, where the round generation request is generated by the business side; In the case where the round request frequency reaches the preset frequency threshold, configure the preset sub-round phase.

7. The service time wheel management method according to claim 1, wherein After determining the current round phase according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds, it further includes at least one of the following: In the case where the current round phase is the last sub-round phase, and there is no round information in the round management database with a round start time later than the round end time of the current round, create a new time round; When the current round stage is a preset fallback expiration round stage and there is no round information in the round management database with a round start time later than the round start time of the current round, a new time round is created.

8. The service time wheel management method according to claim 1, wherein Before determining the current round information of the current time round, it further includes: Determining whether the round task start condition is met according to the preset time round configuration information, where the preset time round configuration information is configured with the round task start condition and the round task stop condition of the time round; When it is detected that the round task start condition is met, starting the round status task according to the preset time round configuration information; After starting the round status task according to the preset time round configuration information, it further includes: Determining whether the round task stop condition is met according to the preset time round configuration information; When it is detected that the round task stop condition is met, stopping the round status task corresponding to the preset time round configuration information.

9. The service time wheel management method according to claim 1, characterized in that It further includes: When a round end request sent by the service side is received, creating a new time round.

10. The service time wheel management method according to claim 1, characterized in that, The creating of the new time round includes: Determining a candidate round identifier according to the round identifier of the current time round, and determining the maximum round identifier recorded in the round management database; When the candidate round identifier is less than or equal to the maximum round identifier, determining a target round identifier according to a preset step size and the candidate round identifier; Creating a new time round according to the target round identifier.

11. A service time wheel management device, characterized in that, It includes a round detection module, a stage determination module, and a round creation module, where: The round detection module is configured to determine the current round information of the current time round during the execution of the round status task, and the current time round includes one or more sub-rounds; The stage determination module is configured to determine the current round stage according to the current time, the round time in the current round information, and the sub-round duration of one or more sub-rounds; The round creation module is configured to create a new time round when the current round stage is a preset round generation stage for the service side to perform service processing according to the created time round.

12. A service time wheel management device, characterized in that, It includes: A memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the service time round management method according to any one of claims 1 - 10.

13. A non-volatile storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the service time round management method according to any one of claims 1 - 10 when executed by a computer processor.

14. A computer program product, comprising a computer program, characterized in that, The computer program implements the service time round management method according to any one of claims 1 - 10 when executed by a processor.