Resource processing method and apparatus, electronic device, and storage medium

CN116089087BActive Publication Date: 2026-09-22BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310086040.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-29
Publication Date
2026-09-22
Estimated Expiration
2043-01-29

AI Technical Summary

Benefits of technology

[0057]本公开的实施例提供的技术方案至少带来以下有益效果:在本公开实施例中,响应于任一资源申请对象的权重获取操作,根据为资源申请对象生成的资源权重以及资源申请对象对应的随机值,确定资源申请对象当前的资源分配参数,以作为目标参数。在目标参数满足第一预设条件的情况下,基于目标参数,对候选对象池中的候选对象进行更新;候选对象包括资源分配参数满足第二预设条件的资源申请对象。在达到指定分配条件的情况下,向候选对象池中的候选对象分配目标资源。本公开实施例中,通过根据资源申请对象的随机值以及资源权重确定资源分配参数,并基于资源分配参数进行分配,一定程度上可以确保资源分配的随机性,进而一定程度上可以确保资源分配的公平性和合理性,且由于候选对象是资源分配参数满足第二预设条件的资源申请对象,即,向资源分配参数满足第二预设条件的资源申请对象才进行分配,因此,一定程度上可以进一步确保资源分配的合理性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089087B_ABST
    Figure CN116089087B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a resource processing method and device, electronic equipment and storage medium, and relates to the technical field of computers. The method determines a current resource allocation parameter of a resource application object as a target parameter in response to a weight acquisition operation of any resource application object, according to a resource weight generated for the resource application object and a random value corresponding to the resource application object. If the target parameter meets a first preset condition, the target parameter is used to update a candidate object in a candidate object pool. The candidate object includes a resource application object whose resource allocation parameter meets a second preset condition. If a specified allocation condition is met, the target resource is allocated to the candidate object in the candidate object pool. In this way, the fairness of resource allocation and the rationality of resource allocation can be ensured to some extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a resource processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the continuous development of network technology, network platforms are being used more and more widely. For example, users can obtain information resources from network platforms, or network platforms can provide network resources for users to use.

[0003] Accordingly, users can apply for resources from the network platform, which then provides the resources to the applicants. The applicant can be identified as the user account requesting the resource. Since the total amount of resources is limited, while the number of applicants is often large, how to allocate resources reasonably among applicants becomes a pressing technical problem that needs to be solved. Summary of the Invention

[0004] This disclosure provides a resource processing method, apparatus, electronic device, and storage medium to solve the aforementioned technical problems. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, a resource processing method is provided, applied to an electronic device, comprising:

[0006] In response to the weight acquisition operation of any resource request object, the current resource allocation parameters of the resource request object are determined based on the resource weight generated for the resource request object and the random value corresponding to the resource request object, and used as the target parameters;

[0007] If the target parameters meet the first preset condition, the candidate objects in the candidate object pool are updated based on the target parameters; the candidate objects include resource request objects whose resource allocation parameters meet the second preset condition.

[0008] When the specified allocation conditions are met, the target resource is allocated to the candidate objects in the candidate object pool.

[0009] Optionally, the first preset condition includes the target parameter being greater than the resource allocation parameter of the specified object, wherein the specified object is the Nth candidate object in the candidate object pool when the current candidate objects in the candidate object pool are sorted in descending order of resource allocation parameters, and N is a positive integer;

[0010] The step of updating the candidate objects in the candidate object pool based on the target parameters when the target parameters meet the first preset condition includes:

[0011] If the target parameter is greater than the resource allocation parameter of the specified object, and there is no resource request object among the candidate objects, the resource request object is added to the candidate object pool as a candidate object.

[0012] If the resource request object exists among the candidate objects, the resource allocation parameters of the resource request object in the candidate object pool are updated to the target parameters.

[0013] Optionally, the method further includes:

[0014] When a preset update cycle is reached, objects to be cleared in the candidate object pool are identified; the objects to be cleared are those in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of the specified object.

[0015] Remove the object to be cleared from the candidate object pool.

[0016] Optionally, the specified allocation condition includes the current time reaching a specified time; the step of allocating the target resource to the candidate objects in the candidate object pool when the specified allocation condition is met includes:

[0017] If the specified time is reached at the current time, obtain M candidate objects selected from the candidate object pool as the target object; where M is a positive integer.

[0018] Resource allocation is performed for the user accounts represented by the target object.

[0019] Optionally, before obtaining the M candidate objects selected from the candidate object pool when the specified time is reached at the current time, the method further includes:

[0020] Before the specified time, select M candidate objects from the candidate object pool to obtain M alternative objects;

[0021] After waiting for a specified period of time, M candidate objects are selected again from the candidate object pool, and the M candidate objects selected this time are used to overwrite the M candidate objects selected last time, until the preset stopping condition is met.

[0022] The step of obtaining M candidate objects selected from the candidate object pool as the target object when the current time reaches the specified time includes: obtaining the most recently selected M candidate objects as the target object when the current time reaches the specified time.

[0023] Optionally, selecting M candidate objects from the candidate object pool includes:

[0024] M candidate objects are selected from the candidate object pool in descending order of resource allocation parameters.

[0025] Optionally, determining the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object includes:

[0026] If the resource weight is the first resource weight generated for the resource request object, then the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the resource weight.

[0027] If the resource weight is not the first resource weight generated for the resource request object, then the current resource weight of the resource request object is calculated based on the resource weight and the resource weights previously generated for the resource request object; and the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the current resource weight.

[0028] According to a second aspect of the present disclosure, a resource processing apparatus is provided, comprising:

[0029] The first determining module is configured to respond to a weight acquisition operation of any resource request object, and determine the current resource allocation parameters of the resource request object as target parameters based on the resource weight generated for the resource request object and the random value corresponding to the resource request object.

[0030] The update module is configured to update the candidate objects in the candidate object pool based on the target parameters when the target parameters meet a first preset condition; the candidate objects include resource request objects whose resource allocation parameters meet a second preset condition.

[0031] The allocation module is configured to allocate target resources to candidate objects in the candidate object pool when specified allocation conditions are met.

[0032] Optionally, the first preset condition includes the target parameter being greater than the resource allocation parameter of the specified object, wherein the specified object is the Nth candidate object in the candidate object pool when the current candidate objects in the candidate object pool are sorted in descending order of resource allocation parameters, and N is a positive integer;

[0033] The update module is specifically configured as follows:

