Resource allocation method and device, equipment and storage medium

By receiving resource allocation requests and traversing the out-of-order resource list, judging the effective time range and residual amount of resources, the problem of how to reasonably allocate virtual resources of interactive tasks is solved, and the resource utilization rate is improved.

CN119515460APending Publication Date: 2025-02-25CHINA CONSTRUCTION BANK +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411523135.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In interactive tasks, how to reasonably allocate virtual resources to corresponding users and improve resource utilization.

Method used

By receiving resource allocation requests, obtaining the target time point, and obtaining the resource list corresponding to the interactive task, traversing it in an out-of-order manner, determining and allocating virtual resources.

Benefits of technology

Effectively and reasonably allocate virtual resources to the target account to avoid idle or overuse of resources, and improve the utilization rate of interactive task resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515460A_ABST
    Figure CN119515460A_ABST
Patent Text Reader

Abstract

The invention provides a resource allocation method and device, equipment and a storage medium. Relates to the technical field of computers. The method comprises the steps that after a resource allocation request is received, a target time point when the resource allocation request is received is obtained, a resource list corresponding to an interaction task is disordered, the disordered resource list is traversed in sequence, the target time point is determined to be included in a resource effective time range of a traversed first target resource, and the target time point is determined to be within a resource effective time range of the traversed first target resource; and determining that the first target resource is a virtual resource allocated to the target account under the condition that the current resource residual amount of the first target resource in the resource effective time range is greater than zero, ending traversal, and allocating the first target resource to the target account. Therefore, the virtual resources can be effectively and reasonably allocated, some resources of the interaction task are prevented from being idle, some resources are prevented from being utilized too much, and the utilization rate of the resources of the interaction task is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a resource allocation method, device, equipment and storage medium. Background Art

[0002] At present, with the acceleration of digital transformation, the popularization of online services and the diversification of user needs, the scenarios of interactive tasks are becoming increasingly rich. These scenarios are not limited to traditional customer support and consulting services, but also extend to online education, social platforms, e-commerce and other fields. Interactive tasks come in various forms, including lucky draws, coupon distribution, questionnaires, comments or voting during live broadcasts, etc.

[0003] In an interactive task, a plurality of different resources are usually set for the interactive task. After receiving a resource allocation request, how to reasonably allocate the virtual resources of the interactive task to the corresponding user is very important for improving the utilization rate of the resources of the interactive task. Summary of the invention

[0004] The present application provides a resource allocation method, device, equipment and storage medium to solve the problem in the related art of how to allocate virtual resources of the interactive task to the corresponding user and improve the utilization rate of the resources of the interactive task.

[0005] In a first aspect, the present application provides a resource allocation method, the method comprising: receiving a resource allocation request, and obtaining a target time point for receiving the resource allocation request, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account; obtaining a first resource list corresponding to the interactive task, and shuffling the resources in the first resource list to obtain a second resource list; sequentially traversing the second resource list, and for the traversed first target resource, determining whether a resource validity time range of the first target resource includes the target time point, and determining whether a current remaining amount of resources of the first target resource within the resource validity time range is greater than zero; if the resource validity time range of the first target resource includes the target time point, and the current remaining amount of resources of the first target resource within the resource validity time range is greater than zero, determining that the first target resource is a virtual resource allocated to the target account; allocating the first target resource to the target account, and ending the traversal.

[0006] In a second aspect, the present application provides a resource allocation device, which includes: a first processing module, used to receive a resource allocation request and obtain a target time point for receiving the resource allocation request, wherein the resource allocation request is used to request that the virtual resource corresponding to the interactive task be allocated to the target account; a second processing module, used to obtain a first resource list corresponding to the interactive task, and shuffle the resources in the first resource list to obtain a second resource list; a judgment module, used to sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero; a determination module, used to determine that the first target resource is a virtual resource allocated to the target account if the resource validity time range of the first target resource includes the target time point and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero; an allocation module, used to allocate the first target resource to the target account and end the traversal.

[0007] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the resource allocation method disclosed in an embodiment of the present application.

