Ranking data processing method and device, electronic equipment and storage medium
By caching leaderboard data on the application server and utilizing real-time ranking updates, the leaderboard data acquisition process is simplified, response speed and accuracy are improved, the high complexity problem in existing technologies is solved, and good scalability and cost-effectiveness are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN TENCENT COMP SYST CO LTD
- Filing Date
- 2022-03-03
- Publication Date
- 2026-07-31
AI Technical Summary
The current technology for requesting leaderboard data is complex and inefficient, and cannot meet the needs of practical applications.
The system caches initial leaderboard data in the application server's storage space, retrieves the real-time ranking of the target object from the leaderboard server, updates the initial data based on the real-time ranking, and directly sends the target leaderboard data to the terminal device.
It simplifies the data acquisition process for leaderboards, improves response speed and data accuracy, reduces development costs, and has good scalability and adaptability.
Smart Images

Figure CN116726509B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical fields of games, cloud technology, big data, etc. Specifically, this application relates to a ranking data processing method, device, electronic device, and storage medium. Background Technology
[0002] Leaderboards refer to the collection of data on some objects and their sorting in ascending or descending order. This is a common requirement in many businesses, such as games and ToC (business-facing) products that are directly provided to users.
[0003] In existing technologies, when an object (such as a user) requests leaderboard data, it typically retrieves ranking data from the leaderboard system, then retrieves user data from the business side, combines the data, and finally returns it to the client. For example, in a game scenario, each time a player requests leaderboard data, there are three peripheral requests: two to the Rank System (the system that stores player ranking data) (for server-wide ranking data and the user's corresponding player ranking information) and one to the Database (for retrieving basic data information of players within the leaderboard, such as costumes). Furthermore, the order of sending and receiving messages needs to be set. It is evident that the process of requesting leaderboard data in existing technologies is complex, inefficient, and cannot adequately meet the needs of practical applications. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for processing leaderboard data, enabling simple and quick acquisition of leaderboard data. The technical solution provided by this application is as follows:
[0005] According to one aspect of the embodiments of this application, a ranking data processing method is provided, the method comprising:
[0006] Receive a leaderboard retrieval request sent by a terminal device. The leaderboard retrieval request includes the target object identifier corresponding to the terminal device.
[0007] Retrieve the real-time ranking corresponding to the target object identifier from the leaderboard server, and retrieve the cached initial leaderboard data from the first storage space of the application server;
[0008] The initial leaderboard data is updated based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier;
[0009] The target leaderboard data is sent to the terminal device so that the target leaderboard data can be displayed on the terminal device.
[0010] According to another aspect of the embodiments of this application, a ranking data processing apparatus is provided, the apparatus comprising:
[0011] The request receiving module is used to receive the leaderboard retrieval request sent by the terminal device. The leaderboard retrieval request includes the target object identifier corresponding to the terminal device.
[0012] The data acquisition module is used to obtain the real-time ranking corresponding to the target object identifier from the ranking server, and to obtain the cached initial ranking data from the first storage space of the application server;
[0013] The data update module is used to update the initial leaderboard data based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier;
[0014] The data sending module is used to send the target leaderboard data to the terminal device so that the target leaderboard data can be displayed on the terminal device.
[0015] Optionally, the leaderboard retrieval request may also include a first leaderboard type identifier; when the data retrieval module retrieves the real-time ranking corresponding to the target object identifier from the leaderboard server, and the initial leaderboard data cached in the first storage space of the application server, it may be used for:
[0016] Obtain the real-time ranking of the target object identifier corresponding to the first ranking type identifier from the ranking server, and the initial ranking data corresponding to the first ranking type identifier cached in the first storage space of the application server;
[0017] Among them, the target ranking data is the target ranking data whose target object identifier corresponds to the first ranking type identifier.
[0018] Optionally, when the data update module updates the initial leaderboard data based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier, it is specifically used for:
[0019] If the real-time ranking overlaps with any ranking in the initial leaderboard data, copy the initial leaderboard data to the second storage space;
[0020] The initial leaderboard data in the second storage space is rearranged based on the real-time ranking to obtain the target leaderboard data;
[0021] If the real-time rankings do not overlap with any of the rankings in the initial leaderboard data, the data sending module is also used for:
[0022] The initial leaderboard data is sent to the terminal device as the target leaderboard data.
[0023] Optionally, the first storage space is the shared memory space of the application server or the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device; the second storage space is the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device.
[0024] Optionally, the device also includes a deletion module, which is used for:
[0025] After sending the target leaderboard data to the terminal device, the target leaderboard data is deleted from the second storage space.
[0026] Optionally, when the data update module updates the initial leaderboard data based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier, it is specifically used for:
[0027] Retrieve the basic attribute information of the object corresponding to the object identifier;
[0028] Based on the object's basic attribute information and real-time ranking, the current ranking data corresponding to the target object identifier is obtained;
[0029] The initial leaderboard data is updated based on the current ranking data to obtain the target leaderboard data.
[0030] Optionally, when obtaining the basic attribute information of the object corresponding to the target object identifier, the data update module can be used for:
[0031] Based on the aforementioned target object identifier, retrieve the basic attribute information of the object corresponding to the target object identifier from the object database.
[0032] Optionally, the data update module can be used to obtain the basic attribute information of the object corresponding to the target object identifier for:
[0033] If the initial ranking data includes the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data.
[0034] If the initial ranking data does not include the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
[0035] Optionally, the data update module can be used to obtain the basic attribute information of the object corresponding to the target object identifier for:
[0036] If the time interval between the above-mentioned ranking request and the previous ranking request of the terminal device is greater than or equal to a set threshold, the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier;
[0037] If the time interval between the above-mentioned ranking request and the previous ranking request of the terminal device is less than a set threshold, the initial ranking data includes the ranking data corresponding to the target object identifier, and the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data; if the initial ranking data does not include the ranking data corresponding to the target object identifier, the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
[0038] Optionally, the first storage space stores initial ranking data corresponding to at least one second ranking type identifier, wherein the at least one second ranking type identifier includes the first ranking type identifier;
[0039] For any second leaderboard type identifier, the device also includes a leaderboard update module for:
[0040] According to the ranking data update strategy corresponding to the second ranking type identifier, obtain the ranking information of each object identifier in the ranking corresponding to the second ranking type identifier from the ranking server;
[0041] Based on the ranking information of each object identifier obtained from the leaderboard server, the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space is updated.
[0042] Optionally, when the leaderboard update module updates the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space based on the ranking information of each object identifier obtained from the leaderboard server, it is specifically used for:
[0043] Retrieve basic attribute information of objects whose identifiers, obtained from the leaderboard server, correspond to the second leaderboard type identifier from the object database;
[0044] Based on the ranking information of each object identifier obtained from the ranking server and the corresponding basic attribute information of the object obtained from the object database, new ranking data corresponding to the second ranking type identifier is obtained.
[0045] The initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated using the new ranking data.
[0046] According to another aspect of the embodiments of this application, an electronic device is provided, the electronic device including a memory, a processor and a computer program stored in the memory, the processor executing the computer program to implement any step in the leaderboard data processing method.
[0047] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program, when executed by a processor, implements the steps in the leaderboard data processing method.
[0048] According to one aspect of the embodiments of this application, a computer program product is provided that, when executed by a processor, implements the steps in the leaderboard data processing method.
[0049] The beneficial effects of the technical solutions provided in this application are:
[0050] The ranking data processing method provided in this application embodiment can cache initial ranking data in the first storage space of the application server. When a ranking request is received from a terminal device, the real-time ranking corresponding to the target object (i.e., the target object identifier) can be obtained from the ranking server. Based on the real-time ranking, the initial ranking data cached in the first storage space is updated, and the target ranking data is returned to the terminal device. In this process, only the real-time ranking corresponding to the target object needs to be obtained from the ranking server, without needing to obtain the ranking data of the entire ranking. The solution is simpler, more convenient and faster to implement. Furthermore, since the ranking corresponding to the target object in the obtained target ranking data is the real-time ranking obtained from the ranking server, the accuracy of the ranking data of the target object in the obtained ranking data can be guaranteed. Compared with the existing solution, it can effectively speed up the response to the request and improve the user experience.
[0051] Furthermore, the method provided in this application embodiment can be applied to various business scenarios with ranking requirements, has good scalability, and can be implemented by migrating business code for different business scenarios, without having to repeatedly develop business code, reducing development costs and better meeting the needs of actual applications. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0053] Figure 1 This application provides a schematic diagram of the architecture of a ranking data processing system.
[0054] Figure 2 A schematic diagram illustrating a data interaction provided in an embodiment of this application;
[0055] Figure 3 A schematic diagram of an application interface provided in an embodiment of this application;
[0056] Figure 4a A schematic diagram of another application interface provided in an embodiment of this application;
[0057] Figure 4b A schematic diagram of an application interface for displaying leaderboard data provided in an embodiment of this application;
[0058] Figure 5 A flowchart illustrating a ranking data processing method provided in an embodiment of this application;
[0059] Figure 6 This application provides a schematic diagram of a process for obtaining leaderboard data in an embodiment of the present application.
[0060] Figure 7 A schematic diagram of a ranking data provided in an embodiment of this application;
[0061] Figure 8 This application provides a schematic diagram of a process for updating leaderboard data.
[0062] Figure 9 A schematic diagram of a ranking data processing device provided in an embodiment of this application;
[0063] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0064] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0065] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates that at least one of the items defined by the term, for example, “A and / or B” or “at least one of A or B” can be implemented as “A,” or implemented as “B,” or implemented as “A and B.”
[0066] This application proposes a novel ranking data processing method to address the problem that the process of requesting ranking data in the prior art is relatively complex.
[0067] Optionally, the data processing in the ranking data processing method provided in this application embodiment can be implemented based on cloud technology. For example, the storage of the ranking data and user basic attribute information can be implemented based on cloud storage, and the data update, data deletion and other operations can be implemented using cloud computing.
[0068] Among them, cloud storage is a new concept that has been extended and developed from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology and distributed storage file systems to bring together a large number of storage devices of various types in the network (storage devices are also called storage nodes) to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0069] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, the resources in the "cloud" are infinitely scalable, readily available, on-demand, and expandable, with payment based on usage.
[0070] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0071] First, let's introduce and explain several terms used in this application:
[0072] Client: Client terminal, user terminal.
[0073] Connection layer: This layer is primarily responsible for managing long-lived connections between the client and the server. In this embodiment, the connection layer can be between the Client and the GameSvr Cluster, used for game-related server logic interactions.
[0074] GameSvr Cluster: The main logical service cluster of servers in a game application scenario, which may include at least one game server GameSvr (that is, the application server in this application scenario).
[0075] Rank System: Corresponding to the leaderboard server in this application embodiment, it is a system responsible for sorting player data. GameSvr can obtain leaderboard data from this system, such as ranking information of various types of leaderboards.
[0076] Data Base: Data storage component, which can be abbreviated as DB, corresponds to the user database in the embodiments of this application. In the game application scenario, DB can be used to store player data of each player in the game application, such as the player's basic attribute information.
[0077] It should be noted that, in the optional embodiments of this application, the object information (such as basic object attribute information) and related data involved require the object's permission or consent when applied to specific products or technologies. Furthermore, the collection, use, and processing of this data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. In other words, if the embodiments of this application involve object-related data, this data must be obtained with the object's authorization and consent, and in accordance with the relevant laws, regulations, and standards of the country and region.
[0078] In this application, the terminal device (also referred to as a user terminal or user equipment) can be a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device (e.g., smart speaker), wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR / VR device, etc., but is not limited thereto. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, which is not limited herein.
[0079] The method provided in this application can be applied to scenarios involving processing leaderboard data in games, including but not limited to scenarios involving leaderboard data in games. To better understand and illustrate the solution provided in this application, an optional implementation of this application will be described below using a game scenario as an example. It is understood that in this example, the user participating in the game application (also referred to as the player) is the target object, and the player's player data is the object's basic attribute information. For ease of description, the target object will be simply referred to as the user, and the object identifier will be simply referred to as the user identifier.
[0080] In game applications, users can participate in games through the client of the game application running on their terminal devices. The application type and game category of the game application are not limited in this application embodiment. It can be a game application that needs to be downloaded and installed, a cloud gaming application, or a game application in a mini program. The game category can include, but is not limited to, action, adventure, simulation, role-playing, casual, and other types of games.
[0081] Based on the method provided in this application embodiment, when a user needs to view game leaderboard data while playing a game, the game server (the application server in this scenario) can quickly provide the player with target leaderboard data containing the user's real-time ranking.
[0082] Figure 1 This is a schematic diagram of the architecture of a ranking data processing system applicable to the embodiments of this application, as shown below. Figure 1 As shown, the processing system may include a terminal device 10 running a game client corresponding to the game, an application server cluster 20 (including at least one game server, in this example, game server 1 and game server 2 are used as examples), a leaderboard server 30, and a user database (i.e., an object database) 40. The terminal device 10 can be the user terminal of any game player. Optionally, such as Figure 2 As shown, terminal device 10 can send a ranking request to the game server in application server cluster 20 through the connection layer. The game server in application server cluster 20 obtains ranking data from leaderboard server 30 and player data from user database 40 through the network. Then, based on the obtained ranking data and player data, it updates the cached initial leaderboard data to obtain the target leaderboard data and returns it to terminal device 10.
[0083] Optionally, when the game client is running on the terminal device 10, it can be configured to... Figure 3 The application interface shown is presented to the user. This application interface can be any interface in the game, such as the start page when the user first opens the game application, or any interface during the game. This embodiment of the application does not limit this. The application interface includes a trigger button "Start" for triggering the start of the game (it can be understood that when the application interface is any interface in the game, "Start" is used to trigger the end of the current game and the start of a new game), and a trigger button "Leaderboard" for triggering the leaderboard access request.
[0084] Furthermore, when users want to access leaderboard data, they can click the "Leaderboard" button, at which point they can view data such as... Figure 4aThe application interface shown is presented to the user. This interface includes trigger buttons for retrieving various types of leaderboard data. The specific format of these buttons can be preset, and this embodiment is not limited. For example, they can display the names of various leaderboards; the figure shows "Battle Power Ranking," "Level Ranking," and "Arena Ranking" as trigger buttons. Correspondingly, when a user wants to retrieve a certain type of leaderboard data, clicking the corresponding trigger button is considered triggering a leaderboard retrieval request. This request includes the user's identifier and the leaderboard type identifier corresponding to the clicked trigger button. For example, when a user wants to retrieve the Battle Power Ranking data, they can click... Figure 4a The "battle power ranking" in the system is considered to have triggered a ranking retrieval request, which includes the user's identifier and the ranking power ranking identifier.
[0085] Correspondingly, terminal device 10 can send the leaderboard retrieval request to the corresponding game server (game server 2 is used as an example in this example). Game server 2 retrieves the real-time ranking of the user identifier corresponding to the combat power leaderboard from leaderboard server 30, and retrieves the player data corresponding to the user identifier from user database 40 (player nickname, combat power value, and costumes are used as examples in this example). Then, based on the player data and real-time ranking, it obtains the current ranking data of the user identifier in the combat power leaderboard, and updates the initial leaderboard data corresponding to the combat power leaderboard retrieved from the first storage space according to the current ranking data, resulting in the following: Figure 4b The system displays the leaderboard data and returns the target leaderboard data to the terminal device 10, which then displays the leaderboard data to the user.
[0086] Optionally, in practical applications, the default leaderboard data can also be configured, such as using the power ranking data as the default leaderboard data. In this case, when the user clicks... Figure 3 When the "Leaderboard" button is pressed, the terminal device 10 can send a leaderboard retrieval request to the corresponding game server 2. This request includes the user's identifier and the identifier of the default power ranking. Upon receiving the request, the game server 2 retrieves the real-time ranking of the power ranking corresponding to the user identifier, and the player data corresponding to the user identifier from the user database 40. Then, based on the player data and the real-time ranking, it updates the initial leaderboard data corresponding to the power ranking retrieved from the first storage space, resulting in the following: Figure 4b The leaderboard data shown may include the ranking information of each user and the player data of each user. For example, the first player's nickname is Jian Dan, the combat power is 98, and the costume is A. The second player's nickname is Yuan Qi, the combat power is 90, and the costume is B. The third player's nickname is Man Man, the combat power is 88, and the costume is C.
[0087] It's understandable that the default leaderboard data displayed at this point might not be the leaderboard data the user wants. Therefore, while displaying the default leaderboard data, a trigger button for retrieving other types of leaderboard data can be simultaneously displayed. Clicking the corresponding trigger button will be considered as triggering a request to retrieve that type of leaderboard data. For example, ... Figure 4b As shown, trigger buttons "Level Ranking" and "Arena Ranking" can be displayed simultaneously on the interface that displays the ranking data of the combat power ranking. When a user wants to obtain ranking data of either "Level Ranking" or "Arena Ranking", clicking the corresponding trigger button will be considered as triggering a request to obtain the ranking data of that type.
[0088] Optionally, each game server's first storage space stores at least one initial leaderboard data corresponding to a leaderboard type identifier. Assuming that for any leaderboard type identifier in the first storage space of game server 2, the leaderboard data corresponding to the second leaderboard type identifier can be obtained from leaderboard server 30 according to the leaderboard data update strategy corresponding to the leaderboard type identifier, and the player data corresponding to each user identifier corresponding to the leaderboard type identifier can be obtained from user database 40. Based on the obtained leaderboard data and the player data corresponding to each user identifier, the initial leaderboard data corresponding to the leaderboard type identifier in the first storage space is updated.
[0089] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0090] like Figure 5 As shown in the embodiments of this application, a leaderboard data processing method is provided. This method is executed by an application server. When applied in the above-mentioned game scenario, the application server can be a game server. The method may include:
[0091] Step S201: Receive a leaderboard retrieval request sent by the terminal device. The leaderboard retrieval request includes the target object identifier corresponding to the terminal device.
[0092] In this application embodiment, the target object may refer to a user, a player in a game, etc. For ease of description, the target object involved in this application embodiment will be referred to as a user, the target object identifier as a user identifier, and the object's basic attribute information as user basic attribute information.
[0093] Optionally, when a user wants to obtain leaderboard data, they can trigger a leaderboard retrieval request. After receiving the trigger request, the terminal device can send a leaderboard retrieval request to the application server. The leaderboard retrieval request includes the user identifier corresponding to the terminal device, so as to inform the application server which user on the terminal device wants to obtain the leaderboard data.
[0094] In this embodiment, the leaderboard data can be any type of leaderboard data in any industry, such as leaderboard data in games or leaderboard data in sports competitions, etc., and this embodiment is not limited. However, when the leaderboard data is from different industries, the corresponding user has different meanings. For example, when it is leaderboard data in a game, the user is a player in the game; when it is leaderboard data in a sports competition, the user is an athlete.
[0095] Step S202: Obtain the real-time ranking corresponding to the target object identifier from the ranking server, and obtain the cached initial ranking data from the first storage space of the application server.
[0096] Step S203: Update the initial ranking data according to the real-time ranking to obtain the target ranking data corresponding to the target object identifier.
[0097] The ranking server contains real-time rankings for each user in the leaderboard. The application server's first storage space caches the initial leaderboard data. To ensure more accurate rankings for user identifiers in the leaderboard data returned to the terminal device, the application server can retrieve the real-time ranking corresponding to a user identifier from the leaderboard server and then update the initial leaderboard data based on the real-time ranking to obtain the target leaderboard data for that user identifier. Specifically, when updating the initial leaderboard data based on the real-time ranking, the ranking data corresponding to the user identifier can be updated according to the real-time ranking, and then the sorting of the initial leaderboard data can be adjusted based on the real-time ranking to obtain the target leaderboard data.
[0098] Optionally, when obtaining the real-time ranking corresponding to the user identifier from the leaderboard server, it can be determined whether the data return packet is normal (such as whether the network connection is normal, whether the format of the real-time ranking is returned normally, etc.). After confirming that the data return packet is normal, the initial leaderboard data can be updated according to the real-time ranking, thereby effectively avoiding the problem of increased data processing volume caused by abnormal data return packets leading to data acquisition failure.
[0099] Step S204: Send the target ranking data to the terminal device so that the target ranking data can be displayed on the terminal device.
[0100] Optionally, when the target leaderboard data corresponding to the user identifier is obtained, the application server sends the target leaderboard data to the terminal device, and the terminal device displays the target leaderboard data to the user. The specific method by which the terminal device displays the target leaderboard data to the user can be pre-configured. This embodiment of the application limits the display to, for example, by using a document or an image to display the target leaderboard data to the user.
[0101] The ranking data processing method provided in this application embodiment allows the application server to cache initial ranking data in its first storage space. When a ranking request is received from a terminal device, the real-time ranking corresponding to the target object can be obtained from the ranking server. Based on this real-time ranking, the initial ranking data cached in the first storage space is updated, and the target ranking data is returned to the terminal device. In this process, only the real-time ranking corresponding to the target object needs to be obtained from the ranking server; there is no need to obtain the ranking data of the entire ranking list from the ranking server. This is simpler, more convenient, and faster. Furthermore, since the ranking of the target object in the obtained target ranking data is the real-time ranking obtained from the ranking server, the accuracy of the target object's ranking data in the obtained ranking data can be guaranteed. In addition, the method provided in this application embodiment can be applied to various business scenarios with ranking requirements, has good scalability, eliminates the need for repeated development of business code, reduces development costs, and better meets practical application needs.
[0102] This application embodiment provides a possible implementation method, in which the leaderboard acquisition request also includes a first leaderboard type identifier;
[0103] Retrieve the real-time ranking corresponding to the target object identifier from the leaderboard server, and retrieve the cached initial leaderboard data from the application server's first storage space, including:
[0104] The system retrieves the real-time ranking of the target object corresponding to the first ranking type identifier from the ranking server, and retrieves the cached initial ranking data corresponding to the first ranking type identifier from the first storage space of the application server.
[0105] Among them, the target ranking data is the target ranking data whose target object identifier corresponds to the first ranking type identifier.
[0106] Optionally, multiple types of leaderboards may exist in the same scenario, and the specific classification method of leaderboard types can be pre-configured according to actual needs. This application embodiment does not limit this. For example, in a game scenario, leaderboards can be divided into national leaderboards, provincial leaderboards, and city leaderboards according to region, or into power leaderboards, competition leaderboards, and level leaderboards according to format type. Accordingly, when multiple types of leaderboards exist, the first storage space of the application server can cache the initial leaderboard data corresponding to multiple leaderboard type identifiers, and the leaderboard retrieval request sent by the terminal device also includes the leaderboard type identifier to be retrieved (i.e., the first leaderboard type identifier). Accordingly, the application server can obtain the real-time ranking of the user identifier corresponding to the first leaderboard type identifier from the leaderboard server, and then update the initial leaderboard data corresponding to the first leaderboard type identifier cached in the first storage space according to the obtained real-time ranking of the user identifier corresponding to the first leaderboard type identifier, to obtain the target leaderboard data of the user identifier corresponding to the first leaderboard type identifier.
[0107] This application provides a possible implementation method in which the initial leaderboard data is updated based on the real-time ranking to obtain the target leaderboard data corresponding to the target object identifier, including:
[0108] If the real-time ranking overlaps with any ranking in the initial leaderboard data, copy the initial leaderboard data to the second storage space;
[0109] The initial leaderboard data in the second storage space is rearranged based on the real-time ranking to obtain the target leaderboard data;
[0110] If the real-time rankings do not overlap with any of the rankings in the initial leaderboard data, the method also includes:
[0111] The initial leaderboard data is sent to the terminal device as the target leaderboard data.
[0112] Optionally, when the application server obtains the real-time ranking for a user, it can compare this real-time ranking with each ranking in the initial leaderboard data (e.g., comparing the score corresponding to the real-time ranking with the score corresponding to each ranking in the initial leaderboard data). If the real-time ranking matches any ranking in the initial leaderboard data, the user should be in the leaderboard. In this case, the initial leaderboard data can be copied to a second storage space, and then the initial leaderboard data in the second storage space can be rearranged according to the real-time ranking to obtain the target leaderboard data. For example, the scores corresponding to each ranking in the initial leaderboard data in the second storage space can be rearranged according to the score corresponding to the real-time ranking to obtain the target leaderboard data. Conversely, if the real-time ranking does not match any ranking in the initial leaderboard data, the user cannot be in the leaderboard. In this case, the cached initial leaderboard data can be sent to the terminal device as the target leaderboard data.
[0113] This application embodiment provides a possible implementation method, which, after sending the target ranking data to the terminal device, further includes:
[0114] Remove the target leaderboard data from the second storage space.
[0115] Optionally, after the target leaderboard data included in the second storage space is sent to the terminal device, the target leaderboard data in the second storage space can be deleted, thereby freeing up storage space and reducing data storage volume.
[0116] This application provides a possible implementation method in which the first storage space is the shared memory space of the application server or the dedicated memory space corresponding to the service process that provides services to the terminal device in the application server;
[0117] The second storage space is the dedicated memory space corresponding to the service processes in the application server that provide services to terminal devices.
[0118] In this context, shared memory refers to a large amount of memory in a multiprocessor computer system that can be accessed by different CPUs (central processing units). Optionally, the application server in this embodiment can be the server corresponding to the multiprocessor computer system. In this case, since multiple CPUs need to access memory quickly, the memory needs to be cached. Once any cached data is updated, the shared memory needs to be updated immediately because other processors may also need to access it; otherwise, different processors may use different data. Shared memory is a communication method between multiple processes. This method is commonly used for inter-process communication within a program, and information can be transferred through shared memory. A process refers to a running activity of a program on a certain set of data in a computer. It is the basic unit for resource allocation and scheduling in a system and is the foundation of the operating system structure.
[0119] In this embodiment, the first storage space can be the shared memory space of the application server. When the service process exits due to an abnormal situation such as coredump (when a program crashes and is abnormally interrupted, the current state of the program is stored as a coredump file), the initial ranking data in the first storage space will not be affected. This effectively avoids abnormal user requests for leaderboard data during data recovery after a service crash. Optionally, the first storage space can be a dedicated memory space corresponding to the service process that provides services to terminal devices in the application server. That is, the first and second storage spaces can be specifically used to store data related to the leaderboard. Other types of data will not occupy the first and second storage spaces, thus effectively avoiding abnormal data processing related to the leaderboard due to the first or second storage space being occupied by other types of data.
[0120] This application provides a possible implementation method that updates the initial leaderboard data based on the real-time ranking to obtain the target leaderboard data corresponding to the target object identifier, including:
[0121] Obtain the basic attribute information of the object corresponding to the target object identifier;
[0122] Based on the object's basic attribute information and real-time ranking, the current ranking data corresponding to the target object identifier is obtained;
[0123] The initial leaderboard data is updated based on the current ranking data to obtain the target leaderboard data.
[0124] In practical applications, leaderboard data typically includes not only ranking information corresponding to each user identifier but also basic user attribute information (i.e., basic object attribute information). For example, leaderboard data also includes each user's ranking information and basic display data such as name, outfit, and rank. Optionally, the basic user attribute information of each user identifier can be stored in an object database (hereinafter referred to as the user database). This user database can be a storage plugin in any electronic device or any independent electronic device; this embodiment does not limit this. Further, the application server can obtain the basic user attribute information corresponding to a user identifier from the user database, and then, based on the obtained basic user attribute information and real-time ranking, obtain the current ranking data corresponding to the user identifier. Then, it updates the initial leaderboard data according to the current ranking data to obtain the target leaderboard data. The triggering condition for the application server to obtain the basic user attribute information corresponding to a user identifier can be configured according to actual needs.
[0125] In the embodiment of this application, since the target leaderboard data returned to the user includes not only the ranking information of each user, but also the basic attribute information of each user, the player can directly know the basic attribute information of each user in the leaderboard based on the target leaderboard data, without having to perform the operation of obtaining basic attribute information again, which is more in line with the actual needs of the user and improves the user experience.
[0126] This application provides a possible implementation for obtaining basic attribute information corresponding to the target object identifier, including:
[0127] If the initial ranking data includes the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data.
[0128] If the initial ranking data does not include the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
[0129] Optionally, when the application server obtains the user's basic attribute information corresponding to a user identifier, it can determine whether the initial leaderboard data includes the ranking data corresponding to the user identifier. If it does, the user's basic attribute information can be obtained from the initial leaderboard data, thereby reducing data acquisition time and improving data processing efficiency. Conversely, if the initial leaderboard data does not include the ranking data corresponding to the user identifier, the user's basic attribute information can be obtained from the user database.
[0130] Optionally, when obtaining the basic attribute information of the object corresponding to the target object identifier, it may also include:
[0131] If the time interval between the leaderboard retrieval request and the last leaderboard retrieval request of the terminal device is greater than or equal to a set threshold, the basic attribute information of the object corresponding to the target object identifier is retrieved from the object database based on the target object identifier.
[0132] If the time interval between the above-mentioned ranking request and the previous ranking request of the terminal device is less than a set threshold, the initial ranking data includes the ranking data corresponding to the target object identifier, and the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data; if the initial ranking data does not include the ranking data corresponding to the target object identifier, the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
[0133] In practical applications, the time interval between the current ranking request and the previous ranking request can also be determined. If the time interval is less than a set threshold, and the initial ranking data includes the ranking data corresponding to the user identifier, the basic attribute information of the user corresponding to the user identifier is unlikely to be updated due to the short time. In this case, the basic attribute information of the user corresponding to the user identifier can be obtained from the initial ranking data, thereby reducing data acquisition time and improving data processing efficiency. However, when the time interval is greater than the set threshold, the basic attribute information of the user corresponding to the user identifier may have been updated due to the long time. To ensure the accuracy of the basic attribute information, the basic attribute information of the user identifier can be obtained from the user database. It is understood that the application server can also obtain the basic attribute information of the user identifier from the user database every time to ensure the real-time accuracy of the basic attribute information of the user identifier. This application embodiment does not limit this.
[0134] This application provides a possible implementation method in which the first storage space stores initial ranking data corresponding to at least one second ranking type identifier, wherein the at least one second ranking type identifier includes the first ranking type identifier;
[0135] For any second leaderboard type identifier, the method further includes:
[0136] According to the ranking data update strategy corresponding to the second ranking type identifier, obtain the ranking information of each object identifier in the ranking corresponding to the second ranking type identifier from the ranking server;
[0137] Based on the ranking information of each object identifier obtained from the leaderboard server, the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space is updated.
[0138] Optionally, the first storage space stores initial ranking data corresponding to at least one ranking type identifier. To ensure data accuracy, the initial ranking data corresponding to each ranking type identifier stored in the first storage space can be updated. Each ranking type identifier has a corresponding ranking data update strategy. For any ranking identifier that needs updating (i.e., the second ranking type identifier), the ranking information of each user identifier in the ranking corresponding to the second ranking type identifier can be obtained from the ranking server according to the ranking data update strategy for that second ranking type identifier. Then, the initial ranking data corresponding to that second ranking type identifier stored in the first storage space is updated based on the ranking information of each user identifier obtained from the ranking server.
[0139] The leaderboard data update strategy can be configured according to actual needs, and this application embodiment is not limited. For example, the update strategy corresponding to all leaderboard type identifiers can be configured to be the same, such as configuring the update interval between each leaderboard identifier. When the update time of any leaderboard identifier is reached, the initial leaderboard data corresponding to that leaderboard identifier is updated. Alternatively, different leaderboard type identifiers can be configured to correspond to different leaderboard data update strategies. For example, the leaderboard data corresponding to different leaderboard type identifiers have different priorities, and the corresponding leaderboard data update strategy can be configured according to the priority. Or, the leaderboard server can send new leaderboard data to the game server according to the pre-configured leaderboard data update strategy. For example, when the ranking information corresponding to a certain leaderboard type identifier changes significantly (such as if the leaderboard is for the top 20 and the number of ranking changes exceeds 10), the leaderboard server can proactively send the ranking information of each user identifier corresponding to that leaderboard type identifier to the application server to update the leaderboard data corresponding to that leaderboard type identifier.
[0140] Understandably, when updating leaderboard data, each update can only update the initial leaderboard data corresponding to one leaderboard identifier. This ensures that a large number of update requests are not sent to the leaderboard server in a short period of time, thereby alleviating the load pressure on the application server. Furthermore, since the leaderboard data update process involves multiple steps, in order to avoid data anomalies due to errors in any step, if any step fails, the leaderboard data update for the current leaderboard type identifier can be terminated, and the update can be resumed at the next update interval.
[0141] In an optional embodiment of this application, updating the initial ranking data corresponding to the second ranking type identifier stored in the first storage space based on the ranking information of each object identifier obtained from the ranking server includes:
[0142] Retrieve basic attribute information of objects whose identifiers, obtained from the leaderboard server, correspond to the second leaderboard type identifier from the object database;
[0143] Based on the ranking information of each object identifier obtained from the ranking server and the corresponding basic attribute information of the object obtained from the object database, new ranking data corresponding to the second ranking type identifier is obtained.
[0144] The initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated using the new ranking data.
[0145] Optionally, when users retrieve a leaderboard of a certain type, they sometimes pay attention not only to the specific ranking information but also to the basic user attribute information of each user in the leaderboard. In this case, when updating the leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space, the basic user attribute information corresponding to each user identifier corresponding to the second leaderboard type identifier can be retrieved from the user database. The ranking information of each user identifier retrieved from the leaderboard server is then combined with the corresponding basic user attribute information retrieved from the user database to obtain new leaderboard data corresponding to the second leaderboard type identifier. Finally, the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space is replaced with this new leaderboard data.
[0146] As an optional approach, when updating the initial ranking data corresponding to any second ranking type identifier, the second ranking type identifier can be recorded. Then, the ranking information of each user identifier corresponding to the second ranking type identifier can be obtained from the ranking server. When it is determined that the type identifier corresponding to the returned ranking information of each user identifier is consistent with the recorded second ranking type identifier (i.e., the data is returned normally), the user basic attribute information corresponding to each user identifier corresponding to the second ranking type identifier can be obtained from the user database. When it is determined again that the type identifier corresponding to the returned user basic attribute information is consistent with the recorded second ranking type identifier, it indicates that the data is returned normally. At this time, the initial ranking data corresponding to the second ranking type identifier stored in the first storage space can be copied to the second storage space. Based on the ranking information of each user identifier obtained from the ranking server and the corresponding user basic attribute information obtained from the user database, the new ranking data corresponding to the second ranking type identifier can be obtained. Then, the initial ranking data corresponding to the second ranking type identifier stored in the first storage space can be replaced with the new ranking data.
[0147] In this embodiment, by recording the identifier of the leaderboard type being updated, the normality of the data during a single data update can be guaranteed, avoiding timeout returns or data problems caused by other abnormal reasons. At the same time, by using a scheme to temporarily store the leaderboard data to be updated in a second storage space, the leaderboard data can be updated without loss, without affecting the leaderboard data acquisition request during the update period, thus improving availability.
[0148] Optionally, after obtaining the ranking data corresponding to the second ranking type identifier from the ranking server and the user basic attribute information corresponding to each user identifier from the user database, it can be determined whether the data return packet is normal (such as whether the network connection is normal, whether the data format is returned normally, etc.). When it is determined that the data return packet is normal, the initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated based on the obtained ranking information of each user identifier and the user basic attribute information corresponding to each user identifier. This can effectively avoid the problem of increased data processing volume caused by update failure due to abnormal data return packets.
[0149] Optionally, to better understand the method provided in the embodiments of this application, the method will be described in detail below in conjunction with a game scenario. In this example, a player (also referred to as a user) in the game refers to the target object, and the basic attribute information of the object refers to the player data of the game player, which may include the player's nickname, specific score (i.e., subsequent combat power value) and rank. At this time, the system implementing the leaderboard data processing method may specifically include a game client (i.e., Client, i.e., the terminal device in this application), a connection layer, a main logic service cluster (i.e., GameSvr Cluster) including multiple game servers (i.e., GameSvr, i.e., application servers in this application), a leaderboard application server (i.e., Rank System), and a user database (i.e., Database) for storing player data. Optionally, after a player establishes a long connection with a GameSvr in the GameSvr Cluster through the connection layer, they can interact with the server logic related to the game. Each GameSvr obtains the leaderboard data of each leaderboard type identifier (taking the power leaderboard, level leaderboard and arena leaderboard as examples in this example) from the Rank system and caches it in the first memory of the GameSvr (i.e. the first storage space in this embodiment). At this time, it is equivalent to each GameSvr having a snapshot of the leaderboard data of the leaderboard type identifier at a certain moment.
[0150] Optionally, the leaderboard data management class (i.e., GlobalAttrRankMgr) used by GameSvr to manage various types of leaderboard data can be as shown in Table 1:
[0151] Table 1
[0152]
[0153]
[0154] Among them, m_lastRefreshTime: records the time of the last update. In Table 1, a UNIX (a type of operating system) timestamp is represented by the uint32 data type.
[0155] m_updateSeq: Update sequence number (used to identify the leaderboard being updated), used for data deduplication and data correctness verification. In Table 1, a sequence number is represented by the uint16 data type.
[0156] m_updateRankType: Represents the ranking type being updated. The ranking type can be defined as an int in Table 1. The value increases from the smallest ranking type to the largest ranking type and then ends.
[0157] m_useCache (i.e., the first storage space): used to store the initial leaderboard data for each leaderboard type. Its structure is a two-dimensional array (i.e., the vector in Table 1). The vertical size of this array represents the number of all leaderboard types that need to be used, and the horizontal size represents the data of the first N players that need to be displayed for this leaderboard. The data units include the player's score and the basic user attribute information required by the client for display.
[0158] m_updateCache (i.e., the second storage space): It is used to cache leaderboard data that is being updated. Its structure is a two-dimensional array (i.e., the vector in Table 1). Only after the Rank System and Data both return normal data and fill the cache will the data in the cache be replaced by m_useCache to achieve the purpose of updating the data.
[0159] TickUpdate(): A timed function that is called within the GameSvr Tick() function. It is mainly used to determine when the leaderboard data can be updated. In Table 1, the function returns an int data type variable to represent the update result.
[0160] OnRspRankSystem(): Callback function used to handle subsequent logic when the leaderboard server returns leaderboard data. The function in Table 1 returns void (no type).
[0161] OnRspDB(): Callback function, used to handle subsequent logic when the DB side returns the basic user attribute information of each user in the leaderboard. Table 1 function returns void (no type).
[0162] UpdateAttrRank(int updateRankType): Updates the leaderboard data of the specified type according to the parameter updateRankType. In Table 1, the function returns an int data type variable to represent the update result.
[0163] Optionally, if a player wants to obtain the leaderboard data for the combat power ranking, the player can send a leaderboard retrieval request to the connected game server (i.e., GameSvr) via the connection layer on the Client. GameSvr can obtain the player's real-time ranking information from the Rank System and the player's data from the Database. Based on the obtained real-time ranking information, player data, and the leaderboard data for the combat power ranking stored in the first memory, it generates a new combat power ranking and returns it to the Client. The specific process for the player to obtain the combat power ranking is as follows: Figure 6 As shown, it can specifically include:
[0164] Step S401: The game server receives a leaderboard retrieval request sent by the game client;
[0165] Optionally, the leaderboard retrieval request may include the player's identifier and the power ranking identifier.
[0166] Step S402: The game server obtains the player's real-time ranking on the power ranking list from the Rank System;
[0167] Step S403: The game server determines whether the real-time ranking of the player on the power ranking meets the requirements. If yes, proceed to step S404; otherwise, proceed to step S409.
[0168] Step S404: The game server determines whether the real-time ranking overlaps with any ranking in the initial ranking data of the combat power ranking stored in the first memory. If so, proceed to step S405; otherwise, proceed to step S406.
[0169] Optionally, when determining whether a real-time ranking overlaps with any ranking in the initial leaderboard data, the game server can determine whether the player's current combat power is greater than the combat power of the last player in the initial leaderboard data. If it is greater, the real-time ranking can be considered to overlap with any ranking in the initial leaderboard data; otherwise, it is considered not to overlap.
[0170] In step S405, the game server copies the initial leaderboard data to the second memory (i.e., the second storage space in this application), and rearranges the initial leaderboard data in the second memory according to the real-time ranking to obtain the rearranged leaderboard data.
[0171] Optionally, when the game server reorders the initial leaderboard data in the second memory based on the real-time rankings, if the player was included in the original initial leaderboard data, the player's corresponding combat power value in the initial leaderboard data can be replaced with the combat power value corresponding to the obtained real-time ranking. Then, the leaderboard data with the replaced combat power value is reordered to obtain the reordered leaderboard data. Conversely, if the player was not included in the original initial leaderboard data, but the player's current combat power value is greater than the combat power value of the last player in the initial leaderboard data, the initial leaderboard data can be reordered based on the player's real-time ranking score to obtain the reordered leaderboard data.
[0172] Step S406: The game server obtains the player data corresponding to the player.
[0173] Optionally, player data may include the player's nickname, combat power, and rank.
[0174] In step S407, the game server fills the player data corresponding to the player into the rearranged leaderboard data, obtains the new power ranking leaderboard data, and returns it to the game client;
[0175] Step S408: The game server deletes the rearranged leaderboard data from the second memory.
[0176] Step S409, end the process of obtaining the combat power ranking.
[0177] Furthermore, after receiving the power rankings returned by the game server, the game client can... Figure 7 The ranking data of the power ranking list is displayed to the player. This power ranking list includes the top 3 players based on their power value, namely players A through C. When displaying this power ranking list, the nickname, power value, and rank of each player in the list are also shown. For example, the first-ranked player is player A, nickname "Starry Sky," with a power value of 100 and rank a; the second-ranked player is player B, nickname "Relief," with a power value of 95 and rank b; the third-ranked player is player C, nickname "Ocean," with a power value of 90 and rank c. If the player corresponding to this request is not in this power ranking list, their nickname, power value, and rank can be displayed in other areas of the power ranking list display interface, such as in... Figure 7 The dotted line in the middle shows the player's nickname, Yangguan, combat power value, and rank, D.
[0178] Optionally, to facilitate players' access to other types of leaderboards, trigger icons for accessing other types of leaderboards can be displayed at the top of the power ranking display interface. When players want to access other types of leaderboards, they can click the corresponding trigger icon. For example, the text "Level Ranking" and the text "Arena Ranking" can be displayed simultaneously at the top of the power ranking display interface as trigger icons.
[0179] Optionally, to ensure the accuracy of the initial ranking data corresponding to each ranking type identifier stored in the first memory, the initial ranking data corresponding to each ranking type identifier stored in the first memory can be updated periodically. When the update time corresponding to any ranking type identifier is reached, the initial ranking data corresponding to that ranking type identifier can be updated. As shown in Figure 8, this example uses updating the combat power ranking as an example to illustrate the ranking data update process:
[0180] Step S601: The game server determines whether the update interval of the power ranking has been reached. If so, proceed to step S602; otherwise, proceed to step S611.
[0181] Step S602: The game server records the identifiers on the power ranking list;
[0182] Optionally, the identifier for the game server's power ranking can be recorded using m_updateSeq.
[0183] Step S603: The game server obtains the ranking information of each player in the power ranking from the Rank System;
[0184] Step S604: The game server determines whether the returned ranking information meets the requirements. If yes, proceed to step S605; otherwise, proceed to step S611.
[0185] Optionally, when determining whether the returned ranking information meets the requirements, one could check whether the data format of the returned ranking information is correct, etc.
[0186] Step S605: The game server confirms whether the returned leaderboard data corresponds to the leaderboard based on the recorded leaderboard identifier. If yes, proceed to step S606; otherwise, proceed to step S611.
[0187] When the game server confirms whether the returned ranking information corresponds to the power ranking, it can determine whether the leaderboard type identifier carried in the returned ranking information is the identifier of the power ranking recorded in m_updateSeq. If so, step S606 is executed; otherwise, step S611 is executed.
[0188] Step S606: The game server copies the initial ranking data of the combat power ranking in the first memory to the second memory.
[0189] Step S607: The game server retrieves player data for each player from the leaderboard corresponding to the power ranking from the user database.
[0190] Step S608: The game server determines whether the returned player data meets the requirements, such as whether the data format of the returned player data is correct. If yes, proceed to step S609; otherwise, proceed to step S611.
[0191] Step S609: The game server obtains new power ranking data based on the obtained ranking information of each user and the obtained player data.
[0192] Step S610: The game server replaces the ranking data of the power ranking in the second memory with the ranking data of the new power ranking.
[0193] Step S611, update error, stop updating.
[0194] This application provides a ranking data processing device, such as... Figure 9 As shown, the ranking data processing device 90 may include: a request receiving module 901, a data acquisition module 902, a data update module 903, and a data sending module 904, wherein...
[0195] The request receiving module 901 is used to receive a leaderboard acquisition request sent by the terminal device. The leaderboard acquisition request includes the target object identifier corresponding to the terminal device.
[0196] The data acquisition module 902 is used to obtain the real-time ranking corresponding to the target object identifier from the ranking server, and to obtain the cached initial ranking data from the first storage space of the application server.
[0197] The data update module 903 is used to update the initial ranking data according to the real-time ranking to obtain the target ranking data corresponding to the target object identifier;
[0198] The data sending module 904 is used to send the target ranking data to the terminal device so that the target ranking data can be displayed on the terminal device.
[0199] Optionally, the leaderboard retrieval request may also include a first leaderboard type identifier;
[0200] The data acquisition module, when retrieving the real-time ranking corresponding to the target object identifier from the ranking server and the cached initial ranking data from the application server's first storage space, is specifically used for:
[0201] The system retrieves the real-time ranking of the target object corresponding to the first ranking type identifier from the ranking server, and retrieves the cached initial ranking data corresponding to the first ranking type identifier from the first storage space of the application server.
[0202] Among them, the target ranking data is the target ranking data whose target object identifier corresponds to the first ranking type identifier.
[0203] Optionally, when the data update module updates the initial leaderboard data based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier, it is specifically used for:
[0204] If the real-time ranking overlaps with any ranking in the initial leaderboard data, copy the initial leaderboard data to the second storage space;
[0205] The initial leaderboard data in the second storage space is rearranged based on the real-time ranking to obtain the target leaderboard data;
[0206] If the real-time rankings do not overlap with any of the rankings in the initial leaderboard data, the data sending module is also used for:
[0207] The initial leaderboard data is sent to the terminal device as the target leaderboard data.
[0208] Optionally, the first storage space is the shared memory space of the application server or the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device;
[0209] The second storage space is the dedicated memory space corresponding to the service processes in the application server that provide services to terminal devices.
[0210] Optionally, the device also includes a deletion module for:
[0211] After sending the target leaderboard data to the terminal device, the target leaderboard data is deleted from the second storage space.
[0212] Optionally, when the data update module updates the initial leaderboard data based on the real-time rankings to obtain the target leaderboard data corresponding to the target object identifier, it is specifically used for:
[0213] Obtain the basic attribute information of the object corresponding to the target object identifier;
[0214] Based on the object's basic attribute information and real-time ranking, the current ranking data corresponding to the target object identifier is obtained;
[0215] The initial leaderboard data is updated based on the current ranking data to obtain the target leaderboard data.
[0216] Optionally, when the data update module obtains the basic attribute information of the object corresponding to the target object identifier, it is specifically used for:
[0217] If the initial ranking data includes the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data.
[0218] If the initial ranking data does not include the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
[0219] Optionally, the first storage space stores initial ranking data corresponding to at least one second ranking type identifier, wherein the at least one second ranking type identifier includes the first ranking type identifier;
[0220] For any second leaderboard type identifier, the device also includes a leaderboard update module for:
[0221] According to the ranking data update strategy corresponding to the second ranking type identifier, obtain the ranking information of each object identifier in the ranking corresponding to the second ranking type identifier from the ranking server;
[0222] Based on the ranking information of each object identifier obtained from the leaderboard server, the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space is updated.
[0223] Optionally, when the leaderboard update module updates the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space based on the ranking information of each object identifier obtained from the leaderboard server, it is specifically used for:
[0224] Retrieve basic attribute information of objects whose identifiers, obtained from the leaderboard server, correspond to the second leaderboard type identifier from the object database;
[0225] Based on the ranking information of each object identifier obtained from the ranking server and the corresponding basic attribute information of the object obtained from the object database, new ranking data corresponding to the second ranking type identifier is obtained.
[0226] The initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated using the new ranking data.
[0227] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.
[0228] This application provides an electronic device, including a memory, a processor, and a computer program stored in the memory. The processor executes the computer program to implement the steps of the leaderboard data processing method.
[0229] In one alternative embodiment, an electronic device is provided, such as Figure 10 As shown, Figure 10 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0230] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0231] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0232] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0233] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0234] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.
[0235] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0236] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.
[0237] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.
[0238] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.
Claims
1. A method for processing ranking data, characterized in that, include: Receive a leaderboard retrieval request sent by a terminal device, wherein the leaderboard retrieval request includes a target object identifier corresponding to the terminal device; In response to the leaderboard acquisition request, the system obtains the real-time ranking corresponding to the target object identifier from the leaderboard server and the cached initial leaderboard data from the first storage space of the application server. If the real-time ranking overlaps with any ranking in the initial ranking data, the initial ranking data is rearranged according to the real-time ranking to obtain the target ranking data corresponding to the target object identifier; If the real-time ranking does not overlap with each ranking in the initial ranking data, the initial ranking data will be used as the target ranking data corresponding to the target object identifier. The target ranking data is sent to the terminal device so that the target ranking data can be displayed on the terminal device.
2. The method of claim 1, wherein, The leaderboard retrieval request also includes a first leaderboard type identifier; The steps of obtaining the real-time ranking corresponding to the target object identifier from the ranking server and obtaining the cached initial ranking data from the first storage space of the application server include: The system retrieves the real-time ranking of the target object identifier corresponding to the first ranking type identifier from the ranking server, and retrieves the cached initial ranking data corresponding to the first ranking type identifier from the first storage space of the application server. The target ranking data refers to the target ranking data whose target object identifier corresponds to the first ranking type identifier.
3. The method of claim 1, wherein, The step of rearranging the initial leaderboard data according to the real-time ranking to obtain the target leaderboard data corresponding to the target object identifier includes: Copy the initial leaderboard data to the second storage space; The initial leaderboard data in the second storage space is rearranged based on the real-time ranking to obtain the target leaderboard data corresponding to the target object identifier.
4. The method of claim 3, wherein, The first storage space is either the shared memory space of the application server or the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device. The second storage space is the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device.
5. The method of claim 3, wherein, After sending the target ranking data to the terminal device, the method further includes: Delete the target leaderboard data from the second storage space.
6. The method according to any one of claims 1 to 5, characterized in that, The step of updating the initial ranking data based on the real-time ranking to obtain the target ranking data corresponding to the target object identifier includes: Obtain the basic attribute information of the object corresponding to the target object identifier; Based on the object's basic attribute information and the real-time ranking, the current ranking data corresponding to the target object identifier is obtained; The initial ranking data is updated based on the current ranking data to obtain the target ranking data.
7. The method of claim 6, wherein, The step of obtaining the basic attribute information of the object corresponding to the target object identifier includes: If the initial ranking data includes the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data. If the initial ranking data does not include the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
8. The method according to any one of claims 1 to 5, characterized in that, The first storage space stores initial ranking data corresponding to at least one second ranking type identifier, wherein the at least one second ranking type identifier includes a first ranking type identifier; For any of the second leaderboard type identifiers, the method further includes: According to the ranking data update strategy corresponding to the second ranking type identifier, the ranking information of each object identifier in the ranking corresponding to the second ranking type identifier is obtained from the ranking server; Based on the ranking information of each object identifier obtained from the ranking server, the initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated.
9. The method of claim 8, wherein, The step of updating the initial ranking data corresponding to the second ranking type identifier stored in the first storage space based on the ranking information of each object identifier obtained from the ranking server includes: Retrieve basic attribute information of objects whose identifiers obtained from the ranking server correspond to the second ranking type identifier from the object database; Based on the ranking information of each object identifier obtained from the ranking server and the corresponding basic attribute information of the object obtained from the object database, new ranking data corresponding to the second ranking type identifier is obtained. The new leaderboard data is used to update the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space.
10. A leaderboard data processing apparatus, characterized by, include: The request receiving module is used to receive a leaderboard acquisition request sent by a terminal device, wherein the leaderboard acquisition request includes a target object identifier corresponding to the terminal device; The data acquisition module is used to respond to the ranking acquisition request by acquiring the real-time ranking corresponding to the target object identifier from the ranking server and the cached initial ranking data from the first storage space of the application server. The data update module is used to rearrange the initial ranking data according to the real-time ranking if the real-time ranking overlaps with any ranking in the initial ranking data, so as to obtain the target ranking data corresponding to the target object identifier; if the real-time ranking does not overlap with any ranking in the initial ranking data, the initial ranking data is used as the target ranking data corresponding to the target object identifier. The data sending module is used to send the target ranking data to the terminal device so that the target ranking data can be displayed on the terminal device.
11. The apparatus of claim 10, wherein, The leaderboard retrieval request also includes a first leaderboard type identifier; The data acquisition module is used for: The system retrieves the real-time ranking of the target object identifier corresponding to the first ranking type identifier from the ranking server, and retrieves the cached initial ranking data corresponding to the first ranking type identifier from the first storage space of the application server. The target ranking data refers to the target ranking data whose target object identifier corresponds to the first ranking type identifier.
12. The apparatus of claim 10, wherein, The data update module is used for: Copy the initial leaderboard data to the second storage space; The initial leaderboard data in the second storage space is rearranged based on the real-time ranking to obtain the target leaderboard data corresponding to the target object identifier.
13. The apparatus of claim 12, wherein, The first storage space is either the shared memory space of the application server or the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device. The second storage space is the dedicated memory space corresponding to the service process in the application server that provides services to the terminal device.
14. The apparatus of claim 12, wherein, The device further includes a deletion module, the deletion module being used for: Delete the target leaderboard data from the second storage space.
15. The apparatus according to any one of claims 10 to 14, characterized in that, The data update module is used for: Obtain the basic attribute information of the object corresponding to the target object identifier; Based on the object's basic attribute information and the real-time ranking, the current ranking data corresponding to the target object identifier is obtained; The initial ranking data is updated based on the current ranking data to obtain the target ranking data.
16. The apparatus according to claim 15, characterized in that, The data update module is used for: If the initial ranking data includes the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained based on the ranking data. If the initial ranking data does not include the ranking data corresponding to the target object identifier, then the basic attribute information of the object corresponding to the target object identifier is obtained from the object database based on the target object identifier.
17. The apparatus according to any one of claims 10 to 14, characterized in that, The first storage space stores initial ranking data corresponding to at least one second ranking type identifier, wherein the at least one second ranking type identifier includes a first ranking type identifier; For any of the second leaderboard type identifiers, the device further includes a leaderboard update module, the leaderboard update module being used to: According to the ranking data update strategy corresponding to the second ranking type identifier, the ranking information of each object identifier in the ranking corresponding to the second ranking type identifier is obtained from the ranking server; Based on the ranking information of each object identifier obtained from the ranking server, the initial ranking data corresponding to the second ranking type identifier stored in the first storage space is updated.
18. The apparatus according to claim 17, characterized in that, The leaderboard update module is used for: Retrieve basic attribute information of objects whose identifiers obtained from the ranking server correspond to the second ranking type identifier from the object database; Based on the ranking information of each object identifier obtained from the ranking server and the corresponding basic attribute information of the object obtained from the object database, new ranking data corresponding to the second ranking type identifier is obtained. The new leaderboard data is used to update the initial leaderboard data corresponding to the second leaderboard type identifier stored in the first storage space.
19. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the steps of the method according to any one of claims 1-9.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.
21. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.