[0034] If the target parameter is greater than the resource allocation parameter of the specified object, and there is no resource request object among the candidate objects, the resource request object is added to the candidate object pool as a candidate object.

[0035] If the resource request object exists among the candidate objects, the resource allocation parameters of the resource request object in the candidate object pool are updated to the target parameters.

[0036] Optionally, the device further includes:

[0037] The second determining module is configured to determine objects to be cleared in the candidate object pool when a preset update cycle is reached; the objects to be cleared are objects in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of the specified object.

[0038] The removal module is configured to remove the object to be removed from the candidate object pool.

[0039] Optionally, the specified allocation condition includes the current time reaching a specified time; the allocation module is specifically configured as follows:

[0040] If the specified time is reached at the current time, obtain M candidate objects selected from the candidate object pool as the target object; where M is a positive integer.

[0041] Resource allocation is performed for the user accounts represented by the target object.

[0042] Optionally, the device further includes:

[0043] The selection module is configured to select M candidate objects from the candidate object pool before the specified time, thus obtaining M alternative objects;

[0044] The reselection module is configured to select M candidate objects from the candidate object pool after waiting for a specified time, and use the M candidate objects selected this time to overwrite the M candidate objects selected last time, until a preset stopping condition is met.

[0045] The allocation module is further configured to: when the specified time is reached at the current time, obtain the most recently selected M candidate objects as the target object.

[0046] Optionally, the selection module is specifically configured as follows:

[0047] M candidate objects are selected from the candidate object pool in descending order of resource allocation parameters.

[0048] Optionally, the first determining module is specifically configured as follows:

[0049] If the resource weight is the first resource weight generated for the resource request object, then the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the resource weight.

[0050] If the resource weight is not the first resource weight generated for the resource request object, then the current resource weight of the resource request object is calculated based on the resource weight and the resource weights previously generated for the resource request object; and the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the current resource weight.

[0051] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0052] processor;

[0053] Memory used to store the processor's executable instructions;

[0054] The processor is configured to execute the instructions to implement the method as described in any one of the first aspects.

[0055] According to a fourth aspect of the present disclosure, a storage medium is provided such that, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device performs the method as described in any one of the first aspects.

[0056] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including readable program instructions that, when executed by a processor of an electronic device, cause the electronic device to perform the method as described in any one of the first aspects.

[0057] The technical solutions provided by the embodiments of this disclosure bring at least the following beneficial effects: In the embodiments of this disclosure, in response to the weight acquisition operation of any resource application object, the current resource allocation parameters of the resource application object are determined based on the resource weight generated for the resource application object and the random value corresponding to the resource application object, and are used as target parameters. If the target parameters meet a first preset condition, the candidate objects in the candidate object pool are updated based on the target parameters; the candidate objects include resource application objects whose resource allocation parameters meet a second preset condition. If the specified allocation condition is met, the target resource is allocated to the candidate objects in the candidate object pool. In the embodiments of this disclosure, by determining the resource allocation parameters based on the random value and resource weight of the resource application object, and allocating resources based on the resource allocation parameters, the randomness of resource allocation can be ensured to a certain extent, thereby ensuring the fairness and rationality of resource allocation to a certain extent. Furthermore, since the candidate object is a resource application object whose resource allocation parameters meet the second preset condition, that is, allocation is only performed to resource application objects whose resource allocation parameters meet the second preset condition, the rationality of resource allocation can be further ensured to a certain extent.

[0058] Meanwhile, in response to the weight acquisition operation of the resource request object and in generating resource weights for the resource request object, the system determines whether to update the candidate objects in the candidate object pool based on the determined current resource allocation parameters. This allows for real-time dynamic updates to the candidate object pool, enabling resource allocation directly to the candidate objects in the pool when specified allocation conditions are met. This reduces the processing load during resource allocation to some extent, shortens the time required for resource allocation, and ensures the stability of the resource allocation service.

[0059] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0060] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0061] Figure 1 This is a flowchart illustrating a resource processing method according to an exemplary embodiment.

[0062] Figure 2 This is an interactive schematic diagram illustrating an exemplary embodiment;

[0063] Figure 3 This is a schematic diagram illustrating a processing procedure according to an exemplary embodiment;

[0064] Figure 4 This is an interactive schematic diagram illustrating an exemplary embodiment;

[0065] Figure 5 This is a block diagram illustrating a resource processing apparatus according to an exemplary embodiment;

[0066] Figure 6 This is a block diagram illustrating an apparatus for resource processing according to an exemplary embodiment;

[0067] Figure 7 This is a block diagram illustrating another apparatus for resource processing according to an exemplary embodiment. Detailed Implementation

[0068] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0069] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0070] Figure 1 This is a flowchart illustrating a resource processing method according to an exemplary embodiment, such as... Figure 1 As shown, the method may include the following steps:

[0071] Step 101: In response to the weight acquisition operation of any resource request object, determine the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object, and use it as the target parameter.

[0072] This resource processing method can be applied to server clusters. In this embodiment, a resource request object can represent a user account on the network platform. In one implementation, different resource request objects can represent different user accounts. This ensures that a user account can only obtain one allocated resource in a resource allocation round, thereby maximizing the allocation of a limited number of resources to more user accounts and ensuring resource utilization. This avoids the problem of a user account holding multiple allocated resources, leading to underutilization of resources. Alternatively, in another implementation, different resource request objects can represent the same user account. This eliminates the need for deduplication for the same user account in a resource allocation round, allowing a user account to obtain multiple allocated resources, thus improving the resource acquisition efficiency of user accounts.

[0073] Weight acquisition is an operation performed by a user account when requesting resources. It involves the user account acquiring the resource weight of a target resource. The resource weight generated for the resource request object can be based on this weight acquisition operation. For example, in one implementation scenario, if a user account has a high demand for resources, a higher resource weight can be assigned to the user account with a larger historical resource usage to ensure that the target resource is allocated to that user account as much as possible. Correspondingly, in this application scenario, the weight acquisition operation can be the user account's usage of resources on the network platform. Taking a cloud platform as an example, if user account A uses 10 cloud service instances, a resource weight of 1 can be generated for user account A; if user account A uses 15 cloud service instances, a resource weight of 1.5 can be generated for user account A. Of course, the resource weight generated for the resource request object can also be positively correlated with the activity level of the user account represented by the resource request object; that is, the more active the user account, the more resource weight it can accumulate. This ensures that the target resource is allocated to active user accounts as much as possible, thereby guaranteeing resource utilization to a certain extent.