[0008] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the resource allocation method disclosed in the embodiment of the present application.

[0009] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the resource allocation method disclosed in an embodiment of the present application.

[0010] The technical solution of this application has the following advantages or beneficial effects:

[0011] After receiving a resource allocation request, the target time point at which the resource allocation request is received is obtained, and the first resource list corresponding to the interactive task is obtained, and the resources in the first resource list are shuffled to obtain a second resource list, and the second resource list is sequentially traversed. For the traversed first target resource, when it is determined that the target time point is included in the resource effective time range of the first target resource, and the current resource remaining amount of the first target resource in the resource effective time range is greater than zero, the first target resource is determined to be a virtual resource allocated to the target account, and the traversal is terminated; the first target resource is allocated to the target account. Thus, by shuffling the resource list of the interactive task, it is possible to avoid some resources of the interactive task being idle while some resources being overused. In addition, by combining the relationship between the time point at which the resource allocation request is received and the resource effective time range of the traversed resource, and the current resource remaining amount of the traversed resource in the resource effective time range, it is possible to effectively and reasonably allocate virtual resources to the target account, thereby improving the resource utilization rate of the interactive task. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0013] Figure 1 The process of the resource allocation method provided in the embodiment of the present application Figure 1 ;

[0014] Figure 2 The process of the resource allocation method provided in the embodiment of the present application Figure 2 ;

[0015] Figure 3 The process of the resource allocation method provided in the embodiment of the present application Figure 3 ;

[0016] Figure 4 The process of the resource allocation method provided in the embodiment of the present application Figure 4 ;

[0017] Figure 5 A schematic diagram of the structure of a resource allocation device provided in an embodiment of the present application;

[0018] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0019] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0021] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties. The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant laws and regulations of the relevant regions.

[0022] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0023] In order to achieve the purpose of allocating virtual resources of the interactive task to the corresponding user and improve the utilization rate of the resources of the interactive task, the present application proposes a resource allocation method, which proposes the following technical ideas: after receiving a resource allocation request, obtaining the target time point of receiving the resource allocation request, and obtaining the first resource list corresponding to the interactive task, scrambling the resources in the first resource list to obtain a second resource list, and sequentially traversing the second resource list, for the traversed first target resource, when it is determined that the target time point is included in the resource effective time range of the first target resource, and the current resource remaining amount of the first target resource in the resource effective time range is greater than zero, determining that the first target resource is a virtual resource allocated to the target account, and ending the traversal; allocating the first target resource to the target account. Thus, by scrambling the resource list of the interactive task, it is possible to avoid some resources of the interactive task being idle and some resources being overused. In addition, combined with the relationship between the time point of receiving the resource allocation request and the resource effective time range of the traversed resource and the current resource remaining amount of the traversed resource in the resource effective time range, it is possible to effectively and reasonably allocate virtual resources to the target account, thereby improving the utilization rate of the resources of the interactive task.

[0024] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0025] First combine Figure 1 , an exemplary description is given of the resource allocation method provided in the embodiment of the present application.

[0026] Figure 1 The process of the resource allocation method provided in the embodiment of the present application Figure 1 .

[0027] It should be noted that the resource allocation method provided in the embodiment of the present application can be executed by a resource allocation device, wherein the resource allocation device can be an electronic device, or can be configured in an electronic device to implement a resource allocation function.

[0028] The electronic device may be any device with computing capabilities, such as a personal computer, a mobile terminal, a server, etc. The mobile terminal may be a mobile phone, a tablet computer, a personal digital assistant, or other hardware device with various operating systems, touch screens, and / or display screens. It should be noted that the electronic device is a server in this embodiment for illustrative description.

[0029] like Figure 1 As shown, the resource allocation method includes the following steps:

[0030] S101, receiving a resource allocation request and obtaining a target time point at which the resource allocation request is received, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account.

[0031] Among them, the virtual resources in this embodiment refer to non-physical resources used in a digital environment. As an example, the virtual resources can be virtual funds, such as electronic red envelopes, electronic vouchers or electronic coupons, etc.; as another example, the virtual resources can be multimedia resources, such as movies, music, documents, pictures, etc. This embodiment does not specifically limit virtual resources.

