Ranking List Generation Method, Device, Storage Medium and Computer Equipment
By selecting the target server cluster in the server cluster for data storage and ranking calculation, the problems of inconsistent data versions and redundant calculations in the distributed rankings are solved, ensuring data consistency and computing efficiency.
Patent Information
- Application Number
- CN202211129506.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2042-09-16
AI Technical Summary
In the existing ranking generation plan, the distributed rankings have the problem of inconsistent data versions, and it is easy to cause redundant calculations and performance hotspots during calculations, and the disaster recovery capabilities of a stand-alone system are relatively weak.
Use a consistent hashing algorithm to select the target server cluster in the server cluster for data storage and ranking calculations to ensure data consistency, and upload the global ranking to the database when the calculation is completed to avoid simultaneous calculations of the server cluster.
The data consistency during the ranking generation process is achieved, redundant calculations are reduced, and the accuracy and efficiency of global ranking calculations are improved.
Smart Images

Figure CN115487489B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of leaderboard processing, and particularly relates to a leaderboard generation method, device, storage medium, and computer device. Background Art
[0002] Leaderboards can be seen everywhere in application scenarios, especially in game scenarios. In existing leaderboard generation solutions, in order to ensure their reliability, low latency, and consistency, etc., leaderboards are divided into single-machine leaderboards and distributed leaderboards based on the construction architecture.
[0003] Since the performance of the single-machine method is limited, centralized processing of all leaderboard data will also cause performance hotspots, and the disaster tolerance and reliability of the single-machine system are weak. Therefore, the distributed leaderboard method is more commonly used. However, the distributed leaderboard also has its drawbacks and problems. For example, all central nodes of the clusters need to calculate the global leaderboard, and due to the uncontrollability of data update delays in each cluster, there are also cases where the data recorded in each cluster has inconsistent versions. Summary of the Invention
[0004] Embodiments of this application provide a leaderboard generation method, device, storage medium, and computer device, which can ensure the consistency of calculation data, reduce redundant calculations during calculation, and improve the accuracy of global leaderboard calculation.
[0005] Embodiments of this application provide a leaderboard generation method, including:
[0006] When a game of the target game ends, controlling the first target server cluster to upload the first game data generated by the game user in a game to the database;
[0007] Determining a second target server cluster for leaderboard calculation among all target server clusters;
[0008] Obtaining second game data for leaderboard calculation from the database and sending the second game data to the second target server cluster;
[0009] Controlling the second target server cluster to calculate the leaderboard based on the second game data, and uploading the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0010] Embodiments of this application also provide a leaderboard generation device, including:
[0011] A data storage module, configured to control the first target server cluster to upload the first game data generated by the game user in a game to the database when a game of the target game ends;
[0012] A calculation and determination module, configured to determine a second target server cluster for leaderboard calculation among all target server clusters;
[0013] A data acquisition module, configured to acquire second game data for leaderboard calculation from a database and send the second game data to the second target server cluster;
[0014] A calculation and storage module, configured to control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0015] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which is suitable for being loaded by a processor to execute the steps in the leaderboard generation method described in any of the above embodiments.
[0016] An embodiment of the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor executes the steps in the leaderboard generation method described in any of the above embodiments by calling the computer program stored in the memory.
[0017] In the leaderboard generation method, apparatus, storage medium, and computer device provided by the embodiments of the present application, at the end of a game, in order to save the data generated by the game, a first target server cluster is selected from all server clusters based on the consistent hashing algorithm as the server for data saving, and all game user's server clusters in a game will send the first game data generated by the game user in the game to the first target server cluster for uploading to the database. Then, when calculating the leaderboard, a second target server cluster is selected from all server clusters based on the consistent hashing algorithm for leaderboard calculation. Next, second game data for leaderboard calculation is obtained from the database and sent to the second target server cluster for global leaderboard calculation. Finally, when the global leaderboard calculation is completed, the obtained global leaderboard is uploaded to the database to facilitate all server clusters to view the global leaderboard. It realizes that during the leaderboard generation process, the game data generated at the end of the game is uniformly saved to the associated database to ensure data consistency. Then, a server cluster for calculation is selected during leaderboard calculation, and the global leaderboard is uploaded to the database when the calculation is completed to facilitate all server clusters to load and view the global leaderboard, avoiding simultaneous calculation by all server clusters and reducing redundant calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0019] Figure 1 System schematic diagram of the leaderboard generation device provided by the embodiment of the present application;
[0020] Figure 2 Flow schematic diagram of the leaderboard generation method provided by the embodiment of the present application;
[0021] Figure 3 Framework schematic diagram of the leaderboard system provided by the embodiment of the present application;
[0022] Figure 4 Another flow schematic diagram of the leaderboard generation method provided by the embodiment of the present application;
[0023] Figure 5 Schematic diagram of the relationship between the period and the time slice provided by the embodiment of the present application;
[0024] Figure 6 Flow schematic diagram of the steps of the response data disk storage instruction provided by the embodiment of the present application;
[0025] Figure 7 Structural schematic diagram of the leaderboard generation device provided by the embodiment of the present application;
[0026] Figure 8 Structural schematic diagram of the computer device provided by the embodiment of the present application. Detailed implementation manners
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0028] Embodiments of the present application provide a method, apparatus, storage medium, and computer device for generating a leaderboard. Specifically, the method for generating a leaderboard according to the embodiments of the present application can be executed by a computer device, where the computer device can be a terminal or a server, etc. The terminal can be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal can also include a client, and the client can be a game application client, a browser client with a game program, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0029] For example, when the method for generating a leaderboard runs on a terminal, the terminal device stores a game application program and is used to present a virtual scene in the game screen. The terminal device is used to interact with the user through a graphical user interface. For example, the game application program is downloaded and installed on the terminal device and run. The way the terminal device provides the graphical user interface to the user can include various methods. For example, it can be rendered and displayed on the display screen of the terminal device, or the graphical user interface can be presented through holographic projection. For example, the terminal device can include a touch display screen and a processor. The touch display screen is used to present the graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The graphical user interface includes a game screen, and the processor is used to run the game, generate the graphical user interface, respond to operation instructions, and control the display of the graphical user interface on the touch display screen.
[0030] For example, when the ranking list generation method runs on a server, it can be a cloud game. A cloud game refers to a game mode based on cloud computing. In the operation mode of a cloud game, the running entity of the game application and the entity presenting the game screen are separated. The storage and operation of the ranking list generation method are completed on the cloud game server, while the presentation of the game screen is completed on the cloud game client. The cloud game client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud game client can be a display device with data transmission function near the user side, such as a mobile terminal, a television, a computer, a palm computer, a personal digital assistant, etc. However, the terminal device for processing game data is the cloud game server in the cloud. When playing a game, the user operates the cloud game client to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses data such as the game screen, returns it to the cloud game client through the network, and finally, the game screen is decoded and output through the cloud game client.
[0031] Please refer to Figure 1 , Figure 1 which is a system schematic diagram of the ranking list generation device provided by an embodiment of the present application. The system may include at least one terminal 1000, at least one server 2000, at least one database 3000, and a network 4000. The terminal 1000 held by the user can be connected to the servers of different games through the network 4000. The terminal 1000 is any device with computing hardware that can support and execute software products corresponding to games. In addition, the terminal 1000 has one or more multi-touch screens for sensing and obtaining input of touch or swipe operations performed by the user at multiple points on one or more touch display screens. In addition, when the system includes multiple terminals 1000, multiple servers 2000, and multiple networks 4000, different terminals 1000 can be connected to each other through different networks 4000 and through different servers 2000. The network 4000 can be a wireless network or a wired network. For example, the wireless network can be a wireless local area network (WLAN), a local area network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc. In addition, different terminals 1000 can also use their own Bluetooth network or hotspot network to connect to other terminals or to the server, etc. For example, multiple users can be online through different terminals 1000 and thus be connected and synchronized with each other through an appropriate network to support multi-player games. In addition, the system may include multiple databases 3000. The multiple databases 3000 are coupled to different servers 2000, and information related to the game environment can be continuously stored in the database 3000 when different users are online for multi-player games.
[0032] The present application provides a method for generating a leaderboard. At the end of a game session, in order to save the data generated by the game, a first target server cluster is selected from all server clusters based on the consistent hashing algorithm as the server for data saving, and it is ensured that the server clusters to which all game users belong in a game session will send the first game data generated by the game users in this game session to the first target server cluster for uploading to the database. Then, when calculating the leaderboard, a second target server cluster is selected from all server clusters based on the consistent hashing algorithm for leaderboard calculation. Next, the second game data used for leaderboard calculation is obtained from the database, and the obtained second game data is sent to the second target server cluster for global leaderboard calculation. Finally, when the global leaderboard calculation is completed, the obtained global leaderboard is uploaded to the database to facilitate the viewing of the global leaderboard by all server clusters. It is realized that during the process of generating the leaderboard, the game data generated at the end of the game is uniformly saved to the associated database to ensure data consistency. Then, a server cluster for calculation is selected during leaderboard calculation, and the global leaderboard is uploaded to the database when the calculation is completed to facilitate the loading and viewing of the global leaderboard by all server clusters, avoiding simultaneous calculation by all server clusters and reducing redundant calculation.
[0033] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the method for generating a leaderboard provided by an embodiment of the present application. The specific process of this method can be as follows:
[0034] Step S201: At the end of a game session of the target game, control the first target server cluster to upload the first game data generated by the game users in the game session to the database.
[0035] In one embodiment, in order to ensure consistency when generating the leaderboard, it is necessary to ensure that the first game data obtained during the global leaderboard calculation is at the same time granularity or time dimension, reducing or avoiding the delay between data, so that the obtained global leaderboard is more accurate and consistent.
[0036] And in order to make the data obtained during the global leaderboard calculation consistent, it is necessary to synchronize the data generated during the battle in terms of time. Here, the concept of time slices is introduced, and the overall timestamp is divided into time slices. At the same time, a data processing cycle consists of a fixed number of time slices. Therefore, through the periodic processing of data, the consistency of the data used for leaderboard calculation can be ensured, and thus the obtained global leaderboard is more accurate.
[0037] During the game process, with the end of the game, corresponding game data will be generated, such as battle duration, battle dungeon difficulty, and the number of survivors, etc. When generating the leaderboard, ranking processing needs to be performed based on the actual game data to obtain the ranking information of different game players. In order to calculate the corresponding leaderboard information, the game data generated by the game will be recorded and stored immediately, so that accurate game data can be obtained and used during leaderboard calculation.
[0038] Specifically, at the end of a game, the first target server cluster selected and determined will upload the generated first game data to the corresponding database.
[0039] Among them, the first target server cluster is selected from all server clusters. When determining the first target server cluster, it is implemented based on the consistent hashing algorithm. Specifically, at the beginning of the game, each battle corresponds to a unique battle identifier, such as a battle ID. At this time, a server cluster for data storage is selected from all server clusters based on the mapping of the battle identifier.
[0040] In practical applications, in order to enable the game to accommodate more players, the game server can be composed of multiple server clusters, and each server cluster contains a central node and multiple game nodes. Each player corresponds to a game node, specifically as Figure 3 shown. That is, one server cluster is in charge of multiple players, and manages the game situations of the players in the same server cluster, including summarizing, recording, and uploading game data, etc. For example, it is divided according to geographical location and region to implement the processing of game data. For instance, game data from different provinces and cities are stored in different server clusters.
[0041] At the same time, for all players participating in the game, that is, nodes, they know which server cluster needs to be used to upload and store data in the database, that is, they know which server cluster is the first target server cluster. Then, at the end of a game, they can directly send the generated first game data to the first target server cluster, so that the first target server cluster can perform disk storage processing on all the received data when it can perform data storage.
[0042] It should be noted that the first target server cluster can be one of the server clusters to which the game players belong. For example, there are 5 server clusters in the entire leaderboard generation system, and the clusters to which the participating players belong are Cluster 1, Cluster 2, and Cluster 3. At this time, the first target server cluster can be any one of the 5 clusters, such as Cluster 1 or Cluster 2 or Cluster 3, or it can also be Cluster 4 or Cluster 5.
[0043] When determining the first server cluster for data disk storage, for the nodes corresponding to the players participating in the game, it is known which server cluster is used for data disk storage. Therefore, at the end of a game session, the data needs to be sent to the first target server cluster. The nodes participating in the game will determine whether the server cluster they belong to is the determined first target server cluster. If it is determined to be the determined first target server cluster, they will wait for the data transmission from other server clusters; otherwise, they will send the generated first game data to the first target server cluster.
[0044] During the game process, since the game has a multi-player co-battle mode, multi-player team battles will be carried out at this time. At the same time, for the players in the team, there are no other restrictions except for the relevant restrictions in the game, such as the character level and combat power in the game. This allows the players in the team to belong to different server clusters. Then, at the end of the game, there are data changes and updates in multiple server clusters. Therefore, at the end of the game, the server cluster to which each game user belongs needs to upload the data, uploading the first game data generated in the battle to the database for storage. That is, at the end of a game session, it includes: controlling each server cluster in the server cluster to which the game user belongs to send the first game data generated by the game user in a game session to the first target server cluster, so as to control the first target server cluster to upload the first game data to the database.
[0045] In one embodiment, the server cluster does not perform data upload at any arbitrary time. As can be seen from the foregoing description, the leaderboard calculation is updated once per period, and a period consists of several time slices. For the several time slices included in a period, corresponding interfaces can be provided to register the time slices to specify that an operation is executed on the corresponding time slice. For example, a time slice is registered for data upload, and when the time is at this time slice, the data in the server cluster is uploaded to the corresponding database for storage.
[0046] Specifically, when dividing the time slices, the designed timing control state machine is used to implement the division of the time slices. At the same time, the designed timing control state machine also provides corresponding registration interfaces to the external system for corresponding registration on the time slices. For example, when dividing the time slices and performing registration based on the timing control state machine, three time slices are divided into a period, and registration operations are performed on the three time slices based on the required operations and services to achieve the desired functions.
[0047] Since a time slice is a division of a time interval, in order to determine time more accurately, a timestamp is introduced, and the time slice is divided based on the timestamp, which can ensure the uniqueness of the time slice. Among them, the timestamp refers to the total number of seconds from 00:00:00 on January 1, 1970, Greenwich Mean Time (08:00:00 on January 1, 1970, Beijing time) to the present. For any moment now, there is a unique timestamp corresponding to it. Therefore, when dividing the time slice based on the timestamp, the uniqueness of the time slice can be determined, and further, when dividing the cycle based on the time slice, the uniqueness of the cycle can be ensured.
[0048] When constructing a time slice, different time slices within the same cycle are registered to perform different operations. In order to ensure that the registered operations can be completed within the time slice, the number of timestamps included in the time slice needs to be set, which is specifically set according to the actual situation.
[0049] Exemplarily, in order to implement a synchronization mechanism at a certain granularity, a corresponding clock deviation is added to the time-consuming of the operation, such as T ε is the clock deviation, and T c is the time-consuming for a time slice to execute the registered business logic. Then, in order to ensure that before the next time slice arrives, the business logic of all nodes in the server cluster on the current time slice is completed, the time length T ε +T c <T s .
[0050] For example, assume that the current absolute timestamp is 1000 (s) (i.e., 1970.1.1 8:16:40 Beijing time), the maximum clock deviation is 1 (s), and in the entire server, the two nodes with the largest clock deviations are L and M. The clock deviation of node L is -1 (s), and the clock deviation of node M is +1 (s). The logic execution time-consuming is 2 (s). Then the maximum clock deviation T ε =1 - (-1)=2 (s) and the execution time-consuming T c sum up to 4 (s). Then we only need to select a time slice length greater than 4 (s), such as 10 (s). Then the current time slice number is 1000 / 10 = 100, which can ensure that: in the 100th time slice, the business logic of node L can be completed actually at 1000 - (-1)+T c =1001 + 2 = 1003 (s), and the logic of node M can be completed at 1000 - 1 + 2 = 1001 (s). Therefore, before the next time slice (1010s - 1020s) arrives, the logic of the 100th time slice of all nodes can be completed, that is, the whole server consistency at the time slice granularity is achieved.
[0051] After determining the number of timestamps included in a time slice, that is, determining the corresponding length of the time slice, the construction of a cycle can be realized according to requirements. Specifically, for a cycle, the time slices included in the cycle will be registered according to actual requirements, and the designed timing control state machine will register the corresponding service logic for each time slice. When generating a leaderboard, it can be set that a cycle includes three time slices, including a disk storage time slice, a calculation time slice, and a loading time slice. Different time slices are used to execute different service logics, that is, the types of time slices are divided into the above three types.
[0052] Therefore, when saving data to the database, the current time needs to be able to perform the disk storage service, that is, the type of the time slice where the current time is located is the disk storage time slice. However, since the end time of the game is uncontrollable and is determined according to the actual combat situation, the type of the time slice where the combat is completed can be the disk storage time slice, or the calculation time slice or the loading time slice. Because of the differences in the service logics executed by different types of time slices, when the time slice where the game ends is not the disk storage time slice, data cannot be saved. Therefore, referring to Figure 4 , Figure 4 FIG. is another schematic flowchart of the leaderboard generation method provided by the embodiment of the present application. Specifically, before responding to the data disk storage instruction, steps S401 to S404 are further included.
[0053] Step S401: Control each server cluster in the server cluster to which the game user belongs to send the first game data generated by the game user in a game to the first target server cluster;
[0054] Step S402: Obtain the end time corresponding to the game end, and determine the timestamp corresponding to the end time;
[0055] Step S403: Based on the timestamp, determine the first time slice corresponding to the end time and the first cycle to which the first time slice belongs;
[0056] Step S404: When the time slice type of the first time slice is the disk storage time slice, execute the step: control the first target server cluster to upload the first game data to the database, where the time slice type includes the disk storage time slice, the calculation time slice, and the loading time slice.
[0057] In one embodiment, at the end of the game, each server cluster to which the game user belongs sends the first game data generated by the game user in the game session to the first target server cluster, so that when data is saved, the first target server cluster can complete data saving. At the same time, at the end of a game session, the end time corresponding to the game end is obtained. Due to the uniqueness of the time stamp, when the end time is obtained, the time stamp corresponding to the end time can be determined. Then, based on the obtained time stamp, the first time slice corresponding to the end time and the first cycle in which the first time slice is located are determined. Furthermore, by determining the time slice type of the first time slice, it is determined whether the data saving instruction can be responded to. Among them, when the time slice type of the first time slice is the saving time slice, data update and upload can be performed based on the game data generated at the end of the game.
[0058] Due to the randomness of the game end time, the cycle in which the game ends and the time slices within the cycle are uncertain. At the same time, since the corresponding service logics are pre-registered for the time slices, when a game session ends, further judgment needs to be made on the data saving time of the game data generated by the game end. Here, through the calculation of the time stamp, based on the length of the cycle and the length of the time slice, the type of the time slice corresponding to the game end is determined. Then, through type judgment, it is determined whether to complete data saving within the current cycle or in the next adjacent cycle.
[0059] If data saving needs to be completed in the next adjacent cycle, it is necessary to ensure that the service logic for data saving cannot be executed within the current cycle. That is, when the time slice type of the first time slice is not the saving time slice, the first target server cluster is controlled to respond to the data saving instruction in the second time slice of the second cycle adjacent to the first cycle, where the time slice type of the second time slice is the saving time slice.
[0060] Exemplarily, for the time cycle, the relationship between the cycle and the included time slices can be as Figure 5 shown. In Figure 5 , the time included in AB and BC is one cycle, and each cycle contains three time slices. Taking the cycle corresponding to the AB time period, the included time slices are: Aa, ab, and bB, and the time slice Aa is the saving time slice, ab is the calculation time slice, and bB is the loading time slice. Similarly, for the cycle corresponding to BC, Bc is the saving time slice, cd is the calculation time slice, and dC is the loading time slice.
[0061] Exemplarily, during the game process, if the end moment of a game is within the time slice Aa, data can be saved at this time, and the first target server cluster will upload the game data generated by the game node (game player) due to the game; if the end moment of a game is within the time slice ab or bB, data cannot be saved within the current cycle (AB), and can only be saved within the next adjacent cycle (BC).
[0062] In addition, due to the randomness of the end time of a game, even if the end moment of the game is within the save time slice, it will take a certain amount of time to complete the save logic, resulting in incomplete data saving even if data is saved immediately. Therefore, in this case, it is necessary to control the completion of data saving within the next adjacent cycle. Specifically, referring to Figure 6 , Figure 6 is a schematic flowchart of the steps for data saving provided by the embodiment of the present application, where the steps include step S601 to step S603.
[0063] Step S601: When the time slice type of the first time slice is a save time slice, obtain the end timestamp of the first time slice;
[0064] Step S602: Calculate the time difference based on the timestamp and the end timestamp, and compare the time difference with the save logic duration;
[0065] Step S603: If the time difference is greater than the save logic duration, execute the step: control the first target server cluster to upload the first game data to the database.
[0066] In one embodiment, since it takes a certain amount of time to complete the business logic, and at the same time to ensure the integrity of data saving, a certain execution time needs to be given to the save business logic during saving to ensure that the data can be saved completely.
[0067] Exemplarily, if the end time of the game is within the save time slice, but the remaining time of the save time cannot meet the time requirement for data saving, that is, the remaining time is less than the time required to complete the save logic, data saving can be not performed at this time, and data saving can be performed when entering the save time slice of the next adjacent cycle. For example, if the end moment of the game is within the time slice Aa, and then data saving is performed when entering the time slice Bc.
[0068] For example, it is set that the duration of each time slice is 10s, and the time required to complete the save business logic is 3s. If the end moment of the game is within the save time slice, but at the 8th second of this time slice, since the remaining 2s cannot complete data saving, the save action needs to be placed on the save time slice of the next cycle at this time.
[0069] When calculating the leaderboard, it is necessary to ensure that the game data generated by the end of the current game has been saved in the corresponding database.
[0070] Since the business logic registered on the time slice changes periodically as time progresses, for example, the transformation of the entire business logic can be: (save → calculate → load) → (save → calculate → load) →......, after the business logic of data saving is completed, the business logic of leaderboard calculation will be executed.
[0071] Step S202: Determine the second target server cluster for leaderboard calculation among all server clusters.
[0072] In one embodiment, when calculating the leaderboard, it is necessary to currently execute the leaderboard calculation service, that is, enter the calculation time slice. Specifically, when calculating the leaderboard, determine the second target server cluster for leaderboard calculation among all server clusters, and calculate the leaderboard based on the determined second target server cluster.
[0073] Exemplarily, for a team-based game dungeon, due to the different server clusters where the game nodes to which players belong are located, data updates occur in multiple server clusters. Furthermore, each server cluster will update its aggregated game data or game data, and upload it to the server through the selected and determined first target server cluster. For server clusters that do not have data updates during this period, data upload may not be required.
[0074] Since data changes occur in multiple server clusters, in order to reduce redundant calculations of the global leaderboard, based on the consistency of data saving, one server cluster can be selected as the main body for global leaderboard calculation, that is, select one server cluster for global leaderboard calculation, and for several other server clusters, this calculation is not required. They only need to obtain the global leaderboard through loading in the database after the calculation is completed.
[0075] Exemplarily, when determining the second target server cluster, the second target server cluster for calculating the global leaderboard can be selected and determined among all server clusters based on the consistent hashing algorithm. At the same time, when making a selection based on the consistent hashing algorithm, a corresponding classification cache can be designed and introduced, where the classification cache uses the consistent hashing algorithm to select the participating server clusters to determine the second target server cluster for calculation.
[0076] Meanwhile, corresponding classification caches can also be designed in each server cluster. By establishing the corresponding relationships between the server clusters, the central node, and the game nodes, when game data is generated at the game nodes, it is recorded in the corresponding server cluster through the classification cache. Then, when data is saved in the first server cluster, the generated game data is saved to the database.
[0077] In addition, when determining the second target server cluster, in addition to using the consistent hashing algorithm described above, other methods can also be used, such as selecting and determining based on the load rate of the server cluster. By selecting the server cluster with a lower load rate in the server cluster to which the game user belongs, it is used to calculate the global leaderboard.
[0078] In one embodiment, the calculation of the leaderboard is only performed when entering the calculation time slice at the current time. Due to the uncertainty of the data saving period, the period in which the leaderboard calculation is performed is also uncertain, but it can only be the current period and the adjacent next period.
[0079] Specifically, when determining the second target server cluster, it includes: if the time slice type of the first time slice is a saving time slice, then when entering the third time slice, the second target server cluster for performing the leaderboard calculation is determined among all server clusters, where the third time slice is the next time slice adjacent to the first time slice, and the time slice type of the third time slice is a calculation time slice.
[0080] Among them, the first time slice is the time slice type to which the end time of the game belongs. When saving data, due to the randomness of the game end time, if the first time slice is a saving time slice, data can be saved when the game ends. Then, when the first time slice ends as time passes, in the next connected time slice (calculation time slice), the leaderboard calculation instruction can be responded to. In fact, the leaderboard calculation instruction is automatically triggered when entering the calculation time slice, that is, it will be automatically issued as time enters this time slice to make the system respond.
[0081] Take Figure 5 as an example. If the end moment of the game is within the time slice Aa or Bc, then the leaderboard calculation instruction can be responded to when entering the time slice ab or cd.
[0082] In addition, the first time slice can be not only a saving time slice, but also a calculation time slice or a loading time slice. Therefore, it also includes: if the time slice type of the first time slice is not a saving time slice, then when entering the fourth time slice of the second cycle, the target server cluster is determined among all server clusters, where the second cycle is the next cycle adjacent to the first cycle, and the time slice type of the fourth time slice is a calculation time slice.
[0083] Taking Figure 5 as an example, if the end time of the game is within the time slice ab or bB, then the leaderboard calculation instruction will be responded to when entering the time slice Bc.
[0084] Step S203: Obtain the second game data for leaderboard calculation from the database, and send the second game data to the second target server cluster.
[0085] In one embodiment, after performing leaderboard calculation and determining the second target server cluster for global leaderboard calculation, the second game data for leaderboard calculation will be obtained from the database, and the obtained second game data will be pulled down and sent to the second target server cluster, and then the global leaderboard calculation will be completed in the second target server cluster.
[0086] Exemplarily, in the entire leaderboard system, the database is associated and connected with several server clusters, and each server cluster will upload and update to the database through a determined server cluster when there is data update, while for the server clusters without data update, data upload and update can be not performed. For example, there are 10 server clusters associated with the database, namely cluster 1, cluster 2, cluster 3, cluster 4, cluster 5, cluster 6, cluster 7, cluster 8, cluster 9, and cluster 10, and cluster 1, cluster 2, cluster 3, cluster 4, and cluster 5 have data updates within the period T + 1 and have been saved to the database, and at the same time, cluster 6, cluster 7, cluster 8, cluster 9, and cluster 10 have completed data updates within the period T. When calculating the leaderboard, not only the updated data is loaded into the second target server cluster, but also the latest data stored in the database of all server clusters is loaded into the second target server cluster.
[0087] Among them, the data saved by cluster 1, cluster 2, cluster 3, cluster 4, and cluster 5 within the period T + 1 is the latest data, and the data saved by cluster 6, cluster 7, cluster 8, cluster 9, and cluster 10 within the period T is the latest data.
[0088] Therefore, when calculating the leaderboard, in addition to obtaining the data saved within the current period, it is also necessary to obtain the data in the server clusters that have not been updated, including: determining all server clusters connected to the database, and determining the first data of each server cluster in the database; sending the first data to the target server cluster.
[0089] In one embodiment, the server clusters associated in the leaderboard system are not restricted, and a certain number of server clusters can be set according to the actual situation. During the exploration of a game dungeon, the participating players may not cover all the server clusters. Therefore, there may be some server clusters that have not performed data update and disk storage operations. However, the calculation of the global leaderboard is for all players. Therefore, it is necessary to obtain the game data of all players.
[0090] Specifically, determine all the server clusters connected to the database, and obtain the first data stored in the database by all the server clusters, that is, the second game data (the latest data), and then send the obtained first data to the second target server cluster for leaderboard calculation.
[0091] It should be noted that the first data is the latest data stored in the database by each server cluster. For example, when calculating the leaderboard in the calculation time slice of cycle T+1, the first data includes the data stored in cycle T+1 by clusters 1, 2, 3, 4, and 5, and the data stored in cycle T by clusters 6, 7, 8, 9, and 10.
[0092] Step S204: Control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0093] After sending the second game data for global leaderboard calculation to the second target server cluster, control the second target server cluster to calculate the global leaderboard based on the obtained second game data, and upload the calculated global leaderboard to the database for storage after the calculation is completed, so that other server clusters can directly load and obtain it from the database when viewing.
[0094] The calculation and upload of the global leaderboard are both carried out on the calculation time slice, and the calculated global leaderboard is directly uploaded to the database for storage when the calculation is completed. As time goes by, when entering the next time slice, that is, the loading time slice, within a cycle, each server cluster can load the stored global leaderboard from the database for viewing. Specifically, when entering the loading time slice, it includes: when it is determined that the time slice type where the current time is located is the loading time slice, obtain the global leaderboard from the database and send the global leaderboard to all server clusters, so that the user nodes included in all server clusters can view the global leaderboard.
[0095] When entering the loading time slice, the leaderboard system will load the stored global leaderboard from the database and send the loaded global leaderboard to all server clusters connected to the database, so that players in each server cluster can view the global leaderboard in a timely manner when viewing the global leaderboard.
[0096] Any combination of the above technical solutions can form an optional embodiment of this application, which will not be elaborated here one by one.
[0097] The leaderboard generation method provided by the embodiment of this application, when a game ends, in order to save the data generated by the game, based on the consistent hashing algorithm, select the first target server cluster from all server clusters as the server for data storage, and make all server clusters where game users are located in a game send the first game data generated by the game users in this game to the first target server cluster to upload to the database. Then, when calculating the leaderboard, based on the consistent hashing algorithm, select the second target server cluster from all server clusters for leaderboard calculation. Then, obtain the second game data for leaderboard calculation in the database and send the obtained second game data to the second target server cluster for global leaderboard calculation. Finally, when the global leaderboard calculation is completed, upload the obtained global leaderboard to the database to facilitate all server clusters to view the global leaderboard. It realizes that during the leaderboard generation process, the game data generated at the end of the game is uniformly saved to the associated database to ensure data consistency. Then, select a server cluster for calculation during leaderboard calculation, and upload the global leaderboard to the database when the calculation is completed to facilitate all server clusters to load and view the global leaderboard, avoiding simultaneous calculation of all server clusters and reducing redundant calculation.
[0098] To facilitate better implementation of the leaderboard generation method of the embodiment of this application, the embodiment of this application also provides a leaderboard generation device. Please refer to Figure 7 , Figure 7 It is a schematic structural diagram of the leaderboard generation device provided by the embodiment of this application. The leaderboard generation device 700 may include a data storage module 701, a calculation determination module 702, a data acquisition module 703, and a calculation storage module 704.
[0099] Among them, the data storage module 701 is used to control the first target server cluster to upload the first game data generated by game users in a game to the database when a game of the target game ends;
[0100] The calculation determination module 702 is used to determine the second target server cluster for leaderboard calculation among all target server clusters;
[0101] A data acquisition module 703, configured to acquire second game data for leaderboard calculation from a database and send the second game data to a second target server cluster;
[0102] A calculation and storage module 704, configured to control the second target server cluster to calculate a leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0103] Optionally, the leaderboard generation device 700 further includes a first determination module, configured to determine, when a game of a target game starts, a first target server cluster for data storage among all server clusters.
[0104] Optionally, the data storage module 701 may further be configured to: control each server cluster in the server cluster to which the game user belongs to send first game data generated by the game user in a game to the first target server cluster, so as to control the first target server cluster to upload the first game data to the database.
[0105] Optionally, the data storage module 701 may further be configured to: control each server cluster in the server cluster to which the game user belongs to send first game data generated by the game user in a game to the first target server cluster; obtain an end time corresponding to the end of the game, and determine a time stamp corresponding to the end time; based on the time stamp, determine a first time slice corresponding to the end time and a first cycle to which the first time slice belongs; when the time slice type of the first time slice is a storage time slice, perform the steps of: controlling the first target server cluster to upload the first game data to the database, where the time slice type includes a storage time slice, a calculation time slice, and a loading time slice.
[0106] Optionally, the data storage module 701 may further be configured to: when the time slice type of the first time slice is not a storage time slice, control the first server cluster to respond to a data storage instruction in a second time slice of a second cycle adjacent to the first cycle, where the second cycle is the next adjacent cycle of the first cycle, and the time slice type of the second time slice is a storage time slice.
[0107] Optionally, the data storage module 701 may further be configured to: when the time slice type of the first time slice is a storage time slice, obtain an end time stamp of the first time slice; calculate a time difference based on the time stamp and the end time stamp, and compare the time difference with a storage logic duration; if the time difference is greater than the storage logic duration, perform the steps of: controlling the first target server cluster to upload the first game data to the database.
[0108] Optionally, the data storage module 701 may also be used to: if the time difference is less than or equal to the storage logic duration, control the first target server cluster to execute the following steps at the second time slice: control the first target server cluster to upload the first game data to the database.
[0109] Optionally, the calculation and determination module 702 may also be used to: if the time slice type of the first time slice is a storage time slice, determine a second target server cluster for leaderboard calculation among all server clusters when entering the third time slice, where the third time slice is the next time slice adjacent to the first time slice, and the time slice type of the third time slice is a calculation time slice.
[0110] Optionally, the calculation and determination module 702 may also be used to: if the time slice type of the first time slice is not a storage time slice, determine a target server cluster among all server clusters when entering the fourth time slice of the second cycle, where the second cycle is the next cycle adjacent to the first cycle, and the time slice type of the fourth time slice is a calculation time slice.
[0111] Optionally, the leaderboard generation device 700 further includes a leaderboard loading module, which is used to: when it is determined that the time slice type in which the current time is located is a loading time slice, obtain the global leaderboard from the database and send the global leaderboard to all server clusters, so that the user nodes included in all server clusters can view the global leaderboard.
[0112] Any combination of the above technical solutions can form an optional embodiment of the present application, which will not be elaborated herein one by one.
[0113] The ranking list generation device 700 provided by the embodiment of the present application, at the end of a game, in order to perform disk storage processing on the data generated by the game, selects a first target server cluster as the server for data disk storage from all server clusters based on the consistent hashing algorithm, and enables the server clusters to which all game users belong in a game to send the first game data generated by the game users in this game to the first target server cluster for uploading to the database. Then, when calculating the ranking list, a second target server cluster is selected from all server clusters based on the consistent hashing algorithm for calculating the ranking list. Next, the second game data used for calculating the ranking list is obtained from the database, and the obtained second game data is sent to the second target server cluster for calculating the global ranking list. Finally, when the calculation of the global ranking list is completed, the obtained global ranking list is uploaded to the database to facilitate the viewing of the global ranking list by all server clusters. It realizes that during the generation of the ranking list, the game data generated at the end of the game is uniformly stored in the associated database to ensure data consistency. Then, a server cluster for calculation is selected during the ranking list calculation, and the global ranking list is uploaded to the database when the calculation is completed to facilitate the loading and viewing of the global ranking list by all server clusters, avoiding simultaneous calculations by all server clusters and reducing redundant calculations.
[0114] Correspondingly, the embodiment of the present application further provides a computer device, which can be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), and other terminal devices. As Figure 8 shown, Figure 8 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 800 includes a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, and a computer program stored on the memory 802 and executable on the processor. Among them, the processor 801 is electrically connected to the memory 802. Those skilled in the art can understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and it may include more or fewer components than shown, or combine some components, or have different component arrangements.
[0115] The processor 801 is the control center of the computer device 800, connecting various parts of the entire computer device 800 through various interfaces and circuits. By running or loading software programs and / or modules stored in the memory 802, and invoking the data stored in the memory 802, it executes various functions of the computer device 800 and processes data, thereby monitoring the computer device 800 as a whole.
[0116] In the embodiment of the present application, the processor 801 in the computer device 800 will load the instructions corresponding to the processes of one or more application programs into the memory 802 according to the following steps, and the processor 801 will run the application programs stored in the memory 802 to implement various functions:
[0117] When a game of the target game ends, control the first target server cluster to upload the first game data generated by the game user in a game to the database; determine the second target server cluster for leaderboard calculation among all target server clusters; obtain the second game data for leaderboard calculation from the database, and send the second game data to the second target server cluster; control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0118] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, and details will not be repeated here.
[0119] Optionally, as Figure 8 shown, the computer device 800 further includes: a touch display screen 803, a radio frequency circuit 804, an audio circuit 805, an input unit 806, and a power supply 807. Among them, the processor 801 is electrically connected to the touch display screen 803, the radio frequency circuit 804, the audio circuit 805, the input unit 806, and the power supply 807 respectively. Those skilled in the art can understand that Figure 8 the computer device structure shown in
[0120] The touch display screen 803 can be used to display a graphical user interface and receive operation instructions generated by a user's interaction with the graphical user interface. The touch display screen 803 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using any suitable object or accessory such as a finger or a stylus on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 801, and can receive and execute the commands sent by the processor 801. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits it to the processor 801 to determine the type of touch event. Subsequently, the processor 801 provides corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 803 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 803 can also be used as a part of the input unit 806 to implement the input function.
[0121] In the embodiments of the present application, the processor 801 executes a game application to generate a graphical user interface on the touch display screen 803. The virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 803 is used to present the graphical user interface and receive operation instructions generated by a user's interaction with the graphical user interface.
[0122] The radio frequency circuit 804 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.
[0123] The audio circuit 805 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 805 can convert the received audio data into an electrical signal and transmit it to the speaker, which converts it into a sound signal for output. On the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 805, converted into audio data, and then the audio data is output to the processor 801 for processing. After that, it is sent through the radio frequency circuit 804 to, for example, another computer device, or the audio data is output to the memory 802 for further processing. The audio circuit 805 may also include an earphone jack to provide communication between a peripheral earphone and the computer device.
[0124] The input unit 806 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0125] The power supply 807 is used to supply power to each component of the computer device 800. Optionally, the power supply 807 can be logically connected to the processor 801 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 807 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0126] Although Figure 8 not shown in the figure, the computer device 800 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0127] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] As can be seen from the above, for the computer device provided in this embodiment, at the end of a game, in order to save the data generated by the game, the first target server cluster is selected from all server clusters based on the consistent hashing algorithm as the server for data saving, and the server clusters to which all game users belong in a game will send the first game data generated by the game users in this game to the first target server cluster, and upload it to the database. Then, when calculating the leaderboard, the second target server cluster is selected from all server clusters based on the consistent hashing algorithm for leaderboard calculation. Next, the second game data for leaderboard calculation is obtained from the database, and the obtained second game data is sent to the second target server cluster for global leaderboard calculation. Finally, when the global leaderboard calculation is completed, the obtained global leaderboard is uploaded to the database so that all server clusters can view the global leaderboard. It realizes that during the generation of the leaderboard, the game data generated at the end of the game is uniformly saved to the associated database to ensure data consistency. Then, a server cluster for calculation is selected during leaderboard calculation, and the global leaderboard is uploaded to the database when the calculation is completed, so that all server clusters can load and view the global leaderboard, avoiding simultaneous calculation by all server clusters and reducing redundant calculation.
[0129] Those of ordinary skill in the art can understand that all or part of the steps in the above various methods can be completed by instructions, or by instructions controlling related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0130] Therefore, an embodiment of the present application provides a computer-readable storage medium, which stores multiple computer programs that can be loaded by a processor to execute the steps in any leaderboard generation method provided by the embodiment of the present application. For example, the computer program can execute the following steps:
[0131] At the end of a game of the target game, control the first target server cluster to upload the first game data generated by the game users in a game to the database; determine the second target server cluster for leaderboard calculation among all target server clusters; obtain the second game data for leaderboard calculation from the database, and send the second game data to the second target server cluster; control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
[0132] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.
[0133] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0134] Since the computer program stored in the storage medium can execute the steps in any of the ranking list generation methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the ranking list generation methods provided in the embodiments of the present application can be realized. For details, see the previous embodiments and will not be elaborated here.
[0135] The above has introduced in detail a ranking list generation method, device, storage medium and computer device provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for generating a leaderboard, characterized in that Including: At the end of a game of the target game, control the first target server cluster to upload the first game data generated by the game user in the game to the database, including: controlling each server cluster in the server cluster to which the game user belongs to send the first game data generated by the game user in the game to the first target server cluster; obtaining the end time corresponding to the end of the game, and determining the time stamp corresponding to the end time; based on the time stamp, determining the first time slice corresponding to the end time and the first cycle to which the first time slice belongs; when the time slice type of the first time slice is a save time slice, execute the steps: controlling the first target server cluster to upload the first game data to the database, where the time slice type includes a save time slice, a calculation time slice, and a load time slice; When the time slice type of the first time slice is not a save time slice, control the first target server cluster to respond to the data save instruction in the second time slice of the second cycle adjacent to the first cycle, where the second cycle is the next adjacent cycle of the first cycle, and the time slice type of the second time slice is a save time slice; Determine a second target server cluster for leaderboard calculation among all target server clusters, including: if the time slice type of the first time slice is a save time slice, determine a second target server cluster for leaderboard calculation among all server clusters when entering the third time slice, where the third time slice is the next time slice adjacent to the first time slice, and the time slice type of the third time slice is a calculation time slice; when performing leaderboard calculation, determine a second target server cluster for leaderboard calculation among all server clusters to perform leaderboard calculation based on the determined second target server cluster; Obtain second game data for leaderboard calculation from the database, and send the second game data to the second target server cluster; Control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
2. The method according to claim 1, wherein The method further includes: At the start of a game of the target game, determine a first target server cluster for data saving among all server clusters.
3. The method according to claim 1, characterized in that, When the time slice type of the first time slice is a save time slice, execute the steps: controlling the first target server cluster to upload the first game data to the database, including: When the time slice type of the first time slice is a save time slice, obtain the end time stamp of the first time slice; Calculate the time difference based on the time stamp and the end time stamp, and compare the time difference with the save logic duration; If the time difference is greater than the save logic duration, execute the steps: controlling the first target server cluster to upload the first game data to the database.
4. The method according to claim 3, wherein After comparing the time difference with the disk saving logic duration, the following steps are further included: If the time difference is less than or equal to the disk saving logic duration, control the first target server cluster to execute the following steps at the second time slice: control the first target server cluster to upload the first game data to the database.
5. The method according to claim 1, wherein Determining the second target server cluster for leaderboard calculation among all target server clusters further includes: If the time slice type of the first time slice is not a disk saving time slice, determine the target server cluster among all server clusters at the fourth time slice when entering the second cycle, where the second cycle is the next cycle adjacent to the first cycle, and the time slice type of the fourth time slice is a calculation time slice.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: When it is determined that the time slice type at the current time is a loading time slice, obtain the global leaderboard from the database and send the global leaderboard to all server clusters, so that user nodes included in all server clusters can view the global leaderboard.
7. A leaderboard generation device, characterized in that, It includes: A data disk saving module, which is used to control the first target server cluster to upload the first game data generated by a game user in a game of a target game to the database when the game ends, including: controlling each server cluster in the server cluster where the game user belongs to send the first game data generated by the game user in the game to the first target server cluster; obtaining the end time corresponding to the game end and determining the time stamp corresponding to the end time; based on the time stamp, determining the first time slice corresponding to the end time and the first cycle to which the first time slice belongs; when the time slice type of the first time slice is a disk saving time slice, execute the following steps: control the first target server cluster to upload the first game data to the database, where the time slice type includes a disk saving time slice, a calculation time slice, and a loading time slice; when the time slice type of the first time slice is not a disk saving time slice, control the first target server cluster to respond to the data disk saving instruction at the second time slice of the second cycle adjacent to the first cycle, where the second cycle is the next cycle adjacent to the first cycle, and the time slice type of the second time slice is a disk saving time slice; A calculation and determination module, which is used to determine the second target server cluster for leaderboard calculation among all target server clusters, including: if the time slice type of the first time slice is a disk saving time slice, determine the second target server cluster for leaderboard calculation among all server clusters at the third time slice, where the third time slice is the next time slice adjacent to the first time slice, and the time slice type of the third time slice is a calculation time slice; when performing leaderboard calculation, determine the second target server cluster for leaderboard calculation among all server clusters to perform leaderboard calculation based on the determined second target server cluster; A data acquisition module, configured to acquire second game data for leaderboard calculation from the database and send the second game data to the second target server cluster; A calculation and storage module, configured to control the second target server cluster to calculate the leaderboard based on the second game data, and upload the obtained global leaderboard to the database when the calculation is completed, so that all server clusters can obtain the global leaderboard from the database.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the leaderboard generation method according to any one of claims 1-6.
9. A computer device, characterized in that, The computer device includes a memory and a processor. A computer program is stored in the memory, and the processor executes the steps in the leaderboard generation method according to any one of claims 1-6 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Multi-core processing system and method, and mobile terminal
CN105446798A
Data management system, method and device
CN113440861A