[0074] In another implementation scenario, the weight acquisition operation can be an operation where a user account submits a resource request, which may carry a representation of the amount of resources required by the user account. Accordingly, a resource weight can be generated for the resource request object based on the amount of resources carried in the resource request. This generated resource weight is the resource weight obtained by the resource request object.

[0075] Alternatively, in another implementation scenario, the weight acquisition operation can be an operation where a user account completes a specified task. This specified task can be a task provided to the user by the network platform, and can be set according to actual needs. For example, taking a cloud computing platform, the specified task could include using applied computing resources at a fixed frequency within a preset time period, or exceeding a preset amount of cumulative computing resource usage. Correspondingly, in the cloud computing platform scenario, the target resource could be a computing resource with computing power exceeding a preset computing power threshold, such as a high-performance computing instance. Taking a video platform as an example, the specified task could include video viewing time exceeding a preset duration threshold, or exceeding a preset release volume threshold, etc. Correspondingly, in the video platform scenario, the target resource could be a virtual resource, such as preset audio usage permissions, red envelope rewards, or user account membership permissions.

[0076] Furthermore, user accounts can participate in resource allocation by completing specified tasks. These tasks correspond to conditions required to claim resource weights. In one implementation, different specified tasks can correspond to different resource weights. The number of times a user account completes different types of specified tasks can accumulate different resource weights for the resource request objects corresponding to that user account. The random value corresponding to the resource request object can be randomly generated for the user account represented by that resource request object when generating resource weights for that resource request object for the first time.

[0077] A user account represented by a resource request object may perform weight acquisition operations multiple times. Correspondingly, resource weights will be generated for the resource request object multiple times. After each generation of resource weights, an operation to determine the current resource allocation parameters of the resource request object can be performed. For example, this operation can be triggered each time a user completes a specified task. The current resource allocation parameters determined in this instance are the target parameters. The resource allocation parameters can be positively correlated with the probability of the target resource being allocated to the resource request object, and they can also be positively correlated with the accumulated resource weights of the resource request object. In other words, the higher the accumulated resource weights of the resource request object, the greater the probability of obtaining the target resource.

[0078] Step 102: If the target parameters meet the first preset condition, update the candidate objects in the candidate object pool based on the target parameters; the candidate objects include resource application objects whose resource allocation parameters meet the second preset condition.

[0079] Step 103: If the specified allocation conditions are met, allocate the target resource to the candidate objects in the candidate object pool.

[0080] For steps 102 to 103 above, the first preset condition and the second preset condition can be set according to actual needs. For example, the second preset condition can be that the resource allocation parameter belongs to the top N resource allocation parameters among all resource application objects. That is, the resource application object whose resource allocation parameter satisfies the second preset condition can be the resource application object whose resource allocation parameter belongs to the top N resource application objects with the largest resource allocation parameter. Alternatively, the second preset condition can also be that the resource allocation parameter is greater than a preset parameter threshold. This embodiment of the present disclosure does not limit this.

[0081] Furthermore, if the target parameters satisfy the first preset condition, it can be assumed that the resource request object can be added to the candidate object pool as a candidate object. Therefore, the candidate objects in the candidate object pool can be updated based on the target parameters.

[0082] Furthermore, the specified allocation conditions can be set according to actual needs. For example, the specified allocation conditions may include the current time reaching a specified time, the target resource having been fully generated, or the number of candidate objects reaching a specified number. Allocating target resources to candidate objects in the candidate object pool may involve selecting a portion of the candidate objects and allocating a portion of the target resources to the user accounts corresponding to those candidate objects. Alternatively, it may involve selecting a portion of the target resources for each candidate object and allocating it to that candidate object. This embodiment of the present disclosure does not limit this approach.

[0083] In summary, the resource processing method provided in this disclosure responds to a weight acquisition operation for any resource request object by determining the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object, which are then used as target parameters. If the target parameters meet a first preset condition, the candidate objects in the candidate object pool are updated based on the target parameters; the candidate objects include resource request objects whose resource allocation parameters meet a second preset condition. If a specified allocation condition is met, the target resource is allocated to the candidate objects in the candidate object pool. In this disclosure, by determining the resource allocation parameters based on the random value and resource weight of the resource request object, and allocating resources based on the resource allocation parameters, the randomness of resource allocation can be ensured to a certain extent, thereby ensuring the fairness and rationality of resource allocation to a certain extent. Furthermore, since the candidate objects are resource request objects whose resource allocation parameters meet the second preset condition, allocation is only performed on resource request objects whose resource allocation parameters meet the second preset condition, thus further ensuring the rationality of resource allocation to a certain extent.

[0084] Meanwhile, in response to the weight acquisition operation of the resource request object and in generating resource weights for the resource request object, the system determines whether to update the candidate objects in the candidate object pool based on the determined current resource allocation parameters. This allows for real-time dynamic updates to the candidate object pool, enabling resource allocation directly to the candidate objects in the pool when specified allocation conditions are met. This reduces the processing load during resource allocation to some extent, shortens the time required for resource allocation, and ensures the stability of the resource allocation service.

[0085] Optionally, the first preset condition includes the target parameter being greater than the resource allocation parameter of the specified object. The specified object is the Nth candidate object in the candidate object pool, sorted from largest to smallest according to the resource allocation parameter. The candidate objects in the candidate object pool can refer to the top N resource request objects sorted from largest to smallest according to the resource allocation parameter. N is a positive integer and can be set according to actual needs; for example, N can be 200, or 150, 300, etc. The specified object can be the 200th candidate object. If the resource allocation parameter of the resource request object is not greater than the resource allocation parameter of the specified object, then the resource request object is not eligible to enter the candidate object pool. Conversely, if the resource allocation parameter of the resource request object is greater than the resource allocation parameter of the specified object, then the resource request object is eligible to enter the candidate object pool. Accordingly, to maintain the number of candidate objects in the candidate object pool and prevent the number of candidate objects from exceeding N, the currently specified object can be removed.

[0086] Accordingly, the step of updating the candidate objects in the candidate object pool based on the target parameters when the target parameters meet the first preset condition can specifically include:

[0087] Step 1021: If the target parameter is greater than the resource allocation parameter of the specified object, and there is no resource request object among the candidate objects, add the resource request object as a candidate object to the candidate object pool.