[0032] Among them, the interactive tasks in this embodiment refer to activities that require participants to actively participate and interact with other people or systems. For example, the virtual resources are electronic vouchers, and the corresponding interactive tasks may include but are not limited to filling out questionnaires, social sharing, purchase completion, clicking on the button to receive electronic vouchers, etc. This embodiment does not specifically limit the interactive tasks.

[0033] S102, obtaining a first resource list corresponding to the interactive task, and shuffling the resources in the first resource list to obtain a second resource list.

[0034] In this embodiment, by shuffling the first resource list corresponding to the interactive task, it is possible to avoid some resources of the interactive task being idle while some resources are over-utilized, optimize the resource usage of the interactive task, ensure balanced distribution of resources, achieve efficient utilization of the resources of the interactive task, and improve the utilization rate of the resources of the interactive task.

[0035] S103, sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero.

[0036] In this embodiment, the second resource list may be traversed in a preset resource traversal order. For example, the second resource list may be traversed in a front-to-back order. That is, the resources in the second resource list may be traversed in sequence in a front-to-back order. For another example, the second resource list may be traversed in a back-to-front order. This embodiment does not specifically limit the preset resource traversal order, and the resource traversal order may be set according to actual needs.

[0037] S104: If the resource validity time range of the first target resource includes the target time point, and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, determine that the first target resource is a virtual resource allocated to the target account.

[0038] S105: Allocate the first target resource to the target account, and end the traversal.

[0039] In this embodiment, when allocating the first target resource to the target account, in order to timely update the current resource remaining amount of the first target resource within the resource validity time range, the current remaining resource quantity can also be reduced by 1 to achieve the update of the current resource remaining amount.

[0040] The resource allocation method provided in the embodiment of the present application, after receiving a resource allocation request, obtains the target time point of receiving the resource allocation request, obtains the first resource list corresponding to the interactive task, shuffles the resources in the first resource list to obtain a second resource list, and sequentially traverses the second resource list. For the traversed first target resource, when it is determined that the target time point is included in the resource effective time range of the first target resource, and the current resource remaining amount of the first target resource in the resource effective time range is greater than zero, the first target resource is determined to be a virtual resource allocated to the target account, and the traversal is terminated; the first target resource is allocated to the target account. Thus, by shuffling the resource list of the interactive task, it is possible to avoid some resources of the interactive task being idle while some resources being overused. In addition, by combining the relationship between the time point of receiving the resource allocation request and the resource effective time range of the traversed resource and the current resource remaining amount of the traversed resource in the resource effective time range, it is possible to effectively and reasonably allocate virtual resources to the target account, thereby improving the resource utilization rate of the interactive task.

[0041] Figure 2 The process of the resource allocation method provided in the embodiment of the present application Figure 2 .

[0042] like Figure 2 As shown, the resource allocation method includes the following steps:

[0043] S201, receiving a resource allocation request and obtaining a target time point at which the resource allocation request is received, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account.

[0044] S202, obtaining a first resource list corresponding to the interactive task, and shuffling the resources in the first resource list to obtain a second resource list.

[0045] In one embodiment of the present application, before obtaining the first resource list corresponding to the interactive task, the following may also be included: obtaining the task effective time range of the interactive task; judging whether the interactive task is effective according to the target time point and the task effective time range; and executing the step of obtaining the first resource list corresponding to the interactive task if the interactive task is effective. Thus, by combining the target time point of the resource allocation request and the task effective time range of the interactive task, it is possible to accurately judge whether the interactive task is effective, and only if the interactive task is effective, the first resource list corresponding to the interactive task is obtained, so that there is no need to process the resource allocation request whose time point is not within the task effective time range, thus avoiding unnecessary waste of resources.

[0046] It should be noted that, when the target time point is within the effective time range of the task, the interactive task is effective, and when the target time point is not within the effective time range of the task, the interactive task is invalid.

[0047] S203, sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero.

