Object processing method and device, equipment, storage medium and program product
By using the N-layer cascaded search nodes in the target tree data structure and the target tree data structure in the blockchain network, the problem of complex and resource-consuming object ranking calculation in the existing technology is solved, and fast and efficient object ranking calculation is achieved. Improved user experience.
Patent Information
- Application Number
- CN202411632415.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The prior art sorting algorithm used for object ranking in blockchain networks is complex and consumes a large amount of gas resources, resulting in complex ranking calculations, resource consumption and easy to lead to response failure.
Using the target tree data structure, the number of objects and index value sequences are stored through the N-layer cascaded search nodes, the target tree data structure is traversed to determine the target search node, and the number of first and second objects is calculated based on the target index value and search node data. This determines the target ranking of the object.
It reduces the gas consumption required for computing complexity and ranking business logic, realizes fast and efficient object ranking calculation, and improves users' decision-making and expansion experience under the target business.
Smart Images

Figure CN119474471A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of blockchain technology, and specifically to a method, apparatus, device, storage medium, and program product for object processing. Background Art
[0002] In Internet applications, various rankings are often used. For example, rankings are performed for popular content, active users, popular topics, advertisements, gamers in virtual games, etc. By ranking objects under different businesses, the implementation of subsequent business logic such as rewards, object matching, and rankings can be further promoted.
[0003] In the relevant scheme, usually in the blockchain network, a sorting algorithm such as quick sort, merge sort, bubble sort or insertion sort is used to determine the ranking of the object. Every time a ranking request is received, it is necessary to re-traverse the list to count the total number of other objects before the object according to the index value of the object (such as the score of the object, etc.) to calculate the ranking of the object. Moreover, the current sorting algorithms are basically implemented on the basis of Turing complete programming languages, and do not take into account the consumption of gas resources under the gas mechanism in the blockchain network. In other words, using relevant schemes to determine the ranking of objects is not only complex in calculation and consumes more gas resources, but also makes it easy for the ranking request to fail to be responded to or fail to respond, which leads to the inability to accurately calculate the ranking of the object. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, storage medium and program product for object processing, which are used to reduce the complexity of calculation and the gas consumption required for ranking business logic, and can quickly and efficiently calculate the ranking of objects, thereby improving the user's decision-making and expansion experience under the target business.
[0005] In view of this, the present application provides a method for object processing on one hand. The method is applied to an object processing node in a blockchain network. The method includes:
[0006] Obtaining a pending request, where the pending request includes a target indicator value and a first identifier, where the target indicator value is used to evaluate the ranking of the target object in the target business, and the first identifier is used to identify the target object;
[0007] Obtain a target tree data structure, the target tree data structure includes N layers of cascaded search nodes, each layer of search nodes includes an index value sequence and the number of objects, the index value sequence is used to represent the ranking of the index values of multiple candidate objects, the number of objects is used to represent the number of multiple candidate objects, and N is a positive integer;
[0008] Traverse the target tree data structure and determine the target search node from the N-level cascaded search nodes based on the target index value;
[0009] Determine the first number of objects based on the target index value, the index value sequence of the target search node, and the number of objects of the target search node; determine the second number of objects based on the target index value, the first identifier, the index value sequence of the target search node, and the number of objects of the target search node, wherein the index value of each candidate object corresponding to the first number of objects is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value;
[0010] A target ranking of the target object is determined based on the first object quantity and the second object quantity.
[0011] On the other hand, the present application provides an object processing node, which may include an acquisition unit and a determination unit. Optionally, it may also include a search unit and an execution unit.
[0012] An acquisition unit, used to acquire a pending request, the pending request including a target indicator value and a first identifier, the target indicator value is used to evaluate the ranking of the target object in the target business, and the first identifier is used to identify the target object;
[0013] An acquisition unit is used to acquire a target tree data structure, the target tree data structure includes N layers of cascaded search nodes, each layer of search nodes includes an index value sequence and an object quantity, the index value sequence is used to represent the ranking of the index values of multiple candidate objects, the object quantity is used to represent the quantity of multiple candidate objects, and N is a positive integer;
[0014] A determination unit, used to traverse the target tree data structure and determine the target search node from the N-layer cascaded search nodes based on the target index value;
[0015] A determination unit, configured to determine a first number of objects based on a target index value, an index value sequence of a target search node, and the number of objects of the target search node, and to determine a second number of objects based on the target index value, a first identifier, an index value sequence of a target search node, and the number of objects of the target search node, wherein the index value of each candidate object corresponding to the first number of objects is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value;
[0016] A determination unit is used to determine a target ranking of the target object based on the first object quantity and the second object quantity.
[0017] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0018] The N-layer cascaded search nodes include the first search node of the first N-1 layers of cascades, and one or more second search nodes cascaded with the first search node of the N-1th layer; the target tree data structure also includes: one or more third search nodes cascaded with the second search nodes, and a fourth search node cascaded with each third search node;
[0019] The number of objects in the first search node of the i-th level is the same as the number of objects in all the first search nodes of the cascaded i+1-th level, the index value sequence of the first search node of the i-th level includes multiple first index values, and the numerical interval between every two adjacent first index values corresponds to the index value sequence of the first search node of the cascaded i+1-th level, 1≤i<N, i is an integer;
[0020] Each value interval in the first search node of the N-1th level includes an index value sequence of a second search node, each index value sequence of the second search node includes one or more second index values, and the sum of the number of objects of all the second search nodes is the same as the number of objects of the cascaded first search node of the N-1th level;
[0021] Each third search node includes an index value and the number of objects, the index values of all third search nodes constitute the index value sequence of the second search node, and the fourth search node includes an object identifier list, and each object identifier in the object identifier list is used to identify a candidate object.
[0022] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0023] Step 1: traverse the first search node of the i-th level, and when the target index value is included in the first numerical interval in the index value sequence of the first search node of the i-th level, determine the first search node of the i+1th level associated with the first numerical interval as the first child node, and the minimum value of the first numerical interval is less than or equal to the target index value, and the maximum value is greater than the target index value;
[0024] Step 2: Repeat step 1 until the first search node of the N-1th layer is traversed, and when the target index value matches the second index value in the index value sequence of the cascaded second search node, determine that the second search node corresponding to the index value match is the target search node.
[0025] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0026] Determine a second child node at the same level as the target search node, and each index value in the index value sequence of the second child node is greater than the index value in the index value sequence of the target search node; determine a fourth child node at the same level as the third child node, and the third child node includes the first search node of each level in the first N-1 levels cascaded with the target search node, and each index value in the index value sequence of the fourth child node is greater than the index value in the index value sequence of the third child node at the same level;
[0027] Extract the number of objects in the second child node and the number of objects in the fourth child node of each level;
[0028] The number of objects of the second child node and the sum of the number of objects of the fourth child nodes of all levels are calculated to obtain the first number of objects.
[0029] In one possible design, in another implementation of another aspect of the embodiment of the present application, the index value sequence of the search nodes at each level in the N-layer cascade search nodes is arranged in descending order; the determination unit is specifically used to:
[0030] The sibling node arranged on the left side of the target search node is determined as the second child node at the same level as the target search node.
[0031] In one possible design, in another implementation of another aspect of the embodiment of the present application, the index value sequence of the search nodes at each level in the N-layer cascade search nodes is arranged in ascending order; the determination unit is specifically used to:
[0032] The sibling node arranged on the right side of the target search node is determined as the second child node at the same level as the target search node.
[0033] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0034] When the target index value matches the index value of any third search node associated with the target search node, matching the first identifier with the object identifier list in the fourth search node associated with the corresponding third search node;
[0035] When the first identifier matches any object identifier in the object identifier list in the fourth search node associated with the corresponding third search node, the number of objects in the target search node whose index value is greater than the target index value is counted;
[0036] The number of objects in the target search node when the index value is greater than the target index value is taken as the second object number.
[0037] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0038] The acquisition unit may also be used to acquire a first value after traversing the target tree data structure and determining the target search node from the first search nodes of the N-layer cascade based on the target index value, the first value being used to indicate the number of M target candidate objects, each target candidate object being used to interact with the target object, and M being a positive integer;
[0039] A determination unit, specifically configured to determine an object identifier of each target candidate object based on the target index value, the first numerical value, and a list of object identifiers of a fourth search node associated with the target search node;
[0040] A searching unit, specifically configured to search for M target candidate objects based on the object identifiers of the M target candidate objects;
[0041] The execution unit is specifically used to perform interactive operations on the M target candidate objects and the target object.
[0042] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0043] When there is a third index value greater than the target index value in the target search node, the object identifier corresponding to the first value is selected from the object identifier list of the fourth search node associated with the third search node corresponding to the third index value to determine the object identifier of each target candidate object.
[0044] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0045] When there is no third index value greater than the target index value in the target search node, a fourth index value greater than the target index value is determined from other second search nodes at the same level as the target search node;
[0046] From the object list of the fourth search node associated with the third search node corresponding to the fourth index value, select the object identifier corresponding to the first value to determine the object identifier of each target candidate object.
[0047] In one possible design, in another implementation of another aspect of the embodiment of the present application, the other second search nodes at the same level include a fifth child node and a sixth child node, and the index value in the index value sequence of the fifth child node is greater than the index value in the index value sequence of the sixth child node; the determination unit is specifically used to:
[0048] Determine a fourth index value greater than the target index value from the index value sequence of the fifth child node and the index value sequence of the sixth child node;
[0049] When the number of objects of the sixth subnode is less than the first value, extracting the first object identifier corresponding to the number of objects of the sixth subnode from the object identifier list of the fourth search node associated with each fourth index value of the sixth subnode;
[0050] Calculate the difference between the first value and the number of objects of the sixth child node to obtain a second value;
[0051] Extracting a second object identifier corresponding to the second value from the object identifier list of the fourth search node associated with each fourth index value of the fifth child node;
[0052] Based on the first object identifier and the second object identifier, an object identifier corresponding to the first value is obtained.
[0053] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0054] determining a first local ranking of the target object based on the first object quantity, and determining a second local ranking of the target object based on the second object quantity;
[0055] Based on the first local ranking and the second local ranking, a target ranking of the target object is obtained.
[0056] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:
[0057] Calculate the sum of the first local ranking and the second local ranking to obtain the first ranking;
[0058] The next ranking position after the first ranking position is used as the target ranking of the target object.
[0059] In one possible design, in another implementation of another aspect of the embodiment of the present application, the target object includes a virtual player in a virtual game.
[0060] In one possible design, in another implementation of another aspect of the embodiment of the present application, the virtual game includes a full-chain game.
[0061] On the other hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned methods when executing the computer program.
[0062] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned methods are implemented.
[0063] Another aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned methods when executed by a processor.
[0064] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0065] In an embodiment of the present application, the pending request and the target tree data structure are obtained by the object processing node in the blockchain network. The pending request includes a target index value and a first identifier, the target index value is used to evaluate the ranking of the target object in the target business, and the first identifier is used to identify the target object. In addition, the target tree data structure of the present application includes N layers of cascaded search nodes, and the search nodes at each level include an index value sequence and a number of objects. The index value sequence is used to characterize the ranking of the index values of multiple candidate objects, and the number of objects is used to characterize the number of multiple candidate objects, and N is a positive integer. After obtaining the target tree data structure and the pending request, the object processing node traverses the target tree data structure and determines the target search node from the N layers of cascaded search nodes based on the target index value. In this way, the object processing node determines the first number of objects based on the target index value, the index value sequence of the target search node, and the number of objects of the target search node; and the object processing node also needs to determine the second number of objects based on the target index value, the first identifier, the index value sequence of the target search node, and the number of objects of the target search node. The index value of each candidate object corresponding to the first number of objects mentioned above is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value. In this way, after determining the first number of objects and the second number of objects, the object processing node determines the target ranking of the target object based on the first number of objects and the second number of objects.
[0066] That is to say, the present application stores the number of objects and the sequence of index values in the search nodes of each level of the N-layer cascade in the target tree data structure. In this way, the present application only needs to obtain the target index value and the first identifier of the target object, and then determine the target search node where the target index value of the target object is located in the N-layer cascade search nodes by traversing and searching, and then extract the first number of objects from other search nodes whose index values are greater than the target index value, and extract the second number of objects greater than the target index value from the target search node. Therefore, the present application can determine the total number of objects arranged before the target object through the extracted number of first objects and the number of second objects, thereby clarifying the target ranking of the target object. Through the above method, the present application can, under the gas resources limited by the gas mechanism, do not need to re-count the number of other objects ranked in front according to the index value of the object every time, but match the target index value of the target object with the index value sequence of the search nodes at different levels in the target tree data structure, and then directly extract the number of objects from the corresponding search node, so as to determine the total number of objects ranked before the target object, and then obtain the final ranking of the target object, which greatly reduces the complexity of calculation and the gas consumption required for ranking, and can quickly and efficiently calculate the ranking of the object, thereby improving the user's decision-making and expansion experience under the target business. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0068] Figure 1A A schematic diagram showing a ranking diagram of the present application scheme applied in a virtual game scene;
[0069] Figure 1B A schematic diagram showing the ranking of the present application scheme in an advertising delivery scenario is shown;
[0070] Figure 1C A schematic diagram showing the ranking of the present application scheme in a shopping scenario is shown;
[0071] Figure 2 A schematic diagram of an implementation environment of the object processing method of an embodiment of the present application is shown;
[0072] Figure 3 A schematic diagram showing an application scenario of a virtual game in a blockchain network according to an embodiment of the present application is shown;
[0073] Figure 4A schematic diagram of a process of an object processing method provided by an embodiment of the present application is shown;
[0074] Figure 5 A schematic diagram of the structure of the target tree data structure provided by the present application is shown;
[0075] Figure 6 A schematic diagram of a process for determining a target search node in an embodiment of the present application is shown;
[0076] Figure 7 A schematic diagram of a process for determining the number of first images in an embodiment of the present application is shown;
[0077] Figure 8 Another schematic diagram of the target tree data structure provided by the present application is shown;
[0078] Fig. 9 A schematic diagram of a process for determining the number of second objects in an embodiment of the present application is shown;
[0079] Fig.10 Another schematic diagram of the process of processing an object provided by an embodiment of the present application is shown;
[0080] Fig.11 The present application embodiment is shown Figure 5 A schematic diagram of the structure of the leaf nodes cascaded by the search node A6 in FIG.
[0081] Fig.12 A functional structure diagram of an object processing node in an embodiment of the present application is shown;
[0082] Fig.13 A schematic diagram of the hardware structure of the object processing device in the embodiment of the present application is shown. DETAILED DESCRIPTION
[0083] The embodiments of the present application provide a method, apparatus, device, storage medium and program product for object processing, which are used to reduce the complexity of calculation and the gas consumption required for ranking business logic, and can quickly and efficiently calculate the ranking of objects, thereby improving the user's decision-making and expansion experience under the target business.
[0084] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0085] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0086] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the implementation of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0087] The ranking system in the business is mainly based on the index values of the objects. These index values can be the performance, achievements, or scores obtained by completing tasks in the business, or business rewards, etc. For example, in the virtual game business, different game players obtain index values by participating in virtual games, and then rank according to the index values. Through this ranking mechanism, it can not only help objects such as game players understand their ranking in the current business, but also motivate objects to work hard to improve their performance in the business in order to obtain a higher ranking.
[0088] The related schemes usually use conventional sorting algorithms in blockchain networks to traverse the list to count the number of other objects before a certain object to determine the ranking. However, the consumption of gas resources under the gas mechanism in blockchain networks is not taken into account. In other words, using related schemes to determine the ranking of objects is not only computationally complex and consumes more gas resources, but also makes it easy for ranking requests to fail to respond or respond, which in turn makes it impossible to accurately calculate the ranking of objects.
[0089] In order to solve the technical problems in the above-mentioned related solutions, the present application provides a method for object processing. The object processing method can be applied to application scenarios for determining object rankings. More specifically, it can be applied to application scenarios for ranking based on blockchain networks. For example, the ranking scenarios include but are not limited to: ranking game players in virtual game scenarios, ranking advertisements in advertising delivery scenarios, etc., which are not specifically limited in this application. In the object processing method of the present application, by storing the number of objects and the index value sequence in the search node of each level of the N-layer cascade in the target tree data structure, and then under the gas resources limited by the gas mechanism, there is no need to re-count the number of other objects ranked in front according to the index value of the object every time, but the target index value of the target object is matched with the index value sequence of the search nodes at different levels in the target tree data structure, and then the number of objects is directly extracted from the corresponding search node, so as to determine the total number of objects ranked before the target object, and then obtain the final ranking of the target object, which greatly reduces the complexity of the calculation and the gas consumption required for ranking, and can quickly and efficiently calculate the ranking of the object, and improve the user's experience in decision-making and expansion under the target business.
[0090] Exemplarily, the object processing method provided in this application may be applicable to one or more of the following application scenarios, as follows:
[0091] 1. Ranking of game players in virtual game scenarios
[0092] For example, a virtual game is a game activity conducted in a virtual environment, which uses computer technology to simulate various scenes, roles and rules to provide gamers with an immersive gaming experience. In a virtual game scene, the ranking of gamers is an important and attractive feature, which can intuitively display the strength and achievements of gamers and allow gamers to continue to pay attention to their game progress and performance. For example, Figure 1A The figure shows a ranking diagram of the present application scheme applied in a virtual game scene. Figure 1A As shown, in a certain XXX game, there may be players such as player 1, player 2, player 3, player 4, and player 5. It can be assumed that the target object to be searched is player 1, and its index value can be represented by the game score of player 1 in the game, such as 80 points. By matching the index value of player 1 (i.e., 80 points) with the index value sequence of search nodes at different levels in the target tree data structure of the present application, the number of objects (e.g., playercount=2) can be extracted from the corresponding search node. For example, it can be determined that the number of objects arranged before player 1 is 2 (e.g., player 2 and player 4), and thus it can be determined that the ranking of player 1 is 3rd.
[0093] Compared with the related schemes that need to calculate the index values of player 1 and other players (i.e., player 2 to player 5) in turn, this application does not need to care about the index values of player 2 and player 4. The ranking of player 1 can be determined by extracting the number of objects, which greatly reduces the complexity of calculation and gas consumption, and can quickly and efficiently calculate the ranking of game player 1. It not only stimulates the players' desire to compete, increases their dependence and loyalty to virtual games, but also promotes social interaction between players.
[0094] (II) Ranking of advertisements in advertising scenarios
[0095] For example, an advertising delivery scenario refers to the specific environment and context in which an advertisement is displayed and communicated to a target audience, and its types include online advertising delivery scenarios and offline advertising delivery scenarios. In an advertising delivery scenario, by ranking advertisements, it is possible to increase the exposure rate of the advertisements and achieve higher click-through rates and conversion rates. For example, Figure 1B The following is a schematic diagram showing the ranking of the present application scheme in the advertising delivery scenario. Figure 1B As shown, in the advertising delivery scenario, advertisements such as advertisement 1, advertisement 2, advertisement 3, advertisement 4, and advertisement 5 may be included. Assuming that the target object to be searched is advertisement 1, its index value can be represented by the bid of advertisement 1, for example, 108 yuan. By matching the index value of advertisement 1 (i.e., 108 yuan) with the index value sequence of search nodes at different levels in the target tree data structure of the present application, the number of objects (e.g., playercount=3) can be extracted from the corresponding search node. For example, it can be determined that the number of objects arranged before advertisement 1 is 3 (e.g., advertisement 2, advertisement 4, and advertisement 5), thereby determining that the ranking of advertisement 1 is 4th.
[0096] Compared with the related solutions that need to calculate the index values of Advertisement 1 and the remaining advertisements (i.e. Advertisement 2 to Advertisement 5) in turn, this application does not need to care about the index values of Advertisement 2, Advertisement 4 and Advertisement 5. The ranking of Advertisement 1 can be clarified by extracting the number of objects, which greatly reduces the complexity of the calculation and gas consumption, and can quickly and efficiently calculate the ranking of Advertisement 1, which is conducive to more accurately positioning the target audience through the ranking of Advertisement 1, avoiding ineffective delivery and waste of resources, and improving the efficiency and effectiveness of advertising delivery.
[0097] (III) Ranking of products in shopping scenarios
[0098] For example, shopping scenarios refer to the specific environment and context in which consumers conduct purchase and consumption activities, including online shopping scenarios and offline shopping scenarios. In shopping scenarios, by ranking products, merchants can increase product exposure, achieve higher click-through rates and conversion rates, and also help shopping platforms improve user experience. For example, Figure 1C The following is a schematic diagram showing the ranking of the present application scheme in a shopping scenario. Figure 1C As shown, in the shopping scene, goods such as goods 1, goods 2, goods 3, goods 4, and goods 5 may be included. Assuming that the target object to be searched is goods 2, its index value can be represented by the price of goods 2, for example, 98 yuan. By matching the index value of the goods 2 (i.e., 98 yuan) with the index value sequence of the search nodes at different levels in the target tree data structure of the present application, the number of objects (e.g., playercount=1) can be extracted from the corresponding search node. For example, it can be determined that the number of objects arranged before the goods 2 is 1 (e.g., goods 3), and thus it can be determined that the ranking of the goods 2 is the second.
[0099] Compared with the related solutions that need to calculate the index values of product 2 and other products (i.e., product 1, product 3 to product 5) in turn, this application does not need to care about the index values of product 1, product 3 and product 5. The ranking of product 2 can be clarified by extracting the number of objects, which greatly reduces the complexity of calculation and gas consumption, and can quickly and efficiently calculate the ranking of product 2, and then expose product 2 in order through its ranking, which can enable consumers to quickly find high-quality products that meet their needs and improve consumers' shopping experience and satisfaction.
[0100] It should be noted that the object processing method of this application can be applied to the above-mentioned scenarios such as ranking of game players in virtual game scenarios, ranking of advertisements in advertising scenarios, and ranking of goods in shopping scenarios. In actual applications, it can also be applied to other ranking scenarios. For example, it can also be applied to the ranking of content in social media scenarios, the ranking of search results in search scenarios, the ranking of film and television works or music works in entertainment scenarios, etc., which are not specifically limited in this application.
[0101] For example, the method provided in this application can be applied to Figure 2 In the implementation environment shown, the object processing device 100 is used to perform operations. Figure 2 In the implementation environment shown, it includes an object processing device 100 and also includes, for example, a user terminal 200 and the like.
[0102] from Figure 2It can be seen that in step S1, when the user needs to know the ranking of the target object in the target business, the user can input the pending request into the user terminal 200. The pending request includes the target index value and the first identifier of the target object. In step S2, after obtaining the pending request, the user terminal 200 sends the pending request to the object processing device 100. Therefore, for the object processing device 100, it can execute the following steps S3 to S7 to determine the final ranking of the target object, as follows:
[0103] In step S3, the object processing device 100 first obtains the request to be processed and the target tree data structure. Through the target tree data structure, the N-layer cascade search nodes can be understood. In the search nodes of each level, the corresponding index value sequence and the number of objects are included. The index value sequence can reflect the ranking of the index values of multiple candidate objects, and the number of objects reflects the number of multiple candidate objects. In step S4, the object processing device 100 traverses the target tree data structure and determines the target search node from the N-layer cascade search nodes according to the target index value. In this way, in step S5, the object processing device 100 determines the first object number based on the target index value, the index value sequence of the target search node and the number of objects of the target search node, and determines the second object number based on the target index value, the first identifier, the index value sequence of the target search node and the number of objects of the target search node. In step S6, the object processing device 100 can determine the target ranking of the target object based on the first object number and the second object number.
[0104] Optionally, in Figure 2 The illustrated implementation environment may further include step S7. That is, in step S7, the object processing device 100 may also send the target ranking of the target object to the user terminal 200, and then the user terminal 200 may display the target ranking of the target object through the client, engine or other visual interface in step S8, so as to provide the target ranking to the user for viewing, so as to timely understand the ranking of the target object, thereby completing the implementation of subsequent business logic such as ranking list.
[0105] It should be noted that the above Figure 2 The target tree data structure described in the above may include, but is not limited to, a B+ tree structure, a red-black tree structure, a B tree structure, etc., which is not specifically limited in this application. Figure 5 The solution of this application is illustrated by taking the B+ tree structure as an example.
[0106] Optionally, the object processing device 100 and the user terminal 200 mentioned above may be block nodes in a blockchain network. By applying the object processing method of the present application to the scenario of a blockchain network, the logic of each operation can be run in a smart contract in the blockchain network, so that both the user terminal 200 and the object processing device 100 can call the smart contract to participate in the business.
[0107] For example, taking the scenario of achieving ranking in a virtual game through a blockchain network, Figure 3 A schematic diagram of another implementation environment provided by the present application is shown. Figure 3 In the blockchain network shown, it includes block nodes such as block node 1, block node 2, and block node 3, and also includes different blocks for storing data, such as block 1, block 2, and block 3. Game player 1 calls the smart contract through block node 1 and uploads the corresponding indicator value 1 and identifier 1 to block 1 in the blockchain network. Game player 2 calls the smart contract through block node 2 and uploads the corresponding indicator value 2 and identifier 2 to block 2 in the blockchain network. Subsequently, block node 3 can extract the indicator value 1 and identifier 1 of game player 1 from block 1, extract the indicator value 2 and identifier 2 of game player 2 from block 2, and execute the above smart contract. Figure 4 Steps S3 to S6 in the above process are performed to obtain the ranking of game player 1 and the ranking of game player 2. Optionally, block node 3 stores the ranking of game player 1, the ranking of game player 2, etc. in block 3.
[0108] Need to explain, Figure 3 The block node 3 in can be understood as Figure 2 The object processing device 100, block node 1, block node 2 can also be understood as Figure 2 The user terminal 200 in the example will not be described in detail here. In addition, the virtual game mentioned in this application can be a full-chain game or a non-full-chain game. The full-chain game described here refers to a game in which all game logic is run in the form of a smart contract.
[0109] In addition, the object processing device 100 includes but is not limited to terminal devices, servers, etc. For example, the terminal device and the user terminal 200 include but are not limited to mobile phones, tablet computers, laptops, desktop computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, wearable devices, etc. Among them, the client is deployed on the terminal device, and the client can be run on the terminal device in the form of a browser, or in the form of an independent application (application, APP), etc. For example, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence (AI) platforms.
[0110] Combined with the above introduction, the following will introduce the method of object processing in this application. Figure 4 The object processing method in the embodiment of the present application can be performed by the above Figure 2 The object processing device 100 shown in FIG. 1 is used as an execution subject to complete the object processing method provided by the present application, which includes at least the following steps 401 to 405, namely:
[0111] 401. Obtain a pending request, where the pending request includes a target indicator value and a first identifier.
[0112] In one or more embodiments, when a user needs to know the ranking of a target object in a target business, the target index value and the first identifier of the target object can be mapped to a pending request, and then the pending request can be uploaded to a user terminal. After obtaining the pending request, the user terminal transmits the pending request to an object processing device via a communication network. In this way, the object processing device can obtain the pending request, and then obtain the target index value and the first identifier of the corresponding target object from the pending request.
[0113] It should be noted that the target indicator value can be used to evaluate the ranking of the target object in the target business.
[0114] For example, the aforementioned Figure 1ATaking the virtual game business shown in as an example, the target object may be a virtual player, game props, etc. in the virtual game business. The target indicator values corresponding to the game player include, but are not limited to: the game score, game currency, game experience value, number of game props, game reward points, etc. of the game player. The target indicator values corresponding to the game props include, but are not limited to: prop click rate, prop number, prop attack performance value, etc.
[0115] Or, with the aforementioned Figure 1B Taking the advertising delivery business shown in as an example, the target object may be an advertisement in the advertising delivery business, and its corresponding target indicator value may include but is not limited to: an advertisement bid, an advertisement quality score, an advertisement budget value, etc.
[0116] Or, with the aforementioned Figure 1C Taking the shopping business shown in as an example, the target object may be the goods, shopping platforms, etc. in the shopping business. Among them, the target indicator values corresponding to the goods include, but are not limited to: the price, sales volume, page views, average stay time, click-through rate, number of reviews, number of favorites, etc. of the goods. The target indicator values corresponding to the shopping platform may include, but are not limited to, the number of product types, user ratings of the platform, etc.
[0117] In addition, the first identifier mentioned in this application can be used to identify the target object. Optionally, the first identifier includes but is not limited to an identifier of the target object, such as a public key address (address), or other identity identifiers.
[0118] 402. Obtain a target tree data structure, where the target tree data structure includes N layers of cascaded search nodes. The search nodes at each layer include an index value sequence and a number of objects. The index value sequence is used to represent the order of index values of multiple candidate objects, and the number of objects is used to represent the number of multiple candidate objects. N is a positive integer.
[0119] In one or more embodiments, the target tree data structure includes but is not limited to a B+ tree, a red-black tree, or a B-tree data structure. Different from a traditional tree data structure, the target tree data structure in the present application includes N layers of cascaded search nodes, and in each layer of the search node, it includes not only an index value sequence, but also the number of objects.
[0120] In addition, in the target tree data structure of the present application, the N-layer cascaded search nodes include the first search nodes of the first N-1 layers of cascades, and one or more second search nodes cascaded with the first search nodes of the N-1th layer. For the first search nodes of the first N-1 layers of cascades, the number of objects in the first search node of the i-th layer is the same as the number of objects in all the first search nodes of the cascaded i+1th layer, and the index value sequence of the first search node of the i-th layer includes multiple first index values, and the numerical interval between each two adjacent first index values corresponds to the index value sequence of the first search node of the cascaded i+1th layer. Among them, 1≤i<N, i is an integer. That is to say, in the first search node of each layer, the index value sequence used to characterize the index value ranking of multiple candidate objects is recorded, and the index value sequence of the first search node of the next layer can be associated through the numerical interval between each two adjacent index values in the index value sequence. In addition, in the first search node of each layer, the number of objects in all the first search nodes of the next layer associated with the first search node is also recorded.
[0121] In addition, for each numerical interval in the first search node of the N-1th level, it contains an index value sequence of a second search node. Moreover, in the index value sequence of each second search node, one or more second index values are included. That is to say, in the last layer of the first search node (i.e., the first search node of the N-1th level), one or more second search nodes are also associated. If one or more second search nodes are cascaded with the same first search node in the N-1th level, at this time, the index value sequences of the one or more second search nodes together constitute the index value sequence of the same cascaded first search node, and the index value sequence of each second search node is included in a numerical interval in the index value sequence of the same cascaded first search node. In addition, the sum of the number of objects of all second search nodes is the same as the number of objects of the cascaded first search node of the N-1th level.
[0122] In addition, in the target tree data structure, the target tree data structure also includes: one or more third search nodes cascaded with the second search node and a fourth search node cascaded with each third search node. In each third search node, an index value and the number of objects are included. Moreover, the index values of all third search nodes constitute the index value sequence of the second search node. In the fourth search node, it includes an object identification list. The object identification list includes one or more object identifications, and each object identification is used to identify a candidate object.
[0123] For example, Figure 5 A schematic diagram of the target tree data structure provided by the present application is shown. Figure 5As shown, taking N=4 as an example, the target tree data structure includes 4 levels of cascaded search nodes. Specifically, it includes the first search nodes of the first 3 levels of cascades, and the second search nodes of the 4th level. For the first search nodes of the first 3 levels of cascades, it includes the first search node of the 1st level, the first search node of the 2nd level, and the first search node of the 3rd level. The first search node of the 1st level is cascaded with the first search node of the 2nd level, the first search node of the 2nd level is cascaded with the first search node of the 3rd level, and the first search node of the 3rd level is cascaded with the second search node. In other words, the first search node of the 1st level, the first search node of the 2nd level, the first search node of the 3rd level and the second search node are cascaded in sequence.
[0124] Among them, the first search node of the first level is usually called the root node, and is also recorded as search node A1 in this application. In the search node A1, the number of objects (playercount) A1 is recorded, such as (playercount: 60). In addition, the indicator value sequence A1 is recorded, such as {...., 80,..., 40....}. In the indicator value sequence A1, at least 3 numerical intervals are included, namely (0, 40), [40, 80), [80, ∞).
[0125] The first search node of the second level cascaded with the first search node of the first level may include three search nodes, such as search node A2, search node A3, and search node A4. In search node A2, the number of objects A2 (such as playercount: 50) is recorded, and the index value sequence A2 is also recorded, such as {....110,...,85....}, and the index value sequence A2 corresponds to the numerical interval (i.e. [80,∞)) when the index value in the index value sequence A1 is greater than or equal to 80. In addition, the index value sequence A2 also includes at least 3 numerical intervals, namely [80,85), [85,110), and [110,∞). In addition, in search node A3, the number of objects A3 (such as playercount: 8) is recorded, and the index value sequence A3 is also recorded, such as {....75,...,60....}, which corresponds to the numerical interval when the index value in index value sequence A1 is less than 80 and greater than or equal to 40 (i.e. [40,80)). Similarly, in search node A4, the number of objects A4 (such as playercount: 2) is recorded, and the index value sequence A4 is also recorded, such as {....30,...,20....}, which corresponds to the numerical interval when the index value in index value sequence A1 is less than 40 (i.e. (0,40)).
[0126] In the first search node of the third level cascaded with the first search node of the second level, for example, taking search node A2 as an example, the search node A2 can be cascaded with three first search nodes of the third level, namely, search node A5, search node A6 and search node A7 respectively. In search node A5, the number of objects A5 (such as playercount: 5) is recorded, and the index value sequence A5 is also recorded, such as {....130,...,120....}, and the index value sequence A5 corresponds to the numerical interval when the index value in the index value sequence A2 is greater than or equal to 110 (i.e. [110,∞)). In search node A6, the number of objects A6 (such as playercount: 40) is recorded, and the index value sequence A6 is also recorded, such as {....100,...,90,....}, and the index value sequence A6 corresponds to the numerical interval when the index value in the index value sequence A2 is less than 110 and greater than or equal to 85 (i.e. [85,110)). In addition, the index value sequence A6 also includes at least 3 value intervals, namely [85, 90), [90, 100), and [100, 110). Similarly, in the search node A7, the object number A7 (such as playercount: 5) is recorded, and the index value sequence A7 is also recorded, such as {....70,...,60....}. The index value sequence A7 corresponds to the value interval when the index value in the index value sequence A2 is less than 85 (i.e. [80, 85)).
[0127] In the second search node cascaded with the first search node of the third level, for example, taking search node A6 as an example, the search node A6 can be cascaded with three second search nodes, namely, search node A11, search node A8, search node A9 and search node A10. In search node A11, the number of objects A11 (such as playercount: 6) is recorded, and the index value sequence A11 is also recorded, such as {105, 104}, and the index value sequence A11 is included in the numerical interval when the index value is greater than or equal to 100 in the index value sequence A6. In search node A8, the number of objects A8 (such as playercount: 4) is recorded, and the index value sequence A8 is also recorded, such as {103, 102, 101}, and the index value sequence A8 is also included in the numerical interval when the index value is greater than 100 in the index value sequence A6. In search node A9, the number of objects A9 (such as playercount: 20) is recorded, and the index value sequence A9 is also recorded, such as {99, 95, 92}, which is included in the numerical interval when the index value in index value sequence A6 is less than 100 and greater than or equal to 90. Similarly, in search node A10, the number of objects A10 (such as playercount: 10) is recorded, and the index value sequence A10 is also recorded, such as {89, 84, 81}, which is included in the numerical interval when the index value in index value sequence A6 is less than 90.
[0128] In addition, in the present application, each second search node can also be cascaded with one or more third search nodes. For example, taking search node A9 as an example, it can be associated with three third search nodes, such as search node B1, search node B2, and search node B3. Taking search node B1 as an example, the search node B1 includes an index value (such as: 99) and an object quantity B1 (such as playercount: 12). The object quantity B1 can indicate that the total number of objects when the index value is 99 is 12.
[0129] In addition, each third search node can also be cascaded with a fourth search node. The fourth search node records the same number of object identifiers as the objects in the associated third search node. Optionally, these object identifiers can be recorded in the same fourth search node or in multiple different fourth search nodes, which is not specifically limited in the present application. For example, taking the search node B1 as an example, the search node B1 can be associated with multiple fourth search nodes, such as search node C1, search node C2, and search node C3. In addition, 4 object identifiers are recorded in the search node C1, such as id1 to id4; 4 object identifiers are also recorded in the search node C2, such as id5 to id8; and 4 object identifiers are also recorded in the search node C3, such as id9 to id12.
[0130] It should be noted that each object identifier in this application can identify a candidate object, for example, id1 can identify candidate object 1. It should be noted that the id described here can also be understood as the aforementioned public key address.
[0131] It should be noted that for the search nodes in other search branches, their respective recorded contents can also be understood by referring to the branches: search node A1-->search node A2-->search node A6-->search node A9-->search node B1-->search node C1 to search node C3, which will not be repeated here.
[0132] In addition, the above Figure 5 The target tree data structure shown in FIG. 1 shows a sequence of index values recorded in each search node, and the order of the index values is only illustrated in descending order. In practical applications, the order can also be arranged in ascending order (such as in the following example). Figure 8 The structure shown in the figure) or other customized arrangement methods are used for sorting, which is not specifically limited in this application.
[0133] In addition, the above Figure 5 The target tree data structure shown in the figure is only illustrated by taking the first search node including 4 levels as an example. In practical applications, the value of N can be a positive integer, that is, the value of N can also be 1, 5, 8, etc., which is not specifically limited in this application.
[0134] 403. Traverse the target tree data structure and determine the target search node from the N-layer cascaded search nodes based on the target index value.
[0135] In one or more embodiments, after obtaining the target tree data structure, it is necessary to traverse from the first search node of the first level to the second search node according to the target index value to determine the target search node from the N-level cascaded search nodes. It is understandable that the target search node is one of the second search nodes.
[0136] Through the target search node, we can understand the leaf node where the target index value is located in the entire target tree data structure, and then through the cascade relationship between the nodes, we can locate the corresponding third search node and fourth search node, thereby obtaining the number of objects in the third search node and the object identification list in the fourth search node.
[0137] It should be noted that the target tree data structure mentioned here can refer to the aforementioned Figure 5 The structure shown or the subsequent Figure 8 The structure shown in Figure 1 is understood.
[0138] 404. Determine the first number of objects based on the target index value, the index value sequence of the target search node and the number of objects of the target search node, and determine the second number of objects based on the target index value, the first identifier, the index value sequence of the target search node and the number of objects of the target search node, wherein the index value of each candidate object corresponding to the first number of objects is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value.
[0139] In one or more embodiments, after determining the target search node, the index value sequence and the number of objects in the target search node can also be extracted, and then the first number of objects can be determined in combination with the target index value. For example, the target index value is first compared with each index value in the index value sequence of the target search node. If the target index value is greater than or equal to the minimum index value in the index value sequence of the target search node and less than the maximum index value in the index value sequence, then the corresponding number of objects can be extracted from other sibling nodes or parent nodes of the target search node. That is, the number of objects is obtained from other sibling nodes or parent nodes corresponding to the index value sequence greater than the target search node, and then the first number of objects is obtained. It should be noted that the index value of each candidate object corresponding to the first number of objects is greater than the target index value.
[0140] In addition, it is also necessary to determine the second object quantity based on the target index value, the first identifier, the index value sequence of the target search node, and the number of objects of the target search node. For example, the target index value is compared with each index value in the index value sequence of the target search node. If the target index value is less than the maximum index value in the index value sequence of the target search node and is greater than or equal to the minimum index value in the index value sequence, it is necessary to further determine whether the target object exists in the object identifier list of the fourth search node associated with the target search node based on the first identifier. If the first identifier matches any object identifier in the object identifier list of the fourth search node, the number of objects in the target search node that is greater than the target index value can be counted to obtain the second object quantity. It should be noted that the index value of each candidate object corresponding to the second object quantity is greater than the target index value.
[0141] 405. Determine a target ranking of the target object based on the first object quantity and the second object quantity.
[0142] In one or more embodiments, the number of objects that are locally arranged before the target object in other search nodes can be known through the first object number. The number of second objects can also reflect the number of objects that are locally arranged before the target object in the same target search node. Based on this, after calculating the first object number and the second object number, the target ranking of the target object can be determined using the first object number and the second object number.
[0143] In some optional examples, in the process of determining the target ranking of the target object based on the first object number and the second object number, the first local ranking of the target object can be determined based on the first object number, and the second local ranking of the target object can be determined based on the second object number. It should be noted that the first local ranking can represent the number of objects that are arranged before the target object in other search nodes. The second local ranking can represent the number of objects that are arranged before the target object in the target search node. In this way, after obtaining the first local ranking and the second local ranking, the target ranking of the target object is calculated based on the first local ranking and the second local ranking.
[0144] As an illustrative description, the first ranking is obtained by calculating the sum of the first local ranking and the second local ranking. It should be noted that the first ranking can reflect the total number of objects that are ranked before the target object. Then, after the first ranking is obtained, the next ranking after the first ranking is used as the target ranking of the target object.
[0145] For example, if the number of first objects is calculated to be 15 and the number of second objects is 0, the first ranking position can be calculated to be 15+0=15. Therefore, the target ranking is 15+1=16, that is, the target object is ranked 16th.
[0146] In the embodiment of the present application, it is possible to use the gas resources limited by the gas mechanism without having to re-count the number of other objects ranked in front according to the index value of the object each time. Instead, the target index value of the target object is matched with the index value sequence of the first search node at different levels in the target tree data structure, and then the number of objects is directly extracted from the corresponding search node to determine the total number of objects ranked before the target object, and then the final ranking of the target object is obtained, which greatly reduces the complexity of the calculation and the gas consumption required for ranking, and can quickly and efficiently calculate the ranking of the object, thereby improving the user's decision-making and expansion experience under the target business.
[0147] In addition, when an object in the target tree data structure changes, the target ranking of the target object can be quickly re-determined by simply updating the number of objects recorded in each node. The implementation method is more flexible and easy to adapt to different object changes.
[0148] In some other optional embodiments, the specific process of determining the target search node in step 403 can refer to the following Figure 6 The flowchart shown is as follows:
[0149] S4031. Traverse the first search node of the i-th level. When the target index value is included in the first numerical interval in the index value sequence of the first search node of the i-th level, determine the first search node of the i+1th level associated with the first numerical interval as the first child node, and the minimum value of the first numerical interval is less than or equal to the target index value, and the maximum value is greater than the target index value.
[0150] S4032. Repeat step S4031 until the first search node of the N-1th layer is traversed, and when the target index value matches the second index value in the index value sequence of the cascaded second search node, determine that the second search node corresponding to the index value match is the target search node.
[0151] In one or more embodiments, since there is a cascade relationship between the first search nodes of each two adjacent levels, and from the aforementioned Figure 5 It can be seen from the shown content that the number of objects in the first search node of the i-th level is the same as the number of objects in all the first search nodes of the cascaded i+1-th level, and the index value sequence of the first search node of the i-th level includes multiple index values, and the numerical interval between every two adjacent index values corresponds to the index value sequence of the first search node of the cascaded i+1-th level.
[0152] Then, in the process of determining the target search node where the target object is located, the first search node of the i-th level can be traversed first, and the target index value can be compared with multiple first index values in the index value sequence of the first search node of the i-th level. Through comparison, if the target index value is included in the first numerical interval in the index value sequence of the first search node of the i-th level, that is, when the target index value is less than the maximum value of the first numerical interval in the first search node of the i-th level and greater than or equal to the minimum value of the first numerical interval, the first search node of the i+1th level associated with the first numerical interval can be determined as the first child node.
[0153] Thus, the first child node is further traversed by comparing the target index value with a plurality of first index values in the index value sequence of the first search node of the i+1th level. By comparison, if the target index value is included in a certain first numerical interval in the index value sequence of the first search node of the i+1th level, that is, when the target index value is less than the maximum value of any numerical interval in the first search node of the i+1th level and greater than or equal to the minimum value of any numerical interval, the first search node of the i+2th level associated with any numerical interval is further traversed.
[0154] And so on, until the first search node of the N-1th level is traversed. For the first search node of the N-1th level, since the first search node of the N-1th level is cascaded with one or more second search nodes, at this time, through index value matching, if the target index value matches the second index value in the index value sequence of any second search node cascaded by the first search node of the N-1th level, then the second search node corresponding to the index value matching can be used as the target search node.
[0155] For example, the above Figure 5 The target tree data structure and the target index value "99" are taken as an example to describe how to determine the target search node.
[0156] First, traverse the search node A1, and by comparing the target index value (i.e. "99") with the index value sequence A1 {....,80,...,40....}, it can be seen that 99>80, thus jumping to the first search node of the second level corresponding to the numerical interval [80,∞) in the search node A1, that is, jumping to the search node A2.
[0157] Further, by traversing the search node A2, by comparing the target index value (i.e. "99") with the index value sequence A2 {....110,...,85....}, it can be seen that 99>85 and 99<110, thus jumping to the first search node of the third level corresponding to the numerical interval [85,110) in the search node A2, that is, jumping to the search node A6.
[0158] Further, by traversing the search node A6, by comparing the target index value (i.e. "99") with the index value sequence A6 {....100,...,90,....}, it can be seen that 99>90 and 99<100, thus jumping to the second search node corresponding to the numerical interval [90,100) in the search node A6, that is, jumping to the search node A9.
[0159] By analogy, traversing the search node A9, by matching the target index value (i.e., "99") with the index value sequence A9 {99, 95, 92}, it can be known that the target index value "99" matches the index value "99" in the index value sequence A9. Therefore, the second search node (i.e., search node A9) where the index value "99" is located is used as the target search node corresponding to the target index value "99".
[0160] By using the above-mentioned traversal method to determine the target search node, it is only necessary to judge whether the target index value is included in the numerical range of the first search node and whether it matches the index value of the second search node. There is no need to use the index value for one-to-one comparison. This can improve the efficiency of searching and locating the target search node, and provide conditions for the subsequent process of extracting the number of objects, thereby promoting the accuracy of subsequent object number extraction.
[0161] In some other optional embodiments, in the above Figure 4 and Figure 6 Based on the described embodiment, the specific process of determining the number of the first objects in step 404 can refer to the following: Figure 7 The flowchart shown is as follows:
[0162] S4041, determining a second child node at the same level as the target search node, wherein each index value in the index value sequence of the second child node is greater than the index value in the index value sequence of the target search node;
[0163] In one or more embodiments, the second child node at the same level as the target search node can be understood as a sibling node at the same level as the target search node and that meets the conditions. It should be noted that the sibling node that meets the conditions mentioned here can be understood as: each index value of the index value sequence of the sibling node is greater than the index value of the index value sequence of the target search node.
[0164] For example, the above Figure 5 The target tree data structure shown above Figure 6Taking the determined target search node as search node A9 as an example, at this time, it can be determined that the brother nodes at the same level as search node A9 include: search node A8, search node A10 and search node A11. Further, by comparing the index value sequence A9 of search node A9 with the index value sequence A11 of search node A11, the index value sequence A8 of search node A8, and the index value sequence A10 of search node A10, it can be known that only each index value in the index value sequence of search node A11 and search node A8 is greater than the index value in the index value sequence of search node A9. Therefore, it can be determined that the brother nodes at the same level as the search node A9 and that meet the conditions are: search node A8 and search node A11. That is, the second child nodes at the same level as search node A9 are search node A8 and search node A11.
[0165] It should be noted that the index value sequence A8, index value sequence A9, index value sequence A10, index value sequence A11, etc. mentioned here can refer to the aforementioned Figure 5 The contents of the target tree data structure in the figure can be understood, and no further explanation is given here.
[0166] S4042. Determine a fourth child node at the same level as the third child node, the third child node includes the first search node of each level in the first N-1 levels cascaded with the target search node, and each index value in the index value sequence of the fourth child node is greater than the index value in the index value sequence of the third child node at the same level.
[0167] In one or more embodiments, the third child node includes the first search node of each level in the first N-1 levels cascaded with the target search node. Specifically, it can be understood that the third child node includes: the parent node of the target search node, and the parent nodes of other levels corresponding to the parent node. Thus, the fourth child node at the same level as the third child node can be understood as a brother node at the same level as the parent node and that meets the conditions. More specifically, each index value in the index value sequence of the fourth child node is greater than the index value in the index value sequence of the third child node at the same level.
[0168] For example, the above Figure 5Taking the target tree data structure shown and the target search node as search node A9 as an example, at this time, through the cascade relationship between nodes, it can be determined that the parent node of search node A9 is search node A6 (i.e., the third child node). Subsequently, through the cascade relationship between nodes, the brother nodes at the same level as the parent node (i.e., search node A6) can also be determined, including: search node A5 and search node A7. Further, by comparing the index value sequence A6 of search node A6 with the index value sequence A5 of search node A5 and the index value sequence A7 of search node A7, it can be known that only each index value in the index value sequence A5 of search node A5 is greater than the index value in the index value sequence A6 of search node A6.
[0169] Similarly, through the cascade relationship between nodes, it is also possible to determine that the parent node of the parent node of search node A9 (i.e., search node A6) is search node A2. Further, through the cascade relationship between nodes, it is possible to determine that the brother nodes at the same level as the parent node, which is search node A2, include: search node A3 and search node A4. Subsequently, the index value sequence A2 of search node A2 is compared with the index value sequence A3 of search node A3 and the index value sequence A4 of search node A4, respectively. It can be seen that no index value sequence of the search node meets the conditions, that is, the index value sequences of search nodes A3 and search node A4 are not greater than the index value in the index value sequence A2 of search node A2.
[0170] Thus, it can be determined that the search node that is at the same level as the search node A6 and meets the conditions is the search node A5. That is, the fourth child node at the same level as the search node A6 (ie, the third child node) is the search node A5.
[0171] It should be noted that the index value sequence A5, index value sequence A6, index value sequence A7, etc. mentioned here can refer to the aforementioned Figure 5 The contents of the target tree data structure in the figure can be understood, and no further explanation is given here.
[0172] S4043, extracting the number of objects of the second sub-node and the number of objects of the fourth sub-node of each level.
[0173] In one or more embodiments, after the second sub-node is determined, the number of objects recorded in the second sub-node can be extracted from the second sub-node. For example, taking the target search node as search node A9, the second sub-nodes determined are search node A8 and search node A11. By summing the number of objects A8 (i.e., "4") recorded in search node A8 and the number of objects A11 (i.e., "6") recorded in search node A11, the number of objects of all second sub-nodes can be obtained to be 10.
[0174] Similarly, after determining the fourth sub-node of each level, the number of objects recorded in the fourth sub-node of the corresponding level can be extracted from the fourth sub-node of each level. For example, taking the target search node as search node A9, the determined fourth sub-node is search node A5, and the corresponding object number A5 is 5.
[0175] S4044: Calculate the number of objects in the second child node and the sum of the number of objects in the fourth child nodes of all levels to obtain the first number of objects.
[0176] In one or more embodiments, after extracting the number of objects of the second sub-node and the number of objects of the fourth sub-nodes of all levels, the first number of objects can be obtained by calculating the sum of the number of objects of the second sub-node and the number of objects of the fourth sub-nodes of all levels.
[0177] For example, taking the target search node as search node A9, its second child nodes are search node A8 and search node A11, and its fourth child node is search node A5. After calculation, the number of first objects is 10+5=15.
[0178] In other optional embodiments, in the target tree data structure provided by the present application, in the first search node of the N-layer cascade, the index value sequence of the first search node of each level can be arranged in descending order or in ascending order.
[0179] For example, the aforementioned Figure 5 Taking the target tree data structure shown in the figure as an example, the index value sequence of the search nodes at each level is arranged in descending order. Figure 5 For example, for the first search node of the second level, it includes search node A2, search node A3, and search node A4. Among them, the index value in the index value sequence A2 of the search node A2 is greater than the index value in the index value sequence A3 of the search node A3. In addition, the index value in the index value sequence A3 of the search node A3 is greater than the index value in the index value sequence A4 of the search node A4.
[0180] Similarly, for the first search node of the third level, it includes search node A5, search node A6, and search node A7. Among them, the index value in the index value sequence A5 of the search node A5 is greater than the index value in the index value sequence A6 of the search node A6. In addition, the index value in the index value sequence A6 of the search node A6 is greater than the index value in the index value sequence A7 of the search node A7.
[0181] Similarly, for the second search node, it includes search node A11, search node A8, search node A9, and search node A10. Among them, the index values in the index value sequence A11 of the search node A11 are all greater than the index values in the index value sequence A8 of the search node A8. The index values in the index value sequence A8 of the search node A8 are all greater than the index values in the index value sequence A9 of the search node A9. In addition, the index values in the index value sequence A9 of the search node A9 are all greater than the index values in the index value sequence A10 of the search node A10.
[0182] It should be noted that for the case of arranging in ascending order, it can also be understood accordingly by referring to the indicator value sequence in descending order, and this application will not go into details.
[0183] Optionally, in combination with the above description, in the above Figure 7 On the basis of the described embodiment, in the N-layer cascade search node, when the index value sequence of the search node of each level is arranged in descending order, the brother node arranged on the left side of the target search node can be directly determined as the second child node at the same level as the target search node. Through the above descending arrangement, the second child node at the same level as the target search node can be quickly and accurately located, which not only improves the processing efficiency, but also reduces the number of unnecessary traversals and reduces the possibility of positioning errors.
[0184] For example, the aforementioned Figure 5 For example, if the target search node is search node A9, search node A8 and search node A11 can be directly determined as the second child nodes at the same level as the target search node.
[0185] Optionally, in combination with the above description, in the above Figure 7 On the basis of the described embodiment, in the N-layer cascade search nodes, when the index value sequence of the search nodes at each level is arranged in ascending order, the brother node arranged on the right side of the target search node can be directly determined as the second child node at the same level as the target search node. Through the above-mentioned ascending arrangement method, the second child node at the same level as the target search node can be quickly and accurately located, which not only improves processing efficiency, but also reduces unnecessary traversal times and reduces the possibility of positioning errors.
[0186] For example, Figure 8 Another schematic diagram of the target tree data structure provided by the present application is shown. Figure 8As shown, taking N=2 as an example, the target tree data structure includes the first search node of the first 2 cascades and the second search node of the third cascade. The first search node of the first 2 cascades includes, for example, the first search node of the first level and the first search node of the second level.
[0187] Among them, for Figure 8 The first search node of the first level in is sometimes called the root node, and is also recorded as search node D1 in this application. In the search node D1, the number of objects (playercount) D1 is recorded, such as (playercount: 32). In addition, the indicator value sequence D1 is also recorded, such as {...., 40,..., 80....}. For the indicator value sequence D1, it also includes at least 3 value intervals, such as (0, 40), [40, 80), [80, ∞).
[0188] The first search node of the second level cascaded with the first search node of the first level may include three search nodes, such as search node D2, search node D3, and search node D4. In search node D2, the number of objects D2 (such as playercount: 10) is recorded, and the index value sequence D2 is also recorded, such as {....20,...,30....}, and the index value sequence D2 is included in the numerical interval when the index value in the index value sequence D1 is less than 40. In search node D3, the number of objects D3 (such as playercount: 12) is recorded, and the index value sequence D3 is also recorded, such as {....60,...,75....}, and the index value sequence D3 is included in the numerical interval when the index value in the index value sequence D1 is less than 80 and greater than or equal to 40. Similarly, in the search node D4, the object number D4 (such as playercount: 10) is recorded, and the index value sequence D4 is also recorded, such as {....85,...,110....}, and the index value sequence D4 is included in the numerical interval when the index value in the index value sequence D1 is greater than or equal to 80. In addition, the index values in the index value sequence D4 of the search node D4 are all greater than the index values in the index value sequence D3 of the search node D3. In addition, the index values in the index value sequence D3 of the search node D3 are all greater than the index values in the index value sequence D2 of the search node D2.
[0189] In the second search node cascaded with the first search node of the second level, for example, taking the search node D3 as an example, the search node D3 can be cascaded with three second search nodes, namely, with the search node D5, the search node D6 and the search node D7 respectively. In the search node D5, the number of objects D5 (such as playercount: 4) is recorded, and the index value sequence D5 is also recorded, such as {53,54,55}, and the index value sequence D5 is included in the numerical interval when the index value in the index value sequence D3 is less than 60. In the search node D6, the number of objects D6 (such as playercount: 4) is recorded, and the index value sequence D6 is also recorded, such as {72,73,74}, and the index value sequence D6 is included in the numerical interval when the index value in the index value sequence D3 is less than 75 and greater than or equal to 60. Similarly, in the search node D7, the object number D7 (such as playercount: 4) is recorded, and the index value sequence D7 is also recorded, such as {76, 77, 80}, and the index value sequence D7 is included in the numerical interval when the index value in the index value sequence D3 is greater than or equal to 75. In addition, the index values in the index value sequence D7 of the search node D7 are all greater than the index values in the index value sequence D6 of the search node D6. In addition, the index values in the index value sequence D6 of the search node D6 are all greater than the index values in the index value sequence D5 of the search node D5.
[0190] also, Figure 8 In the described target tree data structure, each second search node can also be cascaded with one or more third search nodes. For instance, taking search node D6 as an example, it can be associated with the third search nodes corresponding to the index values "72" to "74". In addition, each third search node can also be cascaded with a fourth search node. The fourth search node records the same number of object identifiers as the associated third search node. For example, the fourth search node associated with the third search node corresponding to the index value "72" includes id 1 and id2, where id1 identifies candidate object 1. For details, please refer to the aforementioned Figure 5 The contents shown in the figure can be understood for reference only and will not be elaborated here.
[0191] Therefore, Figure 8 Taking the structure shown as an example, if the target index value is 74, assuming that the target search node determined after executing step 403 is search node D6, at this time, search node D7 can be directly determined as the second child node at the same level as the target search node.
[0192] Through the above method, by querying the number of objects in the parent node of the target search node or the parent node of the parent node, whether there are other objects arranged before the target object, the local ranking of the level where the target object is located can be determined. This not only can more accurately locate the precise relative position of the target object in the level to which it belongs, but also only needs to pay attention to the number of objects recorded in the sibling nodes in a specific level, without the need for complex sorting and calculation of the entire data structure, making the determination of local ranking easier to implement and maintain.
[0193] In some other optional embodiments, in the above Figure 4 and Figure 6 Based on the described embodiment, the specific process of determining the number of second objects in step 404 can refer to the following: Fig. 9 The flowchart shown is as follows:
[0194] S901. When the target index value matches the index value of any third search node associated with the target search node, the first identifier is matched with the object identifier list in the fourth search node associated with the corresponding third search node.
[0195] In one or more embodiments, from the aforementioned Figure 5 and Figure 8 From the described content, it can be known that the target tree data structure also includes one or more third search nodes cascaded with the second search node, and a fourth search node cascaded with each third search node. Moreover, each third search node includes an index value and the number of objects, and the index values of all third search nodes constitute the index value sequence of the first search node of the Nth level, and the fourth search node includes an object identifier list, and each object identifier in the object identifier list is used to identify a candidate object.
[0196] Then, in the process of determining the number of second objects, the target index value can be first matched with the index value sequence of each third search node associated with the target search node. Subsequently, when determining that the target index value matches any index value, it is also necessary to confirm whether the target object exists in the fourth search node associated with the third search node corresponding to the index value match, so as to clarify whether the target tree data structure stores the target object. Therefore, the first identifier of the target object can be specifically used to match the object identifier list in the fourth search node associated with the third search node corresponding to the same index value.
[0197] For example, Figure 5Taking the target tree data structure shown, the target index value of the target object as "99", and the first identifier as "id3" as an example, it can be seen from the above content that the target search node where the target object is located is the search node A9. It can be seen from the above analysis that the third search node associated with the search node A9 includes: search node B1, search node B2, and search node B3. Among them, after matching the index value, it can be determined that the target index value (i.e., "99") matches the index value of the search node B1. At this time, it is necessary to match the first identifier (i.e., "id3") with the fourth search node cascaded by the search node B1, for example, with the object identifier list in the search node C1, the search node C2, and the search node C3. That is, the first identifier "id3" is matched with id1 to id4 of the search node C1, id5 to id8 of the search node C2, and id9 to id12 of the search node C3, respectively, to determine that "id3" matches "id3" in the search node C1.
[0198] S902. When the first identifier matches any object identifier in the object identifier list in the fourth search node associated with the corresponding third search node, the number of objects in the target search node whose index value is greater than the target index value is counted.
[0199] In one or more examples, when the first identifier matches any object identifier in the object identifier list of the associated fourth search node, it indicates that the target object exists in the target tree data structure. Thus, the index value in the target search node and the target index value are further analyzed, and the number of objects when the index value is greater than the target index value is counted.
[0200] For example, in the example shown in the above step S901, the first identifier "id3" matches "id3" in the search node C1. At this time, it is necessary to compare the index values (i.e., 99, 95, 92) in the target search node A9 with the target index value. It can be seen that the number of objects greater than the target index value 99 is 0.
[0201] S903: The number of objects in the target search node when the index value is greater than the target index value is taken as the second object number.
[0202] In one or more examples, after the number of objects whose index value is greater than the target index value in the target search node, it can be used as the second object number. For example, taking the target index value as "99" as an example, the number of objects greater than the target index value "99" is 0, and at this time it can be determined that the second object number is 0. That is, in the target search node, there is no object arranged before the target object.
[0203] Through the above method, by determining whether there are other objects arranged before the target object in the target search node, the local ranking of the target object in the target search node can be determined, thereby achieving an in-depth understanding of the ranking of the target object in the target search node from a fine-grained perspective without considering the entire data structure, which can significantly reduce the consumption of computing resources and time.
[0204] Optionally, the contents described in the above steps 401 to 405 can also be understood by referring to the following pseudo code. Specifically, in this application, it can also be assumed that the target object is p, the function Data represents the data attribute set of the target object, Data(p) represents all data attributes of the target object p, the function Rank represents the sorting function, and Rank(p) is the target ranking of the target object p. The function Range(p) represents the list of objects in the same segment as the target player p.
[0205] In this application, it is agreed that Data(p)=(id,score), where id represents the identifier of the target object p (i.e., the first identifier in the aforementioned step 401), score represents the target indicator value of the target object p (such as a game score, etc.), and score is a positive integer.
[0206] In this application, Rank(p)=Find(Search(p)) is defined. The Search function finds the leaf node (i.e., the target search node mentioned in step 403) where the target object p is located based on the index generated by the target tree data structure (e.g., B+ tree). In addition, the Find function finds the target object in the object set associated with the target search node, and obtains the number of objects ranked before the target object in the process of searching the leaf nodes and searching in the leaf nodes.
[0207] Moreover, from the aforementioned Figure 5 It can be seen from the described target tree data structure that the index values are recorded in the search nodes of each level. In this application, by using the index values as score pointers, the target search node where the target index value is located can be accessed under O(l) complexity. Moreover, each search node records the number of objects in all leaf nodes under the search node. In this application, the target tree data structure has three types of nodes, namely Root, Branch, and Leaf.
[0208] Among them, the Root node can be understood as Figure 5 The first search node at the first level in the game, whose attributes include: node type (type), number of objects (playercount), score index (indexs), and child node pointer set (pointers).
[0209] Similarly, the Branch node can be understood as Figure 5 The first search node of the second and third levels in the game has the following attributes: node type (type), number of objects (playercount), score index (index), and child node pointer set (pointers).
[0210] In addition, Leaf nodes, sometimes also called scoreList nodes, can be understood as the aforementioned Figure 5 The second search node in , its attributes include: node type (type), number of objects (playercount), score pointer (scores) / pointer to the previous scoreList (prevScoreList), pointer to the next scoreList (nextScoreList), where scores are arranged from large to small according to the indicator value score.
[0211] In this application, the following unified conventions will be used: 1) The * prefix represents a pointer to computer memory. The data object can be obtained through the pointer, and vice versa. 2) An English string starting with a capital letter represents a function or a data object type, for example, Search represents a query function, and Branch represents the data type of a branch node of a tree. 3) The English period (.) represents access to a data attribute under a data object, for example, branch.type represents the type attribute of an object of the Branch type. 4) The remaining symbols follow the conventions of general pseudocode, for example, <- represents assignment, and [] represents obtaining the data object under a specific index of a list.
[0212] Based on this, the pseudo code of the logic implementation of the above-mentioned function Search is as follows:
[0213]
[0214] Among them, *Node represents a pointer to a search node, and Node represents the search node pointed to by pointer *Node. score represents a specific indicator value. The Length function is used to return the size of a list or array.
[0215] In addition, from the pseudo code of the above Search function, we can see that its input parameter is the target index value (score), and there are two returned parameters, namely *Leaf and count. Among them, *Leaf represents a pointer to the Leaf node (i.e., the scoreList node), and count is used to represent the total number of objects whose index values are greater than the maximum index value in the Leaf node.
[0216] In addition, SearchInNode is a recursive function that traverses from the root node of the tree to the search nodes at each level, and in each recursive function, counts the number of all objects in the sibling nodes to the left of the target search node, thereby calculating the total number of objects whose index values are greater than the maximum index value in the target search node, that is, the first object number mentioned in the aforementioned step 404.
[0217] In addition, the score pointer (i.e., the indicator value) itself is a specific and unique pointer, pointing to a score node (Score), which is associated with an object list node (PlayerList). Each object list node has an object pointer set, which points to an object node (Player), which records the object data (such as the object identifier, etc., here is the public key address, recorded as Address). Among them, the data format of the score node (Score), the player list node (PlayerList), and the player node (Player) is defined as follows:
[0218] Score node: can be understood as the aforementioned Figure 5 The third search node in . Its attributes include: index value (value), number of objects (playerCount), object list node pointer (playerList), parent node (scoreList), PlayerList node, which can be understood as the aforementioned Figure 5 The fourth search node in . Its properties include: object identifier list (playerList), next object identifier list pointer (nextPlayerList), previous object identifier list pointer (prevPlayerList)
[0219] The Player node includes: the unique identifier of the object (address), the index value of the object (score), and the object identification list (playerList).
[0220] Based on this, for the Find function mentioned above, its logical implementation pseudo code is as follows:
[0221]
[0222] Among them, the Length function represents the size of a list or array. The logic of the Find function is to traverse all the Scores in the ScoreList node to query the object (Player) corresponding to the first identifier, and count how many objects in the target search node have index values greater than the target object corresponding to the first identifier, so as to calculate the total number of objects in the target search node whose index values are greater than the target index value, that is, the second number of objects mentioned in the aforementioned step 404, so as to determine the local ranking in the target search node where the target object corresponding to the first identifier is located (that is, the aforementioned second local ranking).
[0223] Based on this, through the Search function and Find function mentioned above, the logical implementation pseudo code of its Rank function is as follows:
[0224]
[0225] Among them, the Player function indicates to search for the corresponding Player node according to the first identifier (address), *leaf indicates a pointer to a leaf node, and leaf indicates a leaf node. That is to say, for the Rank function, it can obtain the target index value (score), and use the target tree data structure to find the scoreList node (i.e., the target search node) where the target index value is located, and count the number of objects whose index value is greater than the maximum index value in the scoreList node; and further determine whether the target object exists in the corresponding object identifier list, and then determine the local ranking of the target object by searching the scoreList node.
[0226] Through the above method, compared with the traditional solution of directly re-counting and calculating the ranking of each object, the present application records the number of objects through the nodes in the target tree data structure and quickly queries the number of objects under a certain node through the index, which can greatly reduce the number of objects that need to be directly compared, thereby improving the calculation efficiency of the ranking and the accuracy of the object ranking.
[0227] In some other optional embodiments, in the above Figure 4 , Figure 6 , Figure 7 or Fig. 9 Based on the described embodiments, the object processing method provided by the present application can also determine the index interval matched by the target object based on the target index value after executing step 403 to determine the target search node. For example, taking a virtual game scene as an example, the score segment of the game player can be clarified by combining the target index value of the game player with the target tree data structure, so as to match other game players in the same score segment for interaction. Optionally, Fig.10Another flow chart of the object processing method provided by the present application is shown. Fig.10 As shown, the method may include the following steps:
[0228] 1001. Obtain a pending request, where the pending request includes a target indicator value and a first identifier. The target indicator value is used to evaluate the ranking of a target object in a target business, and the first identifier is used to identify the target object.
[0229] 1002. Obtain a target tree data structure, where the target tree data structure includes N levels of cascaded search nodes. The search nodes at each level include an index value sequence and a number of objects. The index value sequence is used to represent the order of index values of multiple candidate objects, and the number of objects is used to represent the number of multiple candidate objects. N is a positive integer.
[0230] 1003. Traverse the target tree data structure and determine the target search node from N layers of cascaded search nodes based on the target index value.
[0231] It should be noted that the contents of the above steps 1001 to 1003 can be specifically referred to the above Figure 4 The contents of step 401 to step 403 described in the above are understood, and will not be repeated here. In addition, the target tree data structure here can also refer to the aforementioned Figure 5 or Figure 8 The content described above is understood and will not be repeated here.
[0232] 1004. Obtain a first numerical value, where the first numerical value is used to indicate the number of M target candidate objects, each target candidate object is used to interact with the target object, and M is a positive integer.
[0233] In one or more embodiments, the first value can be set by the user based on ranking requirements, or can be randomly generated. The method for obtaining the first value is not limited in this application. Through the first value, the number of M target candidate objects can be clarified, that is, the number of objects required for subsequent interactive operations with the target object.
[0234] For example, the first value may be represented by num, such as num=6. It should be noted that the specific value of the first value is not limited to 6, and may be other values, such as 8, 10, etc.
[0235] 1005. Determine the object identifier of each target candidate object based on the target index value, the first numerical value, and the object identifier list of the fourth search node associated with the target search node.
[0236] In one or more embodiments, from the aforementioned Figure 5It can be seen from the target tree data structure shown that, since each object identifier in the object identifier list of the fourth search node is associated with a candidate object, then, in order to find a target candidate object that satisfies the first numerical value, after obtaining the first numerical value, the object identifier of each target candidate object can be determined according to the target index value, the first numerical value, and the object identifier list of the fourth search node associated with the target search node.
[0237] In some other optional examples, the target index value can be compared with other index values in the target search node, so as to select a corresponding object identifier from the associated fourth search node according to the comparison result to determine the object identifier of the target candidate object. The specific understanding can be made by referring to the following two cases, namely:
[0238] Case (1): There are other index values in the target search node that are greater than the target index value
[0239] Exemplarily, when there is a third index value greater than the target index value in the target search node, the object identifier corresponding to the first value is selected from the object identifier list of the fourth search node associated with the third search node corresponding to the third index value. In this way, multiple object identifier selection methods are provided, the scope of application is expanded, and the flexibility and scalability of object identifier selection are improved.
[0240] For example, taking the target index value of "95" as an example, by executing the aforementioned steps 401 to 403, it can be determined that the corresponding target search node is search node A9. In the search node A9, by comparing the target index value "95" with other index values (i.e., "99" and "92"), it can be known that 99>95, and the third index value can be determined to be "99". Further, based on the third index value (i.e., "99"), it can be determined that the corresponding third search node is search node B1. In this way, the object identifier corresponding to the first value (e.g., "6") is selected from the object identifier list of the fourth search node (i.e., search nodes C1 to C3) associated with the search node B1.
[0241] For example, six object identifiers may be selected from id1 to id4 of search node C1, id5 to id8 of search node C2, and id9 to id12 of search node C3. For example, six object identifiers, id12, id11, id10, id9, id8, and id7, may be selected in ascending order of index value. Alternatively, six may be randomly selected from the 12 object identifiers, which is not specifically limited in this application.
[0242] Case (2): There is no other index value greater than the target index value in the target search node
[0243] In one or more embodiments, when there is no third index value greater than the target index value in the target search node, a fourth index value greater than the target index value is determined from other second search nodes at the same level as the target search node; and an object identifier corresponding to the first value is selected from an object list of a fourth search node associated with the third search node corresponding to the fourth index value. In this way, multiple object identifier selection methods are provided from another aspect, the scope of application is expanded, and the flexibility and scalability of object identifier selection are improved.
[0244] For example, for Figure 5 Based on the target tree data structure described, Fig.11 Shows Figure 5 A schematic diagram of the structure of the leaf nodes cascaded by the search node A6 in FIG. Fig.11 As shown, for the search node A6, in addition to cascading the aforementioned search nodes A8 to A10, it also cascades the search node A11.
[0245] Among them, for search node A8, the number of objects A8 recorded is 4 (i.e., playercount: 4), and the index value sequence A8 is {103, 102, 101}. Among them, the third search node corresponding to the index value "103" is search node B4, and the object identification list C4 of the fourth search node associated with search node B4 (for example, search node C4) includes: id13. The third search node corresponding to the index value "102" is search node B5, and the object identification list C5 of the fourth search node associated with search node B5 (for example, search node C5) includes: id14 to id16.
[0246] In addition, for Fig.11 The search node A11 in the table has a recorded object count A11 of 6 (playercount: 6), and an index value sequence A11 of {105, 104}. The third search node corresponding to the index value "105" is the search node B6, and the object identifier list C6 of the fourth search node (e.g., the search node C6) associated with the search node B6 includes: id17 to id22.
[0247] For example, if the target index value is "99" and its corresponding target search node is search node A9, in search node A9, by comparing the target index value "99" with other index values (i.e., "99" and "92"), it can be known that 95 < 99 and 92 < 99. At this time, it is necessary to determine a fourth index value greater than the target index value "99" from other second search nodes at the same level, such as search node A8 and search node A10.
[0248] By comparing the index values "105", "104" in the search node A11, the index values "103", "102", "101" in the search node A8, and the index values "89", "84", "81" in the search node A10 with the target index value "99". After comparison, it can be seen that only the index values "105", "104" in the search node A11, and the index values "103", "102", "101" in the search node A8 are greater than the target index value "99". At this time, the index values "105", "104", "103", "102", "101" can be determined as the fourth index values.
[0249] At this time, when the fourth indicator value is determined to be "105", "104", "103", "102", and "101", it is necessary to further select the object identifier corresponding to the first numerical value (i.e., 6) from the object list of the fourth search node associated with the corresponding third search node, that is, from id13 in search node C5, id14 to id16 in search node C4, and id17 to id22 in search node C6.
[0250] In other optional embodiments, for the above situation 2, if there are multiple other second search nodes at the same level as the target search node, the target object identifier can also be selected from the corresponding object identifier list in order based on the size of the index values in the other second search nodes, which not only simplifies the implementation of the processing logic, but also can use the correlation between nodes to accurately and efficiently select object identifiers, thereby improving processing performance. Specifically, other first search nodes at the same level may include a fifth child node and a sixth child node, and the index values in the index value sequence of the fifth child node are all greater than the index values in the index value sequence of the sixth child node. Then, how to determine the object identifier corresponding to the first numerical value in the above situation 2 can also be understood by referring to the following calculation process, namely:
[0251] Determine a fourth index value greater than the target index value from the index value sequence of the fifth child node and the index value sequence of the sixth child node;
[0252] When the number of objects of the sixth subnode is less than the first value, extracting the first object identifier corresponding to the number of objects of the sixth subnode from the object identifier list of the fourth search node associated with each fourth index value of the sixth subnode;
[0253] Calculate the difference between the first value and the number of objects of the sixth child node to obtain a second value;
[0254] Extracting a second object identifier corresponding to the second value from the object identifier list of the fourth search node associated with each fourth index value of the fifth child node;
[0255] Based on the first object identifier and the second object identifier, an object identifier corresponding to the first value is obtained.
[0256] For example, taking the target index value as "99" and its corresponding target search node as search node A9, from the above Fig.11 From the described structure, it can be seen that for the search node A9, the nodes that meet the conditions in other second search nodes at the same level include: search node A11 and search node A8. That is, the search node A8 here can be regarded as the sixth child node mentioned above, and the search node A11 can be regarded as the fifth child node mentioned above.
[0257] By comparing the number of objects recorded by the search node A8 (i.e., "4") with the first value (i.e., "6"), it can be known that 4 < 6. Therefore, the first object identifiers, i.e., id13 to id16, can be extracted from the object identifier lists of the fourth search nodes associated with the index values "103" and "102" of the search node A8, i.e., from the object identifier lists of the search nodes C4 and C5.
[0258] In addition, it is necessary to further calculate the difference between the number of objects recorded by the search node A8 (i.e., "4") and the first value (i.e., "6"), that is, the second value = 6-4 = 2. In other words, it is further necessary to select 2 more object identifiers from the object identifier list associated with the previous search node A11. In other words, it is necessary to select the object identifier corresponding to the second value (i.e., "2") from the object list of the fourth search node associated with the third search nodes corresponding to the index values of "105" and "104", that is, from "id17 to id22" in the search node C6, as the second object identifier, such as id17 and id18.
[0259] Therefore, by combining the first object identifiers id13, id14, id15, id16 and the second object identifiers id17, id18, an object identifier that satisfies the first value can be obtained.
[0260] 1006. Search for M target candidate objects based on the object identifiers of the M target candidate objects.
[0261] In one or more embodiments, after executing the above step 1005, the object identifiers of the M candidate objects can be obtained, and thus the M target candidate objects can be located and searched from the corresponding object nodes (player) according to the object identifiers of the M target candidate objects.
[0262] 1007. Perform an interactive operation on the M target candidate objects and the target object.
[0263] In one or more embodiments, after finding M target candidate objects, the M target candidate objects can be used to interact with the target object to obtain corresponding interaction results. The interaction between objects can be timely understood through the interaction results. It should be noted that the interaction operation may include but is not limited to content sharing operations, object matching operations, personalized recommendation operations or other operations.
[0264] Optionally, in another embodiment, as mentioned above Figure 5 As shown, all the second search nodes cascaded to the same first search node at level N-1 form a bidirectional list through bidirectional pointers. Fig.10 How to find other objects in the same segment as the target object can be achieved through the Range function. Specifically, the logical implementation pseudo code of the Range function is as follows:
[0265]
[0266]
[0267] Among them, []Address represents an array of unique identifiers (Address), and []Address{} represents an empty Address array. The Append(addrs,playerListNode.players) function is used to indicate that the addresses of all Player nodes in the Player node list (playerListNode.players) cascaded by playerListNode are added to the addrs array (i.e., the object identifier list mentioned above). The Score function indicates that the corresponding Score node (i.e., scoreNode) is found according to the target indicator value (score).
[0268] The RangeScore function has two input parameters, namely: the Score node associated with the target index value, and the first value (num). Through this function, the object identifier (such as address) of the object can be obtained from the playerList associated with the Score node.
[0269] The PrevScore function is used to find the previous scoreNode of a scoreNode, that is, the first node on the left of the same level. There are two possibilities for this function. One is that when there is a score with a larger index value than the current input parameter in the same scoreListNode of the input scoreNode, the scoreNode corresponding to the previous score in the scoreListNode.scores is directly returned. Otherwise, the other is to find the previous score by traversing scoreListNode.prevScoreList and finding the previous scoreListNode. The specific implementation process can be referred to the above. Fig.10 The contents described in cases (1) and (2) above should be understood and will not be repeated here.
[0270] That is to say, the Range function in this application mainly executes the first step, first finding the score node where the object is located through the address. Then, execute the second step, that is, obtain the addresses of num objects as much as possible through the RangeScore function, and continue to execute the third step if it is not enough. The third step is to obtain the previous Score node through the PrevScore function. If there is no other node with an index value greater than the target index value in the previous score node, exit, indicating that there are no more objects in other nodes that can be queried. If there is, jump to execute the second step.
[0271] Through the above method, by using the target index value of the target object and the number of other objects to be found (i.e., the first value), and combining the target tree data structure to select other candidate objects in the same segment, not only the complexity of the segment matching process can be reduced, but also the interaction between objects can be promoted to enhance the social connection between the target candidate object and the target object, as well as to realize personalized recommendations such as preferences between objects, improve the interactive experience of the object, and help to explore the potential points of interest of the object.
[0272] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. It can be understood that in order to realize the above functions, the hardware structure and / or software modules corresponding to the execution of each function are included. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. The object processing node in this application is described in detail below, please refer to Fig.12 , Fig.121 is a schematic diagram of an embodiment of an object processing node in an embodiment of the present application. The object processing node includes: an acquisition unit 1201 and a determination unit 1202. Optionally, it may also include a search unit 1203 and an execution unit 1204.
[0273] The acquisition unit 1201 is used to acquire a pending request, where the pending request includes a target indicator value and a first identifier, where the target indicator value is used to evaluate the ranking of the target object in the target business, and the first identifier is used to identify the target object;
[0274] The acquisition unit 1201 is used to acquire a target tree data structure, where the target tree data structure includes N layers of cascaded search nodes, where each layer of search nodes includes an index value sequence and a number of objects, where the index value sequence is used to represent the ranking of index values of multiple candidate objects, and the number of objects is used to represent the number of multiple candidate objects, where N is a positive integer;
[0275] A determination unit 1202 is used to traverse the target tree data structure and determine a target search node from N layers of cascaded search nodes based on a target index value;
[0276] A determining unit 1202 is used to determine the first object quantity based on the target index value, the index value sequence of the target search node and the object quantity of the target search node, and determine the second object quantity based on the target index value, the first identifier, the index value sequence of the target search node and the object quantity of the target search node, wherein the index value of each candidate object corresponding to the first object quantity is greater than the target index value, and the index value of each candidate object corresponding to the second object quantity is greater than the target index value;
[0277] The determining unit 1202 is configured to determine a target ranking of the target object based on the first object quantity and the second object quantity.
[0278] In one possible design, in another implementation of another aspect of the embodiment of the present application, the N-layer cascaded search nodes include the first search node of the first N-1 layers of cascades, and one or more second search nodes cascaded with the first search node of the N-1th layer; the target tree data structure also includes: one or more third search nodes cascaded with the second search node, and a fourth search node cascaded with each third search node;
[0279] The number of objects in the first search node of the i-th level is the same as the number of objects in all the first search nodes of the cascaded i+1-th level, the index value sequence of the first search node of the i-th level includes multiple first index values, and the numerical interval between every two adjacent first index values corresponds to the index value sequence of the first search node of the cascaded i+1-th level, 1≤i<N, i is an integer;
[0280] Each value interval in the first search node of the N-1th level includes an index value sequence of a second search node, each index value sequence of the second search node includes one or more second index values, and the sum of the number of objects of all the second search nodes is the same as the number of objects of the cascaded first search node of the N-1th level;
[0281] Each third search node includes an index value and the number of objects, the index values of all third search nodes constitute the index value sequence of the second search node, and the fourth search node includes an object identifier list, and each object identifier in the object identifier list is used to identify a candidate object.
[0282] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0283] Step 1: traverse the first search node of the i-th level, and when the target index value is included in the first numerical interval in the index value sequence of the first search node of the i-th level, determine the first search node of the i+1th level associated with the first numerical interval as the first child node, and the minimum value of the first numerical interval is less than or equal to the target index value, and the maximum value is greater than the target index value;
[0284] Step 2: Repeat step 1 until the first search node of the N-1th layer is traversed, and when the target index value matches the second index value in the index value sequence of the cascaded second search node, determine that the second search node corresponding to the index value match is the target search node.
[0285] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0286] The determining unit 1202 is specifically used to: determine a second child node located at the same level as the target search node, each index value in the index value sequence of the second child node is greater than the index value in the index value sequence of the target search node; determine a fourth child node located at the same level as the third child node, the third child node includes the first search node of each level in the first N-1 levels cascaded with the target search node, and each index value in the index value sequence of the fourth child node is greater than the index value in the index value sequence of the third child node at the same level;
[0287] Extract the number of objects in the second child node and the number of objects in the fourth child node of each level;
[0288] The number of objects of the second child node and the sum of the number of objects of the fourth child nodes of all levels are calculated to obtain the first number of objects.
[0289] In one possible design, in another implementation of another aspect of the embodiment of the present application, the index value sequence of the search nodes at each level in the N-layer cascade search nodes is arranged in descending order; the determination unit 1202 is specifically used to:
[0290] The sibling node arranged on the left side of the target search node is determined as the second child node at the same level as the target search node.
[0291] In one possible design, in another implementation of another aspect of the embodiment of the present application, the index value sequence of the search nodes at each level in the N-layer cascade search nodes is arranged in ascending order; the determination unit 1202 is specifically used to:
[0292] The sibling node arranged on the right side of the target search node is determined as the second child node at the same level as the target search node.
[0293] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0294] When the target index value matches the index value of any third search node associated with the target search node, matching the first identifier with the object identifier list in the fourth search node associated with the corresponding third search node;
[0295] When the first identifier matches any object identifier in the object identifier list in the fourth search node associated with the corresponding third search node, the number of objects in the target search node whose index value is greater than the target index value is counted;
[0296] The number of objects in the target search node when the index value is greater than the target index value is taken as the second object number.
[0297] In one possible design, in another implementation of another aspect of the embodiment of the present application,
[0298] The acquisition unit 1201 may also be used to acquire a first value after traversing the target tree data structure and determining the target search node from the first search node of the N-layer cascade based on the target index value, where the first value is used to indicate the number of M target candidate objects, each target candidate object is used to interact with the target object, and M is a positive integer;
[0299] The determining unit 1202 is specifically configured to determine the object identifier of each target candidate object based on the target index value, the first value, and the object identifier list of the fourth search node associated with the target search node;
[0300] A searching unit 1203 is specifically configured to search for M target candidate objects based on the object identifiers of the M target candidate objects;
[0301] The execution unit 1204 is specifically configured to perform an interactive operation on the M target candidate objects and the target object.
[0302] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0303] When there is a third index value greater than the target index value in the target search node, the object identifier corresponding to the first value is selected from the object identifier list of the fourth search node associated with the third search node corresponding to the third index value to determine the object identifier of each target candidate object.
[0304] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0305] When there is no third index value greater than the target index value in the target search node, a fourth index value greater than the target index value is determined from other second search nodes at the same level as the target search node;
[0306] From the object list of the fourth search node associated with the third search node corresponding to the fourth index value, select the object identifier corresponding to the first value to determine the object identifier of each target candidate object.
[0307] In one possible design, in another implementation of another aspect of the embodiment of the present application, the other second search nodes at the same level include a fifth child node and a sixth child node, and the index value in the index value sequence of the fifth child node is greater than the index value in the index value sequence of the sixth child node; the determining unit 1202 is specifically used to:
[0308] Determine a fourth index value greater than the target index value from the index value sequence of the fifth child node and the index value sequence of the sixth child node;
[0309] When the number of objects of the sixth subnode is less than the first value, extracting the first object identifier corresponding to the number of objects of the sixth subnode from the object identifier list of the fourth search node associated with each fourth index value of the sixth subnode;
[0310] Calculate the difference between the first value and the number of objects of the sixth child node to obtain a second value;
[0311] Extracting a second object identifier corresponding to the second value from the object identifier list of the fourth search node associated with each fourth index value of the fifth child node;
[0312] Based on the first object identifier and the second object identifier, an object identifier corresponding to the first value is obtained.
[0313] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0314] determining a first local ranking of the target object based on the first object quantity, and determining a second local ranking of the target object based on the second object quantity;
[0315] Based on the first local ranking and the second local ranking, a target ranking of the target object is obtained.
[0316] In a possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit 1202 is specifically configured to:
[0317] Calculate the sum of the first local ranking and the second local ranking to obtain the first ranking;
[0318] The next ranking position after the first ranking position is used as the target ranking of the target object.
[0319] In one possible design, in another implementation of another aspect of the embodiment of the present application, the target object includes a virtual player in a virtual game.
[0320] In one possible design, in another implementation of another aspect of the embodiment of the present application, the virtual game includes a full-chain game.
[0321] The sampling processing apparatus in the embodiment of the present application is described above from the perspective of modular functional entities. The object processing device in the embodiment of the present application is described below from the perspective of hardware processing.
[0322] Fig.13 The hardware structure diagram of the object processing device provided in the embodiment of the present application is shown in FIG. The object processing device may have relatively large differences due to different configurations or performances, for example, it may include but is not limited to the aforementioned Fig.12 The object described processes nodes, etc. Fig.13As shown, the object processing device 100 may include one or more central processing units (CPU) 1322 (for example, one or more processors) and a memory 1332, and one or more storage media 1330 (for example, one or more mass storage devices) for storing application programs 1342 or data 1344. Among them, the memory 1332 and the storage medium 1330 may be temporary storage or permanent storage. The program stored in the storage medium 1330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the object processing device 100. Furthermore, the central processing unit 1322 may be configured to communicate with the storage medium 1330 and execute a series of instruction operations in the storage medium 1330 on the object processing device 100. Exemplarily, the central processing unit 1322 is used to execute the application program 1342 stored in the storage medium 1330, thereby implementing the object processing method provided in the above-mentioned embodiment of the present application.
[0323] The object processing device 100 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input and output interfaces 1358, and / or one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0324] For example, Fig.13 The CPU 1322 in the object processing device 100 can call the computer execution instructions stored in the memory 1332 to make the object processing device 100 execute the following Figures 4 to 11 The method in the corresponding method embodiment.
[0325] Specifically, Fig.12 The functions / implementation processes of the determination unit 1202, the search unit 1203, and the execution unit 1204 can be realized by Fig.13 The central processing unit 1322 in the memory 1332 calls the computer execution instructions stored in the memory 1332 to achieve this. Fig.12 The function / implementation process of the acquisition unit 1201 can be achieved by Fig.13 It is implemented by the input and output interface 1358 in.
[0326] The steps performed by the object processing device 100 in the above embodiment can be based on the Fig.13 The object shown handles the device structure.
[0327] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the method described in the above embodiments are implemented.
[0328] A computer program product is also provided in an embodiment of the present application, including a computer program or instructions, which, when executed by a processor, implements the steps of the methods described in the aforementioned embodiments.
[0329] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0330] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0331] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0332] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0333] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a server or terminal device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store computer programs.
[0334] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for object processing, characterized in that: Applied to an object processing node in a blockchain network, the method comprises: Obtaining a pending request, wherein the pending request includes a target indicator value and a first identifier, wherein the target indicator value is used to evaluate the ranking of the target object in the target business, and the first identifier is used to identify the target object; Obtain a target tree data structure, wherein the target tree data structure includes N layers of cascaded search nodes, wherein the search nodes include an index value sequence and an object quantity, wherein the index value sequence is used to characterize the ranking of index values of multiple candidate objects, and the object quantity is used to characterize the quantity of the multiple candidate objects, and N is a positive integer; Traversing the target tree data structure, and determining a target search node from the N layers of cascaded search nodes based on the target index value; Determine the first number of objects based on the target index value, the index value sequence of the target search node and the number of objects of the target search node, and determine the second number of objects based on the target index value, the first identifier, the index value sequence of the target search node and the number of objects of the target search node, wherein the index value of each candidate object corresponding to the first number of objects is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value; A target ranking of the target object is determined based on the first object quantity and the second object quantity.
2. The method according to claim 1, characterized in that The N-layer cascaded search nodes include the first search node of the first N-1 layers of cascades, and one or more second search nodes cascaded with the first search node of the N-1th layer; the target tree data structure also includes: one or more third search nodes cascaded with the second search nodes, and a fourth search node cascaded with each of the third search nodes; The number of objects in the first search node of the i-th level is the same as the number of objects in all the first search nodes of the cascaded i+1-th level, the index value sequence of the first search node of the i-th level includes multiple first index values, and the numerical interval between every two adjacent first index values corresponds to the index value sequence of the cascaded i+1-th level first search node, 1≤i<N, i is an integer; Each of the numerical intervals in the first search node of the N-1th level comprises an index value sequence of the second search node, each index value sequence of the second search node comprises one or more second index values, and the sum of the number of objects of all the second search nodes is the same as the number of objects of the cascaded first search node of the N-1th level; Each of the third search nodes includes an index value and the number of objects, the index values of all the third search nodes constitute the index value sequence of the second search node, and the fourth search node includes an object identifier list, and each object identifier in the object identifier list is used to identify one of the candidate objects.
3. The method according to claim 2, characterized in that Traversing the target tree data structure, and determining a target search node from the N-layer cascaded search nodes based on the target index value, comprising: Step 1: traverse the first search node of the i-th level, and when the target index value is included in the first numerical interval in the index value sequence of the first search node of the i-th level, determine the first search node of the i+1th level associated with the first numerical interval as the first child node, and the minimum value of the first numerical interval is less than or equal to the target index value, and the maximum value is greater than the target index value; Step 2: Repeat step 1 until traversing to the first search node of the N-1th layer, and when the target index value matches the second index value in the index value sequence of the cascaded second search node, determine that the second search node corresponding to the index value match is the target search node.
4. The method according to any one of claims 2 to 3, characterized in that Determining a first object quantity based on the target index value, the index value sequence of the target search node, and the object quantity of the target search node includes: Determine a second child node at the same level as the target search node, each index value in the index value sequence of the second child node is greater than the index value in the index value sequence of the target search node; Determine a fourth child node at the same level as the third child node, the third child node including the first search node of each level in the first N-1 levels cascaded with the target search node, and each index value in the index value sequence of the fourth child node is greater than the index value in the index value sequence of the third child node at the same level; Extracting the number of objects of the second sub-node and the number of objects of the fourth sub-node of each level; The sum of the number of objects of the second sub-node and the number of objects of the fourth sub-nodes of all levels is calculated to obtain a first number of objects.
5. The method according to claim 4, characterized in that The index value sequence of the search nodes at each level in the N-level cascade search nodes is arranged in descending order; Determining a second child node at the same level as the target search node includes: The brother node arranged on the left side of the target search node is determined as the second child node located at the same level as the target search node.
6. The method according to claim 4, characterized in that The index value sequence of the search nodes at each level in the N-level cascade search nodes is arranged in ascending order; Determining a second child node at the same level as the target search node includes: The brother node arranged on the right side of the target search node is determined as the second child node located at the same level as the target search node.
7. The method according to claim 2, characterized in that Determining the second object quantity based on the target index value, the first identifier, the index value sequence of the target search node, and the object quantity of the target search node includes: When the target index value matches the index value of any of the third search nodes associated with the target search node, matching the first identifier with a list of object identifiers in a fourth search node associated with the third search node; When the first identifier matches any of the object identifiers in the object identifier list in the fourth search node associated with the corresponding third search node, the number of objects in the target search node whose index value is greater than the target index value is counted; The number of objects in the target search node when the index value is greater than the target index value is used as the second object number.
8. The method according to claim 2, characterized in that: After traversing the target tree data structure and determining the target search node from the N-layer cascaded search nodes based on the target index value, the method further includes: Obtaining a first value, where the first value is used to indicate the number of M target candidate objects, each of the target candidate objects being used to interact with the target object, and M is a positive integer; Determine the object identification of each of the target candidate objects based on the target index value, the first value, and a list of object identifications of fourth search nodes associated with the target search node; Searching for M target candidate objects based on the object identifiers of the M target candidate objects; An interactive operation is performed on the M target candidate objects and the target object.
9. The method according to claim 8, characterized in that Determining the object identification of each of the target candidate objects based on the target index value, the first value, and the object identification list of the fourth search node associated with the target search node includes: When there is a third index value greater than the target index value in the target search node, the object identifier corresponding to the first value is selected from the object identifier list of the fourth search node associated with the third search node corresponding to the third index value to determine the object identifier of each of the target candidate objects.
10. The method according to claim 9, characterized in that Determining the object identification of each of the target candidate objects based on the target index value, the first value, and the object identification list of the fourth search node associated with the target search node includes: When there is no third index value greater than the target index value in the target search node, a fourth index value greater than the target index value is determined from other second search nodes at the same level as the target search node; From the object list of the fourth search node associated with the third search node corresponding to the fourth index value, select the object identifier corresponding to the first value to determine the object identifier of each of the target candidate objects.
11. The method according to claim 10, characterized in that The other second search nodes at the same level include a fifth child node and a sixth child node, and the index value in the index value sequence of the fifth child node is greater than the index value in the index value sequence of the sixth child node; Determining a fourth index value greater than the target index value from other second search nodes at the same level as the target search node includes: Determine a fourth index value greater than the target index value from the index value sequence of the fifth child node and the index value sequence of the sixth child node; Selecting an object identifier corresponding to the first value from an object list of a fourth search node associated with the third search node corresponding to the fourth index value includes: When the number of objects of the sixth subnode is less than the first value, extracting the first object identifier corresponding to the number of objects of the sixth subnode from the object identifier list of the fourth search node associated with each of the fourth index values of the sixth subnode; Calculate the difference between the first value and the number of objects of the sixth child node to obtain a second value; Extracting a second object identifier corresponding to the second value from the object identifier list of the fourth search node associated with each of the fourth index values of the fifth child node; Based on the first object identifier and the second object identifier, an object identifier corresponding to the first value is obtained.
12. The method according to any one of claims 1 to 11, characterized in that Determining a target ranking of the target object based on the first object quantity and the second object quantity includes: determining a first local ranking of the target object based on the first object quantity, and determining a second local ranking of the target object based on the second object quantity; A target ranking of the target object is obtained based on the first local ranking and the second local ranking.
13. The method according to claim 12, characterized in that Obtaining a target ranking of the target object based on the first local ranking and the second local ranking includes: Calculate the sum of the first local ranking and the second local ranking to obtain a first ranking position; The ranking position after the first ranking position is used as the target ranking of the target object.
14. The method according to any one of claims 1 to 13, characterized in that The target object includes a virtual player in a virtual game.
15. The method according to claim 14, characterized in that The virtual game includes a full-chain game.
16. An object processing node, characterized in that: include: An acquisition unit, configured to acquire a pending request, wherein the pending request includes a target indicator value and a first identifier, wherein the target indicator value is used to evaluate a ranking of a target object in a target business, and the first identifier is used to identify the target object; The acquisition unit is used to acquire a target tree data structure, wherein the target tree data structure includes N layers of cascaded search nodes, and the search nodes at each layer include an index value sequence and a number of objects, wherein the index value sequence is used to represent the ranking of the index values of multiple candidate objects, and the number of objects is used to represent the number of the multiple candidate objects, and N is a positive integer; A determination unit, configured to traverse the target tree data structure and determine a target search node from the N-layer cascaded search nodes based on the target index value; The determining unit is used to determine the first number of objects based on the target index value, the index value sequence of the target search node and the number of objects of the target search node, and to determine the second number of objects based on the target index value, the first identifier, the index value sequence of the target search node and the number of objects of the target search node, wherein the index value of each candidate object corresponding to the first number of objects is greater than the target index value, and the index value of each candidate object corresponding to the second number of objects is greater than the target index value; The determining unit is configured to determine a target ranking of the target object based on the first object quantity and the second object quantity.
17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the object processing method according to any one of claims 1 to 15 are implemented.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the object processing method according to any one of claims 1 to 15 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the object processing method described in any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Node determination method and device, electronic equipment and storage medium
CN112115030A
Code snippet recommendation method and system based on abstract syntax tree
CN113312904A
Data sorting method and device and storage medium
CN118520027A
Leaf node ranking method in decision trees for spatial prediction and its recording medium
US20150371141A1