[0088] If the target parameter is greater than the resource allocation parameter of the specified object, it indicates that the target parameter meets the first preset condition. Furthermore, since a resource weight may have been previously generated for this resource request object, it may have already been added to the candidate object pool as a candidate object. Therefore, in this embodiment, it can be further determined whether the resource request object already exists among the candidate objects, that is, whether the resource request object has been previously identified as a candidate object. If it does not exist, the resource request object is then added to the candidate objects.

[0089] In this embodiment of the disclosure, a resource request object is added as a candidate object only when the target parameter is greater than the resource allocation parameter of the specified object and there is no resource request object among the candidate objects. This avoids unnecessary addition operations and saves processing resources.

[0090] Adding a resource request object as a candidate object to the candidate object pool can specifically include storing the resource request object and the target parameter as elements in the candidate object pool. The candidate object pool can be considered a designated storage area.

[0091] Step 1022: If the resource request object exists in the candidate objects, update the resource allocation parameters of the resource request object in the candidate object pool to the target parameters.

[0092] If the resource request object already exists in the candidate pool, it means that the resource request object has already been added as a candidate. Therefore, the resource allocation parameters of the resource request object in the candidate pool can be directly updated to the target parameters. This ensures the accuracy of the resource allocation parameters of the candidate objects in the pool and avoids the problem of a candidate object being replaced by another resource request object due to untimely updates. It should be noted that the candidate pool can be built based on a Redis data structure (e.g., a sorted set). The candidate objects in the pool are actually ordered, that is, arranged sequentially according to the size of their resource allocation parameters. Updating the resource allocation parameters of the resource request object in the pool to the target parameters will actually affect the sorting of the data in the pool. Since the candidate pool is actually implemented using the Redis sorted set structure, no additional sorting is needed; it can directly rely on the Redis sorted set structure for automatic sorting to ensure sorting accuracy and, to a certain extent, ensure processing efficiency.

[0093] Optionally, in one implementation, the present disclosure may further include the following steps:

[0094] Step 301: When the preset update cycle is reached, determine the objects to be cleared in the candidate object pool; the objects to be cleared are objects in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of the specified object.

[0095] Step 302: Remove the object to be cleared from the candidate object pool.

[0096] Regarding steps 301 to 203 above, the preset update cycle can be set according to actual needs. For example, the preset update cycle can be every two minutes, or it can be every three minutes. Taking two minutes as an example, that is, in this embodiment of the disclosure, the operation of determining the object to be cleared and removing the object to be cleared from the candidate object pool can be performed every two minutes.

[0097] Specifically, objects in the candidate object pool can be sorted in descending order of resource allocation parameters. Objects following a specified object are considered to be cleared, while the specified object and objects preceding it are considered candidate objects. The resource allocation parameters of objects following the specified object are less than those of the specified object.

[0098] Furthermore, removing objects from the candidate object pool can specifically involve deleting the objects and their resource allocation parameters from the candidate object pool. Taking the 200th object in the candidate object pool as an example, if the specified objects are sorted in descending order of resource allocation parameters, then every two minutes, all other objects after the current 200th object in the candidate object pool can be removed, thereby maintaining the length of the candidate object pool at 200.

[0099] In this embodiment, upon reaching a preset update cycle, objects to be removed from the candidate object pool are identified. These objects are those whose resource allocation parameters are less than the resource allocation parameters of a specified object. The objects to be removed are then removed from the candidate object pool. Compared to the previous method of removing a candidate object each time a resource request object is added to the candidate object pool, this embodiment uniformly removes all objects in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of a specified object upon reaching the preset update cycle. This avoids frequently maintaining the length of the candidate object pool, thereby reducing implementation costs.

[0100] Optionally, in one implementation, the specified allocation condition includes the current time reaching a specified time. Accordingly, the step of allocating the target resource to candidate objects in the candidate object pool when the specified allocation condition is met may specifically include:

[0101] Step 1031: If the specified time is reached at the current time, obtain M candidate objects selected from the candidate object pool as target objects; M is a positive integer.

[0102] The specified time can be set according to actual needs. For example, it can be selected from a period when the server load is less than a preset load threshold. For instance, if the server load is low between 10 PM and 12 AM, then a time between 10 PM and 12 AM can be selected as the specified time to avoid service overload during resource allocation, which could affect resource allocation. Alternatively, a time can be randomly selected as the specified time, such as 8 PM. This disclosure does not limit this option.

[0103] Specifically, the selected M candidate objects can be M candidate objects pre-selected before the current time reaches the specified time. When the current time reaches the specified time, the previously selected M candidate objects can be directly read as the target objects to ensure resource allocation efficiency.

[0104] Of course, if the specified time is reached at the current time, M candidate objects can be selected as target objects from the candidate objects currently included in the candidate object pool. This embodiment of the present disclosure does not limit this.

[0105] Step 1032: Allocate resources for the user account represented by the target object.

[0106] In this context, the user account represented by the target object is the user account corresponding to the target object. In one implementation, a resource claim identifier can be assigned to the user account; the user account and the resource claim identifier can uniquely identify a resource request object. For example, candidate objects in the candidate object pool can be stored according to the dimension of the represented user account + resource claim identifier. Each resource allocation task and each resource allocation round can correspond to a different candidate object pool. For instance, different resource allocation rounds of the same resource allocation task can correspond to different candidate object pools, and the same resource allocation round of different resource allocation tasks can correspond to different candidate object pools.

[0107] Furthermore, the maximum number of resource request objects that a user account can correspond to can be equal to the maximum number of resource claim identifiers that can be allocated to the user account. For example, if a user account can only be allocated one resource claim identifier, then the user account can only correspond to one resource request object. If a user account can be allocated P resource claim identifiers, then the user account can correspond to P resource request objects, where P is an integer not less than 2. It should be noted that in this embodiment, resource request objects in the candidate object pool can also be deduplicated according to the resource request object dimension to avoid the existence of identical resource request objects (i.e., the user account and resource claim identifier are the same), thus avoiding the waste of processing resources.

[0108] In this embodiment of the disclosure, when a specified time is reached at the current time, M candidate objects, pre-selected from a pool of candidate objects, are obtained as target objects, where M is a positive integer. Resources are allocated to the user accounts represented by the target objects. This allows resource allocation to be completed in one go at a specified time, thereby ensuring resource allocation efficiency.