[0048] S204: If the resource validity time range of the first target resource includes the target time point, and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, determine that the first target resource is a virtual resource allocated to the target account.

[0049] S205: Allocate the first target resource to the target account, and end the traversal.

[0050] It should be noted that, for the specific description of S201 to S205, reference may be made to the relevant description in other embodiments, which will not be repeated here.

[0051] S206: If the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, it is determined that the first target resource is not a virtual resource allocated to the target account.

[0052] That is, when the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, the first target resource cannot be used as a virtual resource allocated to the target account.

[0053] S207, taking the next resource that is located after the first target resource in the position sequence in the second resource list as the first target resource, and jumping to the step of determining whether the resource validity time range of the first target resource includes the target time point, and determining whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, until it is determined that the first target resource is a virtual resource allocated to the target account, or, traversing to the last resource in the second resource list, and determining that the last resource is not a virtual resource allocated to the target account.

[0054] In this embodiment, when the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, the next resource after the first target resource in the second resource list is processed until a virtual resource that can be allocated to the target account is obtained, or the last resource in the second resource list is traversed and it is determined that the last resource is not a virtual resource allocated to the target account. This helps to comprehensively evaluate the entire resource situation in the second resource list and improve the success rate of obtaining virtual resources allocated to the target account.

[0055] Based on the above embodiment, the method may further include: when it is determined that the last resource is not a virtual resource allocated to the target account, determining that there is no virtual resource allocated to the target account in the second resource list, and sending a prompt message to the target account, wherein the prompt message is used to indicate that the target account is not allocated to the virtual resource of the interactive task. Thus, the user of the target account can conveniently know that the target account is not allocated to the virtual resource of the interactive task through the prompt message.

[0056] Figure 3 The process of the resource allocation method provided in the embodiment of the present application Figure 3 .

[0057] like Figure 3 As shown, the resource allocation method includes the following steps:

[0058] S301, receiving a resource allocation request, and obtaining a target time point and a target date of receiving the resource allocation request, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account.

[0059] S302, obtaining the effective time range of the interactive task.

[0060] It should be noted that the effective time range of the interactive task is preset according to actual needs.

[0061] The effective time range of a task is composed of the effective start time of the task and the effective end time of the task.

[0062] S303, judging whether the interactive task is valid according to the target time point and the effective time range of the task, if so, executing S304, otherwise ending.

[0063] It should be noted that if the target time point is within the effective time range of the task, the interactive task is determined to be valid; correspondingly, if the target time point is not within the effective time range of the task, the interactive task is determined to be invalid at the target time point.

[0064] S304, determine whether the target account is qualified to obtain the virtual resources of the interactive task, if so, execute S305, otherwise end.

[0065] In this embodiment, whether the target account is eligible to obtain the virtual resources of the interactive task may be determined based on the number of times the target account has participated in the interactive task and / or the number of resources that the target account has been allocated for the interactive task.

[0066] As an example, it can be determined whether the number of times the target account participates in the interactive task is less than or equal to a preset threshold number. If so, it is determined that the target account is qualified to obtain the virtual resources of the interactive task. If not, it is determined that the target account is not qualified to obtain the virtual resources of the interactive task.

[0067] As another example, it can be determined whether the number of resources allocated to the target account for the interactive task is less than or equal to a preset resource quantity threshold. If so, it is determined that the target account is eligible to obtain the virtual resources of the interactive task. If not, it is determined that the target account is not eligible to obtain the virtual resources of the interactive task.

[0068] As another example, it can be determined whether the number of times the target account has participated in the interactive task is less than or equal to a preset number threshold, and whether the number of resources allocated to the target account for the interactive task is less than or equal to a preset resource quantity threshold. If so, it is determined that the target account is eligible to obtain the virtual resources of the interactive task; if the number of times the target account has participated in the interactive task is greater than the preset number threshold, and / or the number of resources allocated to the target account for the interactive task is greater than the preset resource quantity threshold, it is determined that the target account is not eligible to obtain the virtual resources of the interactive task.

[0069] In this embodiment, when it is determined that the interactive task is valid, the target account's eligibility to obtain the virtual resources of the interactive task is further judged, so that subsequent resource allocation processing is only performed on the target account that is entitled to obtain the virtual resources of the interactive task, avoiding resource allocation processing for the virtual resources that are not entitled to obtain the interactive task, which is beneficial to protecting the resources of the interactive task and avoiding unnecessary waste of resources.

[0070] It should be noted that, when it is determined that the target account does not have the qualifications to obtain the virtual resources of the interactive task, a corresponding prompt message is sent to the target account to prompt the target account that the target account does not have the qualifications to obtain the virtual resources of the interactive task. In addition, the prompt message may also include: the reason why the target account does not have the right to obtain the virtual resources of the interactive task. Thus, the corresponding user can conveniently obtain the reason why the target account does not have the right to obtain the virtual resources of the interactive task.

[0071] S305: Obtain a first resource list corresponding to the interactive task.

[0072] S306: Randomize the resources in the first resource list to obtain a second resource list.

[0073] S307, sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero.

[0074] S308: If the resource validity time range of the first target resource includes the target time point, and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, determine that the first target resource is a virtual resource allocated to the target account.

[0075] S309: Acquire, from the second resource list, a second target resource whose resource validity time range is before the resource validity time range of the target resource and whose current resource remaining amount is greater than zero.

[0076] S310: Add the second target resource to the remaining resource set of the target date.

[0077] It should be noted that the resources of the interactive task on the next date after the target date can be configured in combination with the remaining resource set of the target date to fully utilize the resources, avoid resource waste, and improve resource utilization.

[0078] Among them, an exemplary process for configuring resources for an interactive task on the next date after a target date is as follows: for any resource in the first resource list, the target resource remaining amount of the resource can be determined based on the remaining resource set on the target date, and the first target resource quantity allocated for the resource on the next date is obtained, and the initial resource effective time range set for the resource on the next date is obtained, and the target resource remaining amount and the first target resource quantity are summed to obtain the second target resource quantity of the resource in the initial resource effective time range; when the second target resource quantity is greater than or equal to the total number of seconds of the initial resource effective time range, the initial resource effective time range is used as the resource effective time range of the resource, and the second target resource quantity is used as the initial resource remaining amount of the resource in its corresponding resource effective time range.

[0079] In addition, when the second target resource quantity is less than the total number of seconds of the initial resource effective time range, a second target resource quantity time point is randomly selected from the initial resource effective time range without duplication; the second target resource quantity time points are sorted in order from the front to the back of the time points to obtain a time point sequence; the time range between each adjacent time point in the time point sequence is respectively used as the resource effective time range of the resource, wherein the initial remaining quantity of the resource in its corresponding resource effective time range is 1. Thus, the resources are fully utilized, resource waste is avoided, and resource utilization is improved.

[0080] S311, allocating the first target resource to the target account, and ending the traversal.

[0081] S312: If the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, it is determined that the first target resource is not a virtual resource allocated to the target account.

[0082] S313, taking the next resource that is located after the first target resource in the position sequence in the second resource list as the first target resource, and jumping to the step of determining whether the resource validity time range of the first target resource includes the target time point, and determining whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, until it is determined that the first target resource is a virtual resource allocated to the target account, or, traversing to the last resource in the second resource list, and determining that the last resource is not a virtual resource allocated to the target account.

[0083] It should be noted that, when it is determined that the last resource is not a virtual resource allocated to the target account, a prompt message is sent to the target account, wherein the prompt message is used to indicate that the target account is not allocated a virtual resource for the interactive task.

[0084] In order to clearly understand this application, Figure 4 An exemplary description is given of a process of determining a resource validity time range of any resource in the first resource list on a target date, and an initial resource remaining amount of the resource validity time range of the resource on the target date.

[0085] Figure 4 The process of the resource allocation method provided in the embodiment of the present application Figure 4 .

[0086] like Figure 4 As shown, the resource allocation method includes the following steps:

[0087] S401 : For any resource in the first resource list, determine a first resource remaining amount of the resource according to a remaining resource set on a previous date before a target date.