[0109] Optionally, before obtaining the M candidate objects selected from the candidate object pool when the specified time is reached at the current time, this embodiment of the disclosure may further include the following steps:

[0110] Step 401: Before the specified time, select M candidate objects from the candidate object pool to obtain M alternative objects.

[0111] Step 402: After waiting for a specified period of time, select M candidate objects from the candidate object pool again, and use the M candidate objects selected this time to overwrite the M candidate objects selected last time, until the preset stopping condition is met.

[0112] Regarding steps 401 to 402 above, this embodiment of the disclosure can specifically begin selecting candidate objects after a preset time period before the specified time. This allows sufficient processing time for handling exceptions, thereby ensuring the stability of resource allocation operations. The preset time period can be set according to actual needs. For example, the preset time period can be related to the size of the candidate object pool; the larger the candidate object pool, i.e., the more candidate objects there are, the longer the preset time period can be, to allow sufficient time for the selection operation. In one implementation, the preset time period can be 5 minutes, or 8 minutes, or 10 minutes; this embodiment of the disclosure does not impose any limitations on this. Further, the specified time period and the preset stop condition can be set according to actual needs. For example, the specified time period can be 1 minute, or 2 minutes. The preset stop condition can be that the number of times the selection of M candidate objects from the candidate object pool reaches a preset threshold, or the time difference between the current time and the specified time is less than the specified time period, or the specified time period is reached.

[0113] Specifically, an object selection task can be run to select M candidate objects from a pool of candidate objects as M alternatives. After a specified waiting period, the object selection task is run again to select M more candidate objects from the pool as new M alternatives. If a preset stopping condition is met, the task can be stopped. Otherwise, after a specified waiting period, the object selection task can be run again to select M more candidate objects from the pool as new M alternatives. In other words, in this embodiment, the object selection task can be run periodically for a specified period, and each time the task is run, the currently selected alternatives overwrite the alternatives selected in the previous execution. It should be noted that in this embodiment, risk control checks can also be performed on the selected candidate objects. Only if a candidate object passes the risk control check is it considered an alternative. Otherwise, a new candidate object is selected. This ensures the security of resource allocation to a certain extent. The risk control check may include detecting whether the user account represented by the candidate object is an abnormal account; if so, it can be determined that the candidate object has failed the risk control check. Conversely, this ensures that the candidate passes the risk control. Of course, risk control detection can also include other components, and this embodiment does not limit this.

[0114] Optionally, in this embodiment of the invention, selecting M candidate objects from the candidate object pool can be done by selecting M candidate objects from the candidate object pool in descending order of resource allocation parameters. That is, selecting the top M candidate objects whose resource allocation parameters are ranked in order. Since the resource weights and random values ​​of the resource application objects are used when calculating the target parameters, the target parameters of each resource application object can be made random. Accordingly, based on the resource application objects whose resource allocation parameters meet the second preset condition as candidate objects, the constructed candidate object pool itself already contains resource application objects randomly selected based on the resource allocation parameters of all users. Therefore, when selecting M candidate objects from the candidate object pool, random allocation can be achieved by directly selecting in order.

[0115] Taking a specified time of 8 PM as an example, starting 5 minutes before the specified time and with a specified duration of 1 minute, the object selection task can start running 5 minutes before 8 PM, that is, the object selection task will start running at 7:55 PM. Afterwards, the object selection task will run once every minute to ensure the fairness of resource allocation as much as possible.

[0116] Accordingly, the step of selecting M candidate objects from the candidate object pool as target objects when the specified time is reached at the current time can specifically include:

[0117] Step 1031a: If the specified time is reached at the current time, obtain the most recently selected M candidate objects as the target object.

[0118] Specifically, the M candidate objects obtained from the last run of the object selection task can be directly read. In this way, by pre-selecting M candidate objects, the target object can be obtained by directly reading the most recently selected M candidate objects at a specified time. This allows for convenient and fast selection of the target object, achieving near real-time resource allocation. This can reduce the time consumption of resource allocation operations to a certain extent and ensure stable resource allocation.

[0119] In this embodiment, since resource requesters may apply for resource allocation at different times, for example, a resource weight is generated for a new resource requester close to a specified time. In response to the resource requester's weight acquisition operation, this embodiment determines the current resource allocation parameters of the resource requester based on the generated resource weight and updates the candidate pool in real time based on these parameters. Furthermore, when selecting M candidate objects, each selection is made after a specified waiting period. This ensures that even resource requesters participating in resource allocation close to a specified time may be added to the candidate pool (e.g., if their resource allocation parameters are greater than those of a specified object in the pool) and selected. Therefore, the fairness of resource allocation can be further ensured. Moreover, the increased speed of resource allocation at a specified time allows user accounts to participate close to the allocation time and be added to the candidate pool.

[0120] For example, Figure 2 This is an interactive schematic diagram provided by an embodiment of the present disclosure. In one application scenario, the candidate object pool can be located in a Redis database. For example, the candidate object pool can be built based on a Redis data structure (e.g., a zset). The candidate objects in the candidate object pool can be arranged in descending order according to the size of the resource allocation parameters, that is, the larger the resource allocation parameter, the higher the candidate object appears. The above-mentioned operation of selecting candidate objects can be implemented based on a selection center. Specifically, it can be based on a timed task sharding triggering mechanism to trigger the selection center to process the candidate objects in the candidate object pool in a loop, that is, to select M candidate objects from the candidate objects in the candidate object pool and add a mark to these M candidate objects stored in the Redis database for easy identification. And replace the previously selected M candidate objects with the selected M candidate objects. The task can be terminated when a preset stopping condition is met. It should be noted that the selection center can first read the activity data of this resource allocation activity from the MySQL database. The activity data can include data indicating the candidate object pool corresponding to this resource allocation activity, the specific value of M, etc.

[0121] Furthermore, upon reaching a specified time, the allocation of target resources can be triggered based on a scheduled task sharding mechanism. Specifically, the selection center can retrieve the most recently selected M candidate objects from the Redis database as target objects. Then, iterate through the target objects to allocate target resources to the user accounts corresponding to each target object through the resource allocation center. Multiple target resources can be allocated, and if not all target resources have been allocated, the resource allocation center can continue to allocate the remaining target resources to the user accounts corresponding to the remaining target objects.