[0088] S402, obtaining the resource quantity allocated for the resource on the target date, and obtaining the initial resource effective time range set for the resource on the target date.

[0089] In this embodiment, the total number of days of the interactive task can be determined based on the effective time range of the interactive task, and the total number of resources set for the resource in the interactive task can be determined, and the total number of resources can be divided by the total number of days to obtain the number of resources allocated to the resource on the target date.

[0090] S403: sum the first resource remaining amount and the resource quantity to obtain a target resource quantity within the initial resource effective time range.

[0091] That is to say, in this embodiment, the sum result obtained by summing the first resource remaining amount and the resource quantity is called the target resource quantity.

[0092] S404, determine whether the target resource quantity is less than the total number of seconds of the initial resource effective time range, if so, execute S405-S407, otherwise execute S408.

[0093] S405: Randomly extract a non-repeating number of time points of target resources from the initial resource effective time range.

[0094] S406, sorting the target resource quantity time points in order from the front to the back to obtain a time point sequence.

[0095] S407: Use the time range between each adjacent time point in the time point sequence as the resource effective time range of the resource, wherein the initial remaining quantity of the resource in its corresponding resource effective time range is 1.

[0096] S408: Taking the initial resource validity time range as the resource validity time range of the resource, and taking the target resource quantity as the initial resource remaining quantity of the resource in its corresponding resource validity time range.

[0097] That is to say, in this embodiment, when the target resource quantity is greater than or equal to the total number of seconds of the initial resource valid time range, the initial resource valid time range is used as the resource valid time range of the resource, and the target resource quantity is used as the initial resource remaining amount of the resource in its corresponding resource valid time range.

[0098] In this embodiment, by summing the first resource remaining amount of the corresponding resource on the previous date and the resource quantity allocated to the resource on the target date, the target resource quantity of the resource on the target date is accurately obtained, and combined with the target resource quantity and the total number of seconds of the initial resource effective time range allocated to the interactive task on the target date, the resource effective time range of the resource on the target date and the initial resource remaining amount of the resource in the resource effective time range on the target date are accurately determined.

[0099] Figure 5 This is a schematic diagram of the structure of a resource allocation device provided in an embodiment of the present application. It should be noted that the device can be configured as an electronic device, or can be configured in an electronic device.

[0100] like Figure 5 As shown, the resource allocation device 500 may include:

[0101] The first processing module 501 is used to receive a resource allocation request and obtain a target time point for receiving the resource allocation request, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account.

[0102] The second processing module 502 is used to obtain a first resource list corresponding to the interactive task, and shuffle the resources in the first resource list to obtain a second resource list.

[0103] The judgment module 503 is used to sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero.

[0104] The determination module 504 is configured to determine that the first target resource is a virtual resource allocated to the target account if the resource validity time range of the first target resource includes the target time point and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero.

[0105] The allocation module 505 is used to allocate the first target resource to the target account and end the traversal.

[0106] In one embodiment of the present application, the device may further include:

[0107] The third processing module is specifically used to: if the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, then determine that the first target resource is not a virtual resource allocated to the target account; take the next resource that is located after the first target resource in the second resource list as the first target resource, and jump to the step of determining whether the resource validity time range of the first target resource includes the target time point, and determining whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, until determining that the first target resource is a virtual resource allocated to the target account, or traversing to the last resource in the second resource list, and determining that the last resource is not a virtual resource allocated to the target account.

[0108] In one embodiment of the present application, the device may further include:

[0109] The prompt sending module is used to determine that there are no virtual resources allocated to the target account in the second resource list when it is determined that the last resource is not a virtual resource allocated to the target account, and send a prompt message to the target account, wherein the prompt message is used to indicate that the target account is not allocated a virtual resource for the interactive task.

[0110] In one embodiment of the present application, the device may further include:

[0111] A first acquisition module is used to acquire the effective time range of the interactive task;

[0112] The task validity judgment module is used to judge whether the interactive task is valid according to the target time point and the task validity time range;

[0113] When the interactive task is valid, the second processing module 502 executes the step of acquiring a first resource list corresponding to the interactive task, wherein the target time point is within the task validity time range and the interactive task is valid.

[0114] In one embodiment of the present application, when the target time point is within the effective time range of the task, the second processing module 502 executes the step of obtaining a first resource list corresponding to the interactive task, including: when the interactive task is valid, determining whether the target account is eligible to obtain the virtual resources of the interactive task; when the target account is eligible to obtain the virtual resources of the interactive task, the second processing module 502 executes the step of obtaining a first resource list corresponding to the interactive task.

[0115] In one embodiment of the present application, the device may further include:

[0116] A second acquisition module is used to acquire a target date for receiving a resource allocation request;

[0117] The device may also include:

[0118] The fourth processing module is used to obtain from the second resource list a second target resource whose resource validity time range is before the resource validity time range of the target resource and whose current resource remaining amount is greater than zero; and add the second target resource to the remaining resource set of the target date.

[0119] In one embodiment of the present application, after receiving the resource allocation request, the apparatus may further include:

[0120] The fifth processing module is used to determine the first resource remaining amount of the resource for any resource in the first resource list based on the remaining resource set of the previous date before the target date; obtain the resource quantity allocated to the resource on the target date, and obtain the initial resource effective time range set for the resource on the target date; sum the first resource remaining amount and the resource quantity to obtain the target resource quantity of the resource in the initial resource effective time range; when the target resource quantity is greater than or equal to the total number of seconds of the initial resource effective time range, use the initial resource effective time range as the resource effective time range of the resource, and use the target resource quantity as the initial resource remaining amount of the resource in its corresponding resource effective time range.

[0121] In one embodiment of the present application, the fifth processing module is also used to: when the target resource quantity is less than the total number of seconds of the initial resource valid time range, randomly extract non-repeating target resource quantity time points from the initial resource valid time range; sort the target resource quantity time points in order from front to back to obtain a time point sequence; and use the time range between each adjacent time point in the time point sequence as the resource valid time range of the resource, wherein the initial remaining quantity of the resource in its corresponding resource valid time range is 1.

[0122] The resource allocation device provided in the embodiment of the present application can be used to execute the technical solution of the resource allocation method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0123] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the judgment module 503 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above judgment module 503. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0124] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0125] like Figure 6 As shown, the electronic device may include: a transceiver 121 , a processor 122 , and a memory 123 .

[0126] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0127] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.

[0128] The transceiver 121 may be configured to receive a resource allocation request.

[0129] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize communication between the resource allocation device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0130] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the technical solution of the resource allocation method in the above embodiment.

[0131] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution of the resource allocation method in the above embodiment.

[0132] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the resource allocation method in the above embodiment can be implemented.

[0133] The electronic device, chip, computer-readable storage medium, and computer program product provided in the embodiments of the present application can be used to execute the technical solutions of the task processing methods in the above embodiments. Their implementation principles and technical effects are similar and will not be repeated here.

[0134] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0135] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A resource allocation method, characterized in that: The method comprises: Receiving a resource allocation request and obtaining a target time point at which the resource allocation request is received, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account; Acquire a first resource list corresponding to the interactive task, and shuffle the resources in the first resource list to obtain a second resource list; Sequentially traverse the second resource list, and for the traversed first target resource, determine whether the resource validity time range of the first target resource includes the target time point, and determine whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero; If the resource validity time range of the first target resource includes the target time point, and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, then determining that the first target resource is a virtual resource allocated to the target account; The first target resource is allocated to the target account, and the traversal is terminated.

2. The method according to claim 1, characterized in that The method further comprises: If the resource validity time range of the first target resource does not include the target time point, and / or the current resource remaining amount of the first target resource in the resource validity time range is equal to zero, it is determined that the first target resource is not a virtual resource allocated to the target account; The next resource that is located after the first target resource in the position sequence of the second resource list is taken as the first target resource, and the process jumps to the step of determining whether the resource validity time range of the first target resource includes the target time point, and determining whether the current resource remaining amount of the first target resource in the resource validity time range is greater than zero, until it is determined that the first target resource is a virtual resource allocated to the target account, or, traverses to the last resource in the second resource list, and determines that the last resource is not a virtual resource allocated to the target account.