[0122] Furthermore, Figure 2 The dashed arrows indicate response information returned by the Redis database, MySQL database, or resource provisioning center to the selection center. This response information can indicate that a request was received from the selection center, such as a read request, a tag request, a replace request, a pull request, or a resource provisioning request. Specifically, a read request is used to read the activity data of the resource allocation activity; a tag request is used to tag the M selected candidate objects; a replace request is used to replace the previously selected M candidate objects; and a pull request and a provisioning request are used to pull the most recently selected M candidate objects as the target objects and to provision the target resources, respectively.

[0123] Optionally, the step of determining the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object may specifically include:

[0124] Step 1011: If the resource weight is the first resource weight generated for the resource application object, then calculate the current resource allocation parameters of the resource application object based on the random value corresponding to the resource application object and the resource weight.

[0125] Step 1012: If the resource weight is not the first resource weight generated for the resource request object, then calculate the current resource weight of the resource request object based on the resource weight and the resource weights previously generated for the resource request object; calculate the current resource allocation parameters of the resource request object based on the random value corresponding to the resource request object and the current resource weight.

[0126] Regarding steps 1011 and 1012 above, the random number is valid only in the current round of the current resource allocation activity. That is, the random number for each user account is calculated only once within a single round. This random number can be bound to the user account represented by the resource application object and recorded in the Resid database. Accordingly, when generating resource weights for resource application objects corresponding to the same user account again, this random number can be directly reused to improve processing efficiency. In other words, in this embodiment of the disclosure, even if the resource weight is not the first resource weight generated for the resource application object, the previously generated random number can be directly obtained.

[0127] Furthermore, the current resource allocation parameters of the resource requesting object can be set according to actual needs. For example, the current resource allocation parameters of the resource requesting object can be calculated using a preset formula: (random number)^(1 / current accumulated resource weight). That is, the current resource allocation parameters of the resource requesting object are obtained through weighted randomization.

[0128] If the resource weight is the first resource weight generated for the resource requesting object, then the currently accumulated resource weight is the resource weight generated for this resource requesting object in this instance. If the resource weight is not the first resource weight generated for the resource requesting object, then the currently accumulated resource weight is the resource weight generated for this resource requesting object in this instance plus the resource weights generated previously for this resource requesting object. In this way, by incrementally calculating the current resource allocation parameters for the resource requesting object based on the currently accumulated resource weight each time a resource weight is generated, the update efficiency of the candidate object pool can be improved to some extent.

[0129] For example, suppose that for user account 001, a random number u = 0.32 is generated for user account 001, and user account 001 completes tasks A, B and C respectively. Accordingly, in response to user account 001 completing tasks A, B and C respectively, resource weights Wa = 2, Wb = 3 and Wc = 5 are generated for user account 001 respectively.

[0130] Assuming the candidate pool length remains at 3, and the resource allocation parameters for the three candidate objects (ticket1, ticket2, and ticket3) are currently in the pool as follows: ticket1-k = 0.999, ticket2-k = 0.795, and ticket3-k = 0.687, respectively. Correspondingly, upon completing task A, the current accumulated resource weight is 2. Taking the formula for calculating the resource allocation parameter of a resource request object as ki = (ui)^(1 / wi), where ui = 0.32, the current wi represents the current accumulated resource weight of 2. Accordingly, the current resource allocation parameter for the resource request object corresponding to user account 001 is 0.565. Since this is less than the resource allocation parameter of the specified object ticket3 (0.687), it did not enter the candidate pool this time. Next, with task B completed, the current accumulated resource weight is 2 + 3 = 5. Accordingly, the current resource allocation parameter for the resource request object corresponding to user account 001 is calculated to be 0.687. Since the resource request object corresponding to user account 001 was not previously in the candidate object pool, and its resource allocation parameter exceeds the specified object's resource allocation parameter, it can be added to the candidate object pool this time, ranking third. Next, with task C completed, the current accumulated resource weight is 2 + 3 + 5 = 10. Accordingly, the current resource allocation parameter for the resource request object corresponding to user account 001 is calculated to be 0.892. Since the resource request object corresponding to user account 001 has already entered the candidate object pool, and its current resource allocation parameter exceeds the specified object's resource allocation parameter, the resource allocation parameter for the resource request object corresponding to user account 001 can be updated to 0.892 this time.

[0131] For example, Figure 3 This is a schematic diagram of a processing procedure provided in an embodiment of this disclosure, such as... Figure 3 As shown, if the calculated current k value is greater than the minimum k value in the candidate object pool, it can be further determined whether the ticket already exists. If so, the ticket record can be updated accordingly, that is, the k value of the ticket can be updated to the calculated current k value. If not, the ticket with the minimum k value can be used to replace the ticket with the minimum k value. Here, the k value is the resource allocation parameter, and the ticket with the minimum k value refers to the aforementioned specified object.

[0132] For example, Figure 4This is another interactive schematic diagram provided by an embodiment of the present disclosure. In this application scenario, a user account can obtain a ticket, that is, request the selection center to generate a resource application object corresponding to the user account. Next, the selection center can record the ticket corresponding to the user account in a record table in the MySQL database for data backup and storage. Then, the Redis database can be updated, that is, the user account and its corresponding ticket can be written to the Redis database to facilitate the subsequent generation of resource allocation parameters for the ticket.

[0133] Furthermore, a random number can be set for the user account corresponding to the ticket in this round based on the Redis database, or the random number can be read from the database when needed. The selection center can read the weight record corresponding to the ticket's identifier (ticket ID) from the Redis database. The ticket ID can consist of the user account and the resource claim identifier. This weight record represents the resource weights generated for the ticket in this round. Next, resource allocation parameters can be calculated for the ticket. If the ticket meets the first preset condition, it is added to the candidate pool. Specifically, the ticket ID can be used as a member, and the resource allocation parameters as the member's score, both added to the candidate pool.

[0134] Furthermore, the selection center can also maintain the length of the candidate object pool periodically based on a scheduled task triggering mechanism, that is, clear the objects to be cleared from the candidate object pool. In this way, by maintaining M candidate objects and pre-determining the range of resource allocation according to resource allocation parameters, the scale of data processing during subsequent resource allocation can be reduced, thereby shortening the time consumed by resource allocation and ensuring the stability of the resource allocation service.

[0135] in, Figure 4 The dashed arrows indicate response information returned by the Redis or MySQL database. This response information can indicate that a request has been received from the selection center; for example, the response information can be an ACK message. For instance, it could indicate that a record request, update request, set or read request, add request, or delete request has been received. A record request is used to record data in the MySQL database table; an update request is used to update the Redis database; a set or read request is used to set or read the random number in the current round; and add and delete requests are used to add the ticket to the candidate pool and remove objects from the candidate pool, respectively, if the ticket meets a first preset condition.

[0136] Furthermore, the Redis database can employ a dual-datacenter cold standby mode, with all commands synchronized to the backup datacenter via Kafka. This allows for switching to the backup datacenter when the current datacenter becomes unavailable, minimizing impact. Additionally, if network issues cause Redis database operations to fail, requests sent to Redis can be added to a failure queue for retrying until successful. Due to the high access speed of the Redis database, this embodiment ensures efficient resource allocation by reading data from Redis. Simultaneously, data backup is performed using a MySQL database to ensure data security.

[0137] Compared to the method of uniformly traversing all resource request objects participating in resource allocation one by one before a specified time, determining resource allocation parameters for each resource request object, and selecting target objects based on the resource allocation parameters, the offline traversal of all resource request objects participating in resource allocation takes a long time, and cannot guarantee stable resource allocation at the specified time. Furthermore, if new resource request objects appear after the traversal begins, these objects cannot participate in the traversal, thus failing to participate in resource allocation and reducing the fairness of resource allocation. In addition, compared to uniformly generating globally unique identifiers for each resource request object and randomly selecting objects based on these globally unique identifiers at a specified time, this embodiment maintains a candidate object pool based on resource allocation parameters and allocates resources to users who enter the candidate object pool. Since the resource allocation parameters of objects entering the candidate object pool are higher, it can ensure the rationality of resource allocation to a certain extent while ensuring fairness. It also avoids the problem of excessive processing pressure when uniformly generating globally unique identifiers. Furthermore, in this embodiment of the present disclosure, the method of updating the candidate object pool after generating resource weights for resource request objects each time can achieve near real-time updates to the candidate object pool while satisfying weighted randomness. This can avoid processing resource request objects in a concentrated manner before or at a specified time, thereby ensuring the subsequent resource allocation speed and the stability of the system during allocation to a certain extent.

[0138] Figure 5 This is a block diagram illustrating a resource processing apparatus according to an exemplary embodiment, such as... Figure 5 As shown, the device 50 may include:

[0139] The first determining module 501 is configured to, in response to a weight acquisition operation of any resource request object, determine the current resource allocation parameters of the resource request object as target parameters based on the resource weight generated for the resource request object and the random value corresponding to the resource request object.

[0140] The update module 502 is configured to update the candidate objects in the candidate object pool based on the target parameters when the target parameters meet the first preset condition; the candidate objects include resource application objects whose resource allocation parameters meet the second preset condition.

[0141] The allocation module 503 is configured to allocate target resources to candidate objects in the candidate object pool when specified allocation conditions are met.

[0142] In one optional embodiment, the first preset condition includes the target parameter being greater than the resource allocation parameter of a specified object, wherein the specified object is the Nth candidate object in the candidate object pool when the current candidate objects in the candidate object pool are sorted in descending order of resource allocation parameters, and N is a positive integer;

[0143] The update module 502 is specifically configured as follows:

[0144] If the target parameter is greater than the resource allocation parameter of the specified object, and there is no resource request object among the candidate objects, the resource request object is added to the candidate object pool as a candidate object.

[0145] If the resource request object exists among the candidate objects, the resource allocation parameters of the resource request object in the candidate object pool are updated to the target parameters.

[0146] In one alternative embodiment, the device 50 further includes:

[0147] The second determining module is configured to determine objects to be cleared in the candidate object pool when a preset update cycle is reached; the objects to be cleared are objects in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of the specified object.

[0148] The removal module is configured to remove the object to be removed from the candidate object pool.

[0149] In one optional embodiment, the specified allocation condition includes the current time reaching a specified time; the allocation module 503 is specifically configured as follows:

[0150] If the specified time is reached at the current time, obtain M candidate objects selected from the candidate object pool as the target object; where M is a positive integer.

[0151] Resource allocation is performed for the user accounts represented by the target object.

[0152] In one alternative embodiment, the device 50 further includes:

[0153] The selection module is configured to select M candidate objects from the candidate object pool before the specified time, thus obtaining M alternative objects;

[0154] The reselection module is configured to select M candidate objects from the candidate object pool after waiting for a specified time, and use the M candidate objects selected this time to overwrite the M candidate objects selected last time, until a preset stopping condition is met.

[0155] The allocation module 503 is further configured to: when the specified time is reached at the current time, obtain the most recently selected M candidate objects as the target object.

[0156] In one alternative embodiment, the selection module is specifically configured as follows:

[0157] M candidate objects are selected from the candidate object pool in descending order of resource allocation parameters.

[0158] In one alternative embodiment, the first determining module 501 is specifically configured as follows:

[0159] If the resource weight is the first resource weight generated for the resource request object, then the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the resource weight.

[0160] If the resource weight is not the first resource weight generated for the resource request object, then the current resource weight of the resource request object is calculated based on the resource weight and the resource weights previously generated for the resource request object; and the current resource allocation parameters of the resource request object are calculated based on the random value corresponding to the resource request object and the current resource weight.

[0161] In summary, the resource processing apparatus provided in this disclosure, in response to a weight acquisition operation of any resource request object, determines the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object, and uses these parameters as target parameters. If the target parameters meet a first preset condition, the candidate objects in the candidate object pool are updated based on the target parameters; the candidate objects include resource request objects whose resource allocation parameters meet a second preset condition. If a specified allocation condition is met, the target resource is allocated to the candidate objects in the candidate object pool. In this disclosure, by determining the resource allocation parameters based on the random value and resource weight of the resource request object, and allocating resources based on the resource allocation parameters, the randomness of resource allocation can be ensured to a certain extent, thereby ensuring the fairness and rationality of resource allocation to a certain extent. Furthermore, since the candidate objects are resource request objects whose resource allocation parameters meet the second preset condition, allocation is only performed on resource request objects whose resource allocation parameters meet the second preset condition, thus further ensuring the rationality of resource allocation to a certain extent.

[0162] Meanwhile, in response to the weight acquisition operation of the resource request object and in generating resource weights for the resource request object, the system determines whether to update the candidate objects in the candidate object pool based on the determined current resource allocation parameters. This allows for real-time dynamic updates to the candidate object pool, enabling resource allocation directly to the candidate objects in the pool when specified allocation conditions are met. This reduces the processing load during resource allocation to some extent, shortens the time required for resource allocation, and ensures the stability of the resource allocation service.

[0163] According to one embodiment of the present disclosure, an electronic device is provided, including: a processor and a memory for storing processor-executable instructions, wherein the processor is configured to perform, when executing, steps in the resource processing method as described in any of the above embodiments.

[0164] According to one embodiment of this disclosure, a storage medium is also provided, which, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the steps in the resource processing method as described in any of the above embodiments.

[0165] According to one embodiment of this disclosure, a computer program product is also provided, which includes readable program instructions that, when executed by a processor of an electronic device, enable the electronic device to perform steps in the resource processing method as described in any of the above embodiments.

[0166] Figure 6This is a block diagram illustrating an apparatus for resource processing according to an exemplary embodiment. The apparatus 600 may include a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output interface 612, a sensor component 614, a communication component 616, and a processor 620. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the resource processing method described above. In an exemplary embodiment, a storage medium including instructions is also provided, such as the memory 604 including instructions, which can be executed by the processor 620 of the apparatus 600 to complete the method described above. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0167] Figure 7 This is a block diagram illustrating another apparatus for resource processing according to an exemplary embodiment.

[0168] The device 700 may include a processing component 722, a memory 732, an input / output interface 758, a network interface 750, and a power supply component 726. The device 700 may be provided as a server. The application program stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 722 is configured to execute instructions to perform the resource processing method described above.

[0169] All user information (including but not limited to user device information, user personal information, etc.) and related data involved in this disclosure are information authorized by the user or by the parties involved.

[0170] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0171] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A resource processing method, characterized in that, The method includes: In response to the weight acquisition operation of any resource request object, the current resource allocation parameters of the resource request object are determined based on the resource weight generated for the resource request object and the random value corresponding to the resource request object, and are used as target parameters; the resource weight is positively correlated with the activity level of the user account represented by the resource request object; If the target parameters meet the first preset condition, the candidate objects in the candidate object pool are updated based on the target parameters; the candidate objects include resource request objects whose resource allocation parameters meet the second preset condition. When the specified allocation conditions are met, the target resource is allocated to the candidate object in the candidate object pool; The step of determining the current resource allocation parameters of the resource request object based on the resource weight generated for the resource request object and the random value corresponding to the resource request object includes: If the resource weight is the first resource weight generated for the resource request object, then the current resource allocation parameter of the resource request object is calculated based on the random value corresponding to the resource request object and the resource weight: resource allocation parameter = (random value)^(1 / resource weight); If the resource weight is not the first resource weight generated for the resource request object, then the current resource weight of the resource request object is calculated based on the resource weight and the resource weights previously generated for the resource request object; the current resource allocation parameter of the resource request object is calculated based on the random value corresponding to the resource request object and the current resource weight: resource allocation parameter = (random value)^(1 / resource weight).

2. The method according to claim 1, characterized in that, The first preset condition includes that the target parameter is greater than the resource allocation parameter of the specified object, wherein the specified object is the Nth candidate object in the candidate object pool when the current candidate objects in the candidate object pool are sorted in descending order of resource allocation parameters, and N is a positive integer; The step of updating the candidate objects in the candidate object pool based on the target parameters when the target parameters meet the first preset condition includes: If the target parameter is greater than the resource allocation parameter of the specified object, and there is no resource request object among the candidate objects, the resource request object is added to the candidate object pool as a candidate object. If the resource request object exists among the candidate objects, the resource allocation parameters of the resource request object in the candidate object pool are updated to the target parameters.

3. The method according to claim 2, characterized in that, The method further includes: When a preset update cycle is reached, objects to be cleared in the candidate object pool are identified; the objects to be cleared are those in the candidate object pool whose resource allocation parameters are less than the resource allocation parameters of the specified object. Remove the object to be cleared from the candidate object pool.

4. The method according to claim 1, characterized in that, The specified allocation condition includes the current time reaching a specified time; the step of allocating the target resource to the candidate objects in the candidate object pool when the specified allocation condition is met includes: If the specified time is reached at the current time, obtain M candidate objects selected from the candidate object pool as the target object; where M is a positive integer. Resource allocation is performed for the user accounts represented by the target object.

5. The method according to claim 4, characterized in that, Before obtaining the M candidate objects selected from the candidate object pool when the specified time is reached at the current time, the method further includes: Before the specified time, select M candidate objects from the candidate object pool to obtain M alternative objects; After waiting for a specified period of time, M candidate objects are selected again from the candidate object pool, and the M candidate objects selected this time are used to overwrite the M candidate objects selected last time, until the preset stopping condition is met. The step of obtaining M candidate objects selected from the candidate object pool as the target object when the current time reaches the specified time includes: obtaining the most recently selected M candidate objects as the target object when the current time reaches the specified time.

6. The method according to claim 5, characterized in that, The step of selecting M candidate objects from the candidate object pool includes: M candidate objects are selected from the candidate object pool in descending order of resource allocation parameters.

7. A resource processing device, characterized in that, The device includes: The first determining module is configured to respond to a weight acquisition operation for any resource request object by determining the current resource allocation parameter of the resource request object as a target parameter based on the resource weight generated for the resource request object and the random value corresponding to the resource request object: if the resource weight is the first resource weight generated for the resource request object, then the current resource allocation parameter of the resource request object is calculated based on the random value corresponding to the resource request object and the resource weight: resource allocation parameter = (random value)^(1 / resource weight); if the resource weight is not the first resource weight generated for the resource request object, then the current resource weight of the resource request object is calculated based on the resource weight and the resource weights previously generated for the resource request object; the current resource allocation parameter of the resource request object is calculated based on the random value corresponding to the resource request object and the current resource weight: resource allocation parameter = (random value)^(1 / resource weight); wherein, the resource weight is positively correlated with the activity level of the user account represented by the resource request object; The update module is configured to update the candidate objects in the candidate object pool based on the target parameters when the target parameters meet a first preset condition; the candidate objects include resource request objects whose resource allocation parameters meet a second preset condition. The allocation module is configured to allocate target resources to candidate objects in the candidate object pool when specified allocation conditions are met.

8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device performs the method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Resource processing method and device, server and storage medium

    CN111612520A

  • Sandbox task scheduling method and system

    CN113419831A