3. The method according to claim 2, characterized in that The method further comprises: When it is determined that the last resource is not a virtual resource allocated to the target account, it is determined that there are no virtual resources allocated to the target account in the second resource list, and a prompt message is sent to the target account, wherein the prompt message is used to indicate that the target account is not allocated to the virtual resource of the interactive task.

4. The method according to claim 2, characterized in that Before obtaining the first resource list corresponding to the interactive task, the method further includes: Obtaining the effective time range of the interactive task; Determining whether the interactive task is valid according to the target time point and the effective time range of the task; When the interactive task is valid, a step of acquiring a first resource list corresponding to the interactive task is performed, wherein the target time point is within the task validity time range and the interactive task is valid.

5. The method according to claim 4, characterized in that When the interactive task is valid, the step of acquiring a first resource list corresponding to the interactive task includes: If the interactive task is valid, determining whether the target account is eligible to obtain the virtual resources of the interactive task; In the case where the target account is qualified to obtain the virtual resources of the interactive task, a step of obtaining a first resource list corresponding to the interactive task is performed.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining a target date for receiving the resource allocation request; After determining that the first target resource is a virtual resource allocated to the target account and before ending the traversal, the method further includes: Acquire, from the second resource list, a second target resource whose resource validity time range is before the resource validity time range of the target resource and whose current resource remaining amount is greater than zero; The second target resource is added to a set of remaining resources on the target date.

7. The method according to claim 6, characterized in that Before receiving the resource allocation request, the method further includes: For any one resource in the first resource list, determining a first resource remaining amount of the resource according to a set of remaining resources on a previous date before the target date; Acquire the resource quantity allocated for the resource on the target date, and acquire the initial resource effective time range set for the resource on the target date; The first resource remaining amount and the resource quantity are summed to obtain a target resource quantity of the resource within the initial resource validity time range; When the target resource quantity is greater than or equal to the total number of seconds of the initial resource validity time range, the initial resource validity time range is used as the resource validity time range of the resource, and the target resource quantity is used as the initial resource remaining amount of the resource in its corresponding resource validity time range.

8. The method according to claim 7, characterized in that The method further comprises: In the case where the number of target resources is less than the total number of seconds of the initial resource validity time range, randomly extracting non-repeating time points of the number of target resources from the initial resource validity time range; Sorting the target resource quantity time points in order from front to back to obtain a time point sequence; The time range between each adjacent time point in the time point sequence is respectively used as the resource effective time range of the resource, wherein the initial remaining quantity of the resource in its corresponding resource effective time range is 1.

9. A resource allocation device, characterized in that: The device comprises: A first processing module, configured to receive a resource allocation request and obtain a target time point at which the resource allocation request is received, wherein the resource allocation request is used to request allocation of virtual resources corresponding to an interactive task to a target account; A second processing module, configured to obtain a first resource list corresponding to the interactive task, and shuffle the resources in the first resource list to obtain a second resource list; a judgment module, configured to sequentially traverse the second resource list, and for a first target resource traversed, judge whether a resource validity time range of the first target resource includes the target time point, and judge whether a current resource remaining amount of the first target resource in the resource validity time range is greater than zero; a determination module, configured to determine that the first target resource is a virtual resource allocated to the target account if the resource validity time range of the first target resource includes the target time point and the current resource remaining amount of the first target resource in the resource validity time range is greater than zero; An allocation module is used to allocate the first target resource to the target account and end the traversal.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.

Citation Information

Patent Citations

  • Resource allocation method, server, resource application method and client

    CN110363319A

  • Resource scheduling method and device, electronic equipment and storage medium

    CN111722928A

  • Obtaining method and device of target resources, storage medium and electronic device

    CN112529423A

  • Manufacturing service resource dynamic scheduling method and system based on random online algorithm

    CN112862312A

  • Method and system for carrying out lottery drawing by using distributed queue

    CN115204951A