Resource allocation method, device, server and storage medium
By receiving resource allocation requests on the server side and evaluating the resource usage parameters of the account, the problem of unreasonable virtual resource allocation is solved, and efficient resource utilization and waste reduction are achieved.
Patent Information
- Application Number
- CN202111449165.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In the prior art, the account allocated to the virtual resource may not use the virtual resource, resulting in unreasonable allocation of the virtual resource and waste of resources.
By receiving the resource allocation request sent by the receiving terminal, the resource usage parameters of the account to be allocated in the historical sliding time window, including resource usage rate and allocation success rate. When these parameters meet the preset conditions, it is decided to allocate virtual resources to the account.
Effectively allocate virtual resources to accounts that use them frequently, improve resource utilization and reduce resource waste.
Smart Images

Figure CN114155026B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a resource allocation method, device, server and storage medium. Background Art
[0002] Currently, the anchor can create a coupon distribution activity in the live broadcast room, and then the server allocates virtual resources to the account according to the time sequence of the requests it receives (for example, it can distribute coupons to the account). Specifically, if the receiving time corresponding to the first request (the request sent by the first account) is before the receiving time corresponding to the second request (the request sent by the second account), the server determines to prioritize the allocation of virtual resources to the first account.
[0003] However, after receiving (or being allocated to) the virtual resource, the first account and / or the second account may not use the virtual resource, for example, the first user account does not use the coupon after obtaining the coupon. In this way, the allocation of virtual resources is unreasonable and will cause a waste of resources. Summary of the invention
[0004] The present disclosure provides a resource allocation method, device, server and storage medium, which solve the technical problem in the prior art that an account allocated to a virtual resource may not use the virtual resource, resulting in unreasonable allocation of the virtual resource and waste of resources.
[0005] The technical solution of the embodiment of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a resource allocation method is provided. The method may include: receiving a resource allocation request sent by a terminal, the resource allocation request including an identifier of an account to be allocated and an identifier of an interactive task, the resource allocation request being used to request allocation of a virtual resource corresponding to the interactive task to the account to be allocated; determining a resource usage parameter corresponding to the account to be allocated in a historical sliding time window, the resource usage parameter being used to characterize the use of virtual resources by the account to be allocated in the historical sliding time window; and when the resource usage parameter meets a preset allocation condition, determining allocation of the virtual resource corresponding to the interactive task to the account to be allocated.
[0007] Optionally, the resource usage parameter includes a resource usage rate, the resource usage rate is a ratio of resource usage times to resource allocation times, the resource usage times is the number of times the account to be allocated uses virtual resources within the historical sliding time window, the resource allocation times is the number of times the account to be allocated is allocated virtual resources within the historical sliding time window, and the preset allocation condition includes being greater than or equal to a usage rate threshold; when the resource usage parameter satisfies the preset allocation condition, determining to allocate the virtual resource corresponding to the interactive task to the account to be allocated specifically includes: when the resource usage rate is greater than or equal to the usage rate threshold, determining to allocate the virtual resource corresponding to the interactive task to the account to be allocated
[0008] Optionally, the above-mentioned resource allocation method also includes: when the resource utilization rate is less than the utilization rate threshold, determining whether the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold, the resource allocation success rate is the ratio of the number of resource allocations to the number of resource requests, and the number of resource requests is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window; when the resource allocation success rate is less than or equal to the success rate threshold, determining to allocate the virtual resources corresponding to the interactive task to the account to be allocated.
[0009] Optionally, the resource allocation method further comprises: when the resource allocation success rate is greater than the success rate threshold, or the account to be allocated has been allocated the virtual resource corresponding to the interactive task, determining that the virtual resource of the account to be allocated corresponding to the interactive task remains unchanged.
[0010] Optionally, the above-mentioned determination of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window specifically includes: determining a first number of first target tasks among multiple interactive tasks within the historical sliding time window and belonging to the same virtual space, and the first target task is an interactive task using virtual resources corresponding to the account to be allocated; determining a second number of second target tasks among multiple interactive tasks within the historical sliding time window and belonging to the same virtual space, and the second target task is an interactive task that allocates virtual resources corresponding to the account to be allocated; based on the first number and the second number, determining the resource usage parameters.
[0011] Optionally, the above-mentioned resource allocation method also includes: if the number of resource allocation requests currently received is greater than or equal to a quantity threshold, determining a resource allocation response to be sent to the terminal, the resource allocation response being used to notify the terminal that the virtual resource allocation corresponding to the interaction has failed; and sending the resource allocation response to the terminal.
[0012] Optionally, before the above determination of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window, it also includes: when the received resource allocation request meets the preset processing conditions, adding the resource allocation request to the target queue; the above determination of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window specifically includes: determining the resource usage parameters corresponding to the account to be allocated in the historical sliding time window according to the queue order of the resource allocation requests in the target queue.
[0013] Optionally, the resource allocation method further comprises: when the preset resource allocation time of the interactive task is reached each time, allocating the virtual resources corresponding to the interactive task to the account to be allocated, and each interactive task corresponds to at least one preset resource allocation time.
[0014] According to the second aspect of the embodiment of the present disclosure, a resource allocation device is provided. The resource allocation device may include: a receiving module and a determining module; the receiving module is configured to receive a resource allocation request sent by a terminal, the resource allocation request includes an identifier of an account to be allocated and an identifier of an interactive task, and the resource allocation request is used to request that the virtual resource corresponding to the interactive task be allocated to the account to be allocated; the determining module is configured to determine a resource usage parameter corresponding to the account to be allocated in a historical sliding time window, and the resource usage parameter is used to characterize the use of virtual resources by the account to be allocated within the historical sliding time window; the determining module is also configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource usage parameter meets a preset allocation condition.
[0015] Optionally, the above-mentioned resource usage parameters include a resource usage rate, which is the ratio of resource usage times to resource allocation times, the resource usage times being the number of times the account to be allocated uses virtual resources within the historical sliding time window, the resource allocation times being the number of times the account to be allocated is allocated virtual resources within the historical sliding time window, and the preset allocation condition includes being greater than or equal to a usage rate threshold; the determination module is specifically configured to determine that the virtual resources corresponding to the interactive task are allocated to the account to be allocated when the resource usage rate is greater than or equal to the usage rate threshold.
[0016] Optionally, the determination module is also configured to determine whether the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold when the resource usage rate is less than the usage rate threshold, and the resource allocation success rate is the ratio of the number of resource allocations to the number of resource requests, and the number of resource requests is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window; the determination module is also configured to determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated when the resource allocation success rate is less than or equal to the success rate threshold.
[0017] Optionally, the determination module is further configured to determine that the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged when the resource allocation success rate is greater than the success rate threshold, or the account to be allocated has been allocated the virtual resources corresponding to the interactive task.
[0018] Optionally, the determination module is specifically configured to determine a first number of first target tasks among multiple interactive tasks in the historical sliding time window and belonging to the same virtual space, and the first target tasks are interactive tasks using virtual resources corresponding to the account to be allocated; the determination module is configured to determine a second number of second target tasks among multiple interactive tasks in the historical sliding time window and belonging to the same virtual space, and the second target tasks are interactive tasks allocating virtual resources corresponding to the account to be allocated; the determination module is also specifically configured to determine the resource utilization rate based on the first number and the second number.
[0019] Optionally, the resource allocation device also includes a sending module; the determination module is also configured to determine a resource allocation response to be sent to the terminal if the number of resource allocation requests currently received is greater than or equal to a quantity threshold, and the resource allocation response is used to notify the terminal that the allocation of virtual resources corresponding to the interactive task has failed; the sending module is configured to send the resource allocation response to the terminal.
[0020] Optionally, the resource allocation device also includes a processing module; the processing module is configured to add the received resource allocation request to the target queue when the received resource allocation request meets the preset processing conditions; the determination module is specifically configured to determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window according to the queue order of the resource allocation requests in the target queue.
[0021] Optionally, the processing module is configured to allocate virtual resources corresponding to the interactive task to the account to be allocated each time the preset resource allocation time of the interactive task is reached, and each interactive task corresponds to at least one preset resource allocation time.
[0022] According to a third aspect of an embodiment of the present disclosure, a server is provided, which may include: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the optional resource allocation methods in the above-mentioned first aspect.
[0023] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a server, the server is enabled to execute any one of the optional resource allocation methods in the first aspect above.
[0024] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product comprising computer instructions, which, when executed on a server, enable the server to execute any one of the optional resource allocation methods in the first aspect.
[0025] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0026] Based on any of the above aspects, in the present disclosure, the server can receive a resource allocation request sent by a terminal, and determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window. Since the resource usage rate is used to characterize the use of virtual resources by the account to be allocated within the historical sliding time window, when the resource usage parameter meets the preset allocation condition, it means that the resource usage parameter is high, that is, the account to be allocated often uses virtual resources. In this way, the server can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated. In the embodiment of the present disclosure, the server can determine to allocate the virtual resources corresponding to the interactive task to an account that often uses virtual resources (such as the account to be allocated), which can reasonably and effectively allocate virtual resources and improve resource utilization.
[0027] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0029] Figure 1 A schematic diagram of a resource allocation system provided by an embodiment of the present disclosure is shown;
[0030] Figure 2 A schematic diagram of a process of resource allocation method provided by an embodiment of the present disclosure is shown;
[0031] Figure 3 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0032] Figure 4 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0033] Figure 5 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0034] Figure 6 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0035] Figure 7 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0036] Figure 8 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0037] Fig. 9 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0038] Fig.10 A schematic diagram showing a flow chart of another resource allocation method provided by an embodiment of the present disclosure;
[0039] Fig.11 A schematic diagram of the structure of a resource allocation device provided by an embodiment of the present disclosure is shown;
[0040] Fig.12 A schematic diagram of the structure of another resource allocation device provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0041] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0043] It should also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.
[0044] The data involved in the present disclosure may be data authorized by the user or fully authorized by all parties.
[0045] As described in the background technology, in the prior art, the account allocated to the virtual resource may not be suitable for the virtual resource, that is, the allocation of virtual resources is unreasonable, resulting in resource waste. Based on this, the embodiment of the present disclosure provides a resource allocation method, whereby the server can determine to allocate virtual resources corresponding to interactive tasks to accounts that frequently use virtual resources (such as the account to be allocated), so as to reasonably and effectively allocate virtual resources and improve resource utilization.
[0046] The resource allocation method, device, server and storage medium provided by the embodiments of the present disclosure are applied to the scenario of allocating virtual resources (or obtaining virtual resources). When the server receives the resource allocation request sent by the terminal, it can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated according to the method provided by the embodiments of the present disclosure.
[0047] The resource allocation method provided by the embodiment of the present disclosure is exemplarily described below with reference to the accompanying drawings:
[0048] Figure 1 A schematic diagram of a resource allocation system provided in an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the resource allocation system may include a terminal 101 and a server 102, and the terminal 101 may establish a connection with the server 102 via a wired network or a wireless network.
[0049] The terminal 101 may be a mobile phone, tablet computer, desktop, laptop, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, cellular phone, personal digital assistant (PDA), augmented reality (AR) and virtual reality (VR) devices, etc., which can install and use content community applications (such as Kuaishou). The present disclosure does not impose any special restrictions on the specific form of the terminal 101. It can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device.
[0050] Specifically, the terminal 101 may send a resource allocation request to the server 102 , so that after receiving the resource allocation request sent by the terminal 101 , the server 102 may determine whether to allocate virtual resources corresponding to the interactive task to the account to be allocated.
[0051] like Figure 2 As shown, when the resource allocation method is applied to the above server 102, the resource allocation method may include S101-S103.
[0052] S101: A server receives a resource allocation request sent by a terminal.
[0053] The resource allocation request includes an identifier of an account to be allocated and an identifier of an interactive task, and the resource allocation request is used to request allocation of virtual resources corresponding to the interactive task to the account to be allocated.
[0054] It should be understood that the terminal may send the resource allocation request to the server in response to a certain processing instruction so that the server can receive the resource allocation request. Specifically, the processing instruction may be actively triggered by the user corresponding to the account to be identified, that is, the user actively sends the resource allocation request to the server based on the terminal.
[0055] It should be noted that the virtual resources in the embodiments of the present disclosure may be virtual items (such as virtual coins, rechargeable batteries, virtual characters or virtual game equipment, etc.); the virtual items may also be virtual funds (such as electronic red envelopes, electronic vouchers or electronic coupons, etc.); the virtual items may also be multimedia resources (such as movies, music, documents, pictures, etc.), and the embodiments of the present disclosure do not limit the specific form of virtual resources.
[0056] It is understandable that the above interactive task is a virtual resource allocation task, specifically, allocating the virtual resources corresponding to the interactive task to different accounts. For example, assuming that the virtual resource is an electronic coupon, the interactive task is a task for allocating electronic coupons, which can also be understood as an electronic coupon sharing activity. The electronic coupon sharing activity (i.e., interactive task) can be created by the anchor in his live broadcast room.
[0057] S102: The server determines resource usage parameters corresponding to the account to be allocated in the historical sliding time window.
[0058] The resource usage parameter is used to characterize the usage of virtual resources by the account to be allocated within the historical sliding time window.
[0059] It should be understood that the historical sliding time window is a period of historical time before the current moment. Specifically, the historical time can be a period of time closest to the current moment, such as nearly 6 hours; the historical time can also be any period of time before the current moment (such as the 1st day to the 2nd day in the past 3 days).
[0060] It should be noted that the time length corresponding to the above historical sliding time window can be a hours (a>0), b days (b>0) or c weeks (c>0), etc. The embodiment of the present disclosure does not make any specific limitation on the time length corresponding to the historical sliding time window.
[0061] S103: When the resource usage parameters meet the preset allocation conditions, the server determines to allocate virtual resources corresponding to the interactive task to the account to be allocated.
[0062] It should be understood that the above-mentioned characterization of the use of virtual resources by the account to be allocated within the historical sliding time window can also be understood as a characterization of the use of the virtual resources by the account to be allocated after obtaining (or being allocated to) the virtual resources. Specifically, when the resource usage parameter meets the preset allocation condition, it means that the use of virtual resources by the account to be allocated is better. In the embodiment of the present disclosure, when the use of virtual resources by the account to be allocated is better, the server can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated. That is, the server can allocate the virtual resources corresponding to the interactive task to accounts that frequently use virtual resources (such as the account to be allocated).
[0063] In one implementation of the embodiment of the present disclosure, after the above-mentioned determination to allocate the virtual resources corresponding to the interactive task to the account to be allocated, the server can send the virtual resources corresponding to the interactive task to the terminal so that the terminal can receive (or obtain) the virtual resources corresponding to the interactive task, that is, the account to be allocated is allocated to the virtual resources corresponding to the interactive task.
[0064] Optionally, when the resource usage parameter does not meet the preset allocation condition, it indicates that the usage of the virtual resource by the account to be allocated is poor, which can also be understood as the account to be allocated not often using the virtual resource. At this time, the server can determine to allocate the virtual resource corresponding to the interactive task to other accounts, that is, not to allocate the virtual resource to the account to be allocated.
[0065] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S101-S103, the server can receive the resource allocation request sent by the terminal, and determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window. Since the resource usage parameters are used to characterize the use of virtual resources by the account to be allocated within the historical sliding time window, when the resource usage parameters meet the preset allocation conditions, it means that the resource usage parameters are high, that is, the account to be allocated often uses virtual resources. In this way, the server can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated. In the disclosed embodiment, the server can determine to allocate the virtual resources corresponding to the interactive task to an account that often uses virtual resources (such as the account to be allocated), which can reasonably and effectively allocate virtual resources and improve resource utilization.
[0066] Combination Figure 2 ,like Figure 3As shown, in one implementation of the embodiment of the present disclosure, the resource usage parameter includes a resource usage rate, which is a ratio of resource usage times to resource allocation times, the resource usage times being the number of times the account to be allocated uses virtual resources within the historical sliding time window, the resource allocation times being the number of times the account to be allocated is allocated virtual resources within the historical sliding time window, and the preset allocation condition includes being greater than or equal to a usage rate threshold. When the resource usage parameter satisfies the preset allocation condition, the server determines to allocate virtual resources corresponding to the interactive task to the account to be allocated, including S1031.
[0067] S1031: When the resource usage rate is greater than or equal to the usage rate threshold, the server determines to allocate virtual resources corresponding to the interactive task to the account to be allocated.
[0068] It should be understood that if the resource usage rate is greater than or equal to the usage rate threshold, it means that the resource usage rate is high. When the resource usage rate is high, it means that the account to be allocated has a better use of the virtual resources, that is, the account to be allocated often uses the virtual resources. In the disclosed embodiment, the server can determine to allocate the virtual resources corresponding to the interactive task to the account that often uses the virtual resources (such as the account to be allocated).
[0069] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S1031, the resource utilization rate can specifically characterize the use of virtual resources by a certain account (such as the account to be allocated) within the historical sliding time window. When the resource utilization rate is greater than or equal to the utilization rate threshold, it means that the resource utilization rate is high, that is, the account to be allocated frequently uses virtual resources. In this way, the server can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated. In the embodiment of the present disclosure, the server can determine to allocate the virtual resources corresponding to the interactive task to an account that frequently uses virtual resources (such as the account to be allocated), which can reasonably and effectively allocate virtual resources and improve resource utilization.
[0070] Combination Figure 3 ,like Figure 4 As shown, the resource allocation method provided by the embodiment of the present disclosure may also include S104-S105.
[0071] S104: When the resource usage rate is less than the usage rate threshold, the server determines whether the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold.
[0072] The resource allocation success rate is the ratio of the resource allocation times to the resource request times, and the resource request times is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window.
[0073] In combination with the description of the above embodiment, it should be understood that the resource usage rate is the resource usage rate of the account to be allocated corresponding to the historical sliding time window. When the resource usage rate is less than the usage rate threshold, it means that the resource usage rate is low, that is, the usage of virtual resources by the account to be allocated is poor, and the account to be allocated does not often use virtual resources.
[0074] It is understandable that the above-mentioned accounts to be allocated do not frequently use virtual resources and can be divided into the following two situations:
[0075] The first case is that the number of times the account to be allocated virtual resources in the historical sliding time window (i.e., the number of resource allocations) is small. When the number of resource allocations is small, the number of times the account to be allocated uses virtual resources in the historical sliding time window may also be reduced accordingly, that is, the account to be allocated may have no opportunity (or have fewer opportunities) to use virtual resources, which results in the account to be allocated not often using virtual resources.
[0076] The second situation is that the resource is allocated many times, that is, the account to be allocated has been allocated virtual resources many times, and the account to be allocated has a great chance to use the virtual resources within the historical sliding time window, but the account to be allocated does not use (or rarely uses) the virtual resources. In this way, it can be concluded that the account to be allocated does not often use virtual resources.
[0077] In the disclosed embodiment, the server determines whether the resource allocation success rate is less than or equal to the success rate threshold, that is, determines which of the above two situations the account to be allocated belongs to. Specifically, when the resource allocation success rate is less than or equal to the success rate threshold, it means that the account to be allocated belongs to the above first situation; correspondingly, when the resource allocation success rate is greater than the success rate threshold, it means that the account to be allocated belongs to the above second situation.
[0078] In an implementation manner of the embodiment of the present disclosure, the above-mentioned number of resource requests can also be understood as the number of resource allocation requests corresponding to the account to be allocated received by the server within the historical sliding time window.
[0079] S105: When the resource allocation success rate is less than or equal to the success rate threshold, the server determines to allocate virtual resources corresponding to the interactive task to the account to be allocated.
[0080] In conjunction with the description of the above embodiment, it should be understood that if the resource allocation success rate is less than or equal to the success rate threshold, it means that the account to be allocated belongs to the first case above, that is, the account to be allocated may not have the opportunity (or there is less opportunity) to use the virtual resources. In this way, the server can increase the opportunity of the account to be allocated to use the virtual resources, that is, determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated. It can be understood that only when the account to be allocated is allocated to the virtual resources corresponding to the interactive task, the account to be allocated has the opportunity to use the virtual resources corresponding to the interactive task.
[0081] The technical solution provided by the above embodiment can at least bring the following beneficial effects: From S104-S105, it can be known that when the resource utilization rate is less than the utilization rate threshold, it means that the account to be identified does not often use virtual resources; the server can determine whether the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold, that is, determine whether the reason why the account to be allocated does not often use virtual resources is that the account to be allocated has fewer opportunities to use virtual resources, or that the account to be allocated has a great chance to use virtual resources, but the account to be allocated does not use virtual resources. When the resource allocation success rate is less than or equal to the success rate threshold, that is, when it is determined that the account to be allocated has fewer opportunities to use virtual resources, the server can increase the opportunity of the account to be allocated to use virtual resources, that is, determine to allocate virtual resources corresponding to the interactive task to the account to be allocated. It is possible to conveniently and accurately determine the account that really needs and will use virtual resources (such as the account to be allocated), and allocate virtual resources to the account, thereby reducing resource waste.
[0082] Combination Figure 4 ,like Figure 5 As shown, the resource allocation method provided by the embodiment of the present disclosure also includes S106.
[0083] S106: When the resource allocation success rate is greater than the success rate threshold, or the account to be allocated has been allocated with the virtual resources corresponding to the interactive task, the server determines that the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged.
[0084] In combination with the description of the above embodiment, it should be understood that the resource allocation success rate is greater than the success rate threshold, indicating that the account to be allocated belongs to the second case above, that is, the account to be allocated has a great chance to use virtual resources within the historical sliding time window, but the account to be allocated does not use (or rarely uses) virtual resources, so the server can determine that the size of the virtual resources of the interactive task allocated to the account to be allocated is 0. Since before S106, the virtual resources of the account to be allocated corresponding to the interactive task are 0 (that is, the server has not allocated the virtual resources of the interactive task to the account to be allocated), it means that the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged, that is, the virtual resources are still 0.
[0085] In one implementation of the disclosed embodiment, an account (e.g., an account to be allocated) can only be allocated virtual resources once under a task (e.g., an interactive task). Specifically, if the account to be allocated has been allocated virtual resources corresponding to the interactive task, the server can determine that the size of the virtual resources of the interactive task to be allocated again to the account to be allocated is 0, that is, the server determines not to repeatedly allocate the virtual resources corresponding to the interactive task to the account to be allocated, and the virtual resources of the account corresponding to the interactive task remain unchanged.
[0086] Exemplarily, in combination with the example in S101 above, when the resource allocation success rate is greater than the success rate threshold, the server determines that the number of electronic coupons corresponding to the account to be identified in the electronic coupon sharing activity is 0. When the account to be allocated has been allocated an electronic coupon in the electronic coupon sharing activity, the server determines not to repeatedly allocate the electronic coupon in the electronic coupon sharing activity to the account to be allocated.
[0087] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S106, when the resource allocation success rate is greater than the success rate threshold, it means that the account to be allocated has a great chance to use virtual resources, but the account to be allocated does not use (or rarely uses) virtual resources, so the server can determine that the size of the virtual resources corresponding to the interactive task allocated to the account to be allocated is 0, and the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged. When the account to be allocated has been allocated the virtual resources corresponding to the interactive task, since an account can only be allocated virtual resources once under a task, the server determines that the virtual resources corresponding to the interactive task will no longer be repeatedly allocated to the account to be allocated, and the virtual resources of the account corresponding to the interactive task remain unchanged. In the disclosed embodiment, the server can determine which accounts have corresponding virtual resources that remain unchanged under the interactive task, that is, the virtual resources corresponding to the interactive task are not allocated to (or no longer allocated to) these accounts, which can reduce the waste of virtual resources and improve resource utilization.
[0088] Combination Figure 2 ,like Figure 6 As shown, in an implementation of the embodiment of the present disclosure, the above-mentioned determination of the resource usage parameters corresponding to the to-be-allocated account in the historical sliding time window specifically includes S1021-S1023.
[0089] S1021. The server determines a first number of first target tasks from among a plurality of interactive tasks in a historical sliding time window and belonging to a same virtual space.
[0090] The first target task is an interactive task using virtual resources corresponding to the account to be allocated.
[0091] In conjunction with the description of the above embodiments, it should be understood that an account (eg, an account to be allocated) can only be allocated virtual resources once in an interactive task. Similarly, an account can only use virtual resources once in an interactive task, and the virtual resources are the virtual resources corresponding to the interactive task.
[0092] It can be understood that the first amount is used to represent the amount of virtual resources used by the account to be allocated within the historical sliding time window and in the virtual space.
[0093] Optionally, the above-mentioned virtual space may be a live broadcast room of a certain anchor account.
[0094] S1022. The server determines a second number of second target tasks from among multiple interactive tasks that are within the historical sliding time window and belong to the same virtual space.
[0095] The second target task is an interactive task of allocating virtual resources corresponding to the account to be allocated.
[0096] It should be understood that the second quantity is used to represent the quantity of virtual resources allocated to the account to be allocated within the historical sliding time window and in the virtual space.
[0097] S1023. The server determines a resource usage parameter based on the first quantity and the second quantity.
[0098] In an optional implementation, the server may determine the ratio of the first quantity to the second quantity as the resource usage parameter.
[0099] The technical solution provided by the above embodiment can at least bring the following beneficial effects: From S1021-S1023, it can be known that, in the historical sliding time window and in multiple interactive tasks belonging to the same virtual space, the server can determine a first number of first target tasks (i.e., interactive tasks using virtual resources corresponding to the account to be allocated) and a second number of second target tasks (i.e., interactive tasks allocating virtual resources corresponding to the account to be allocated); then the server can determine the resource usage parameters based on the first number and the second number. In the disclosed embodiment, the server can determine the resource usage parameters of the account to be allocated based on the number of virtual resources used by the account to be allocated and the number of virtual resources allocated to the account to be allocated, which can improve the efficiency of determining the resource usage parameters, and thus improve the efficiency of resource allocation.
[0100] Combination Figure 2 ,like Figure 7 As shown, the resource allocation method provided in the embodiment of the present disclosure also includes S107-S108.
[0101] S107: If the number of currently received resource allocation requests is greater than or equal to the number threshold, the server determines a resource allocation response to send to the terminal.
[0102] The resource allocation response is used to notify the terminal that the allocation of the virtual resource corresponding to the interactive task has failed.
[0103] It should be understood that if the number of resource allocation requests currently received is greater than or equal to the number threshold, it means that the current network is relatively congested, or it can be understood that the processing pressure of the server is relatively large. At this time, the server can determine the resource allocation response, that is, determine that the virtual resources corresponding to the interactive task allocated to the account to be allocated are 0, or it can be understood that the server does not allocate the virtual resources corresponding to the interactive task to the account to be allocated.
[0104] Optionally, the server may determine the number of the currently received resource allocation requests based on a query per second (QPS) currently corresponding to the server.
[0105] In an implementation of the embodiment of the present disclosure, when the resource allocation success rate is greater than the success rate threshold, or the account to be allocated has been allocated the virtual resource corresponding to the interactive task, the server may also determine to send the resource allocation response to the terminal.
[0106] In another implementation of the embodiment of the present disclosure, the server may also determine whether there are currently any remaining virtual resources for the target task. When there are currently no remaining virtual resources for the target task, the server determines the resource allocation response to be sent to the terminal.
[0107] In the disclosed embodiment, when the resource usage rate is greater than or equal to the usage rate threshold and there are currently remaining virtual resources for the interactive task, the server may determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated.
[0108] S108. The server sends a resource allocation response to the terminal.
[0109] It is understandable that the server sends the resource allocation response to the terminal so that the terminal can receive the resource allocation response sent by the server, that is, it is determined that the virtual resource allocation corresponding to the interactive task fails, specifically, the server does not allocate the virtual resource corresponding to the interactive task to the account to be modified.
[0110] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S107-S108, if the number of resource allocation requests currently received is greater than or equal to the number threshold, it means that the current network is relatively congested (or the processing pressure of the server is relatively large). At this time, the server can determine the resource allocation response sent to the terminal, and the resource allocation response is used to notify the terminal that the virtual resource allocation corresponding to the interactive task has failed, that is, the server can determine that the virtual resource corresponding to the interactive task allocated to the account to be allocated is 0. And the server can send the resource allocation response to the terminal, so that the terminal can receive the resource allocation response and determine that the virtual resource allocation corresponding to the interactive task has failed, specifically, the server has not allocated the virtual resource corresponding to the interactive task to the account to be modified. It can accurately and reasonably determine whether to allocate virtual resources to the account to be allocated, which can reduce the processing pressure of the server and save server resources.
[0111] Combination Figure 2 ,like Figure 8 As shown, before determining the resource usage parameters corresponding to the account to be allocated in the historical sliding time window, the resource allocation method provided by the embodiment of the present disclosure may further include S109.
[0112] S109: When the received resource allocation request meets a preset processing condition, the server adds the resource allocation request sent by the terminal to a target queue.
[0113] Specifically, after receiving the resource allocation request, the server may add the resource allocation request to the end position (i.e., the tail) of the target queue. The server may also obtain and process the resource allocation request from the beginning position (i.e., the head) of the target queue, and then the server may determine whether to allocate the virtual resources corresponding to the interactive task to the account to be allocated.
[0114] Continue as Figure 8 As shown, the above-mentioned determination of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window may further specifically include S1024.
[0115] S1024: The server determines the resource usage parameters corresponding to the account to be allocated in the historical sliding time window according to the queue order of the resource allocation requests in the target queue.
[0116] It should be understood that the server can receive multiple resource allocation requests and add the multiple resource allocation requests to the target queue in chronological order, which is the queue order of the resource allocation requests in the target queue. Furthermore, the server can obtain and process the multiple resource allocation requests from the target queue in the queue order to determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window.
[0117] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S109 and S1024, when the received resource allocation request meets the preset processing condition, the server can add the resource allocation request sent by the terminal to the target queue; then the server can determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window according to the queue order of the resource allocation request in the target queue (specifically, the time sequence of multiple resource allocation requests). In the present disclosure, the server can obtain and process resource allocation requests in a certain order, improve the processing efficiency of resource allocation requests, and thus improve the efficiency of resource allocation.
[0118] Combination Figure 2 ,like Fig. 9 As shown, the resource allocation method provided by the embodiment of the present disclosure may further include S110.
[0119] S110. Every time the preset resource allocation time of the interactive task is reached, the server allocates virtual resources corresponding to the interactive task to the account to be allocated.
[0120] Each interactive task corresponds to at least one preset resource allocation time.
[0121] It should be understood that when the server performs resource allocation in the embodiment of the present disclosure, it may have a timing function, specifically, the timing allocation of virtual resources. Specifically, each time the preset resource allocation time of one of the above-mentioned multiple interactive tasks is reached, the server can allocate the virtual resources corresponding to the interactive task to the account to be allocated. Moreover, for an interactive task, the interactive task may correspond to one preset resource allocation time, or may correspond to more than one preset resource allocation time (i.e., at least one preset resource allocation time). In this way, each time each of the at least one preset resource allocation time is reached, the server can allocate virtual resources to the account to be allocated.
[0122] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S110, when the preset resource allocation time of the interactive task is reached each time, the server can allocate virtual resources corresponding to the interactive task to the account to be allocated. In the embodiment of the present disclosure, the server can allocate virtual resources to the account to be allocated at a regular interval, which can improve the rationality of resource allocation.
[0123] like Fig.10 As shown, when the resource allocation method is based on the interaction process between the terminal and the server, the resource allocation method may include S201-S206.
[0124] S201. A terminal sends a resource allocation request to a server.
[0125] The resource allocation request includes an identifier of an account to be allocated and an identifier of an interactive task, and the resource allocation request is used to request allocation of virtual resources corresponding to the interactive task to the account to be allocated.
[0126] S202: The server receives a resource allocation request sent by the terminal.
[0127] S203: The server determines that resource usage parameters corresponding to the account to be allocated in the historical sliding time window meet preset allocation conditions.
[0128] S204: The server determines to allocate virtual resources corresponding to the interactive task to the account to be allocated.
[0129] S205: The server sends virtual resources corresponding to the interactive task to the terminal.
[0130] S206: The terminal receives virtual resources corresponding to the interactive task sent by the server.
[0131] At this point, the account to be allocated can obtain (or be allocated to) the virtual resources corresponding to the interactive task.
[0132] It should be understood that the explanation of S201-S206 can be found in the description of the above embodiment and will not be repeated here.
[0133] The technical solution provided by the above embodiment can at least bring the following beneficial effects: As can be seen from S201-S206, the terminal sends a resource allocation request to the server, the server receives the resource allocation request, and determines that the resource usage parameter corresponding to the account to be allocated in the historical sliding time window meets the preset allocation condition; when the resource usage parameter meets the preset allocation condition, it means that the resource usage parameter is high, that is, the account to be allocated often uses virtual resources. In this way, the server can determine to allocate the virtual resources corresponding to the interactive task to the account to be allocated, and send the virtual resources corresponding to the interactive task to the terminal. Further, the terminal can receive the virtual resources corresponding to the interactive task sent by the server, so that the account to be allocated can obtain (or be allocated to) the virtual resources corresponding to the interactive task. In the embodiment of the present disclosure, the server can determine to allocate the virtual resources corresponding to the interactive task to the account that often uses virtual resources (such as the account to be allocated), which can reasonably and effectively allocate virtual resources and improve resource utilization. Furthermore, the account to be allocated can obtain (or be allocated) the virtual resources corresponding to the interactive task, which can improve the efficiency of obtaining virtual resources.
[0134] It is understandable that, in actual implementation, the server described in the embodiment of the present disclosure may include one or more hardware structures and / or software modules for implementing the aforementioned corresponding resource allocation method, and these execution hardware structures and / or software modules may constitute a resource allocation. It should be easily appreciated by those skilled in the art that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0135] Based on this understanding, the embodiment of the present disclosure also provides a resource allocation device. Fig.11 FIG. 2 shows a schematic diagram of the structure of a resource allocation device provided by an embodiment of the present disclosure. Fig.11 As shown, the resource allocation device 20 may include: a receiving module 201 and a determining module 202 .
[0136] The receiving module 201 is configured to receive a resource allocation request sent by a terminal, the resource allocation request including an identifier of an account to be allocated and an identifier of an interactive task, and the resource allocation request is used to request allocation of virtual resources corresponding to the interactive task to the account to be allocated.
[0137] The determination module 202 is configured to determine a resource usage parameter corresponding to the account to be allocated in the historical sliding time window, where the resource usage parameter is used to characterize the use of virtual resources by the account to be allocated in the historical sliding time window.
[0138] The determination module 202 is further configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource usage parameter meets a preset allocation condition.
[0139] Optionally, the above-mentioned resource usage parameters include a resource usage rate, which is the ratio of the number of resource usage times to the number of resource allocation times, the number of resource usage times is the number of times the account to be allocated uses the virtual resource within the historical sliding time window, the number of resource allocation times is the number of times the account to be allocated is allocated the virtual resource within the historical sliding time window, and the above-mentioned preset allocation conditions include being greater than or equal to a usage rate threshold.
[0140] The determination module 202 is specifically configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource usage rate is greater than or equal to the usage rate threshold.
[0141] Optionally, the determination module 202 is also configured to determine whether the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold when the resource utilization rate is less than the utilization rate threshold. The resource allocation success rate is the ratio of the number of resource allocations to the number of resource requests, and the number of resource requests is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window.
[0142] The determination module 202 is further configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource allocation success rate is less than or equal to the success rate threshold.
[0143] Optionally, the determination module 202 is further configured to determine that the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged when the resource allocation success rate is greater than the success rate threshold or the account to be allocated has been allocated the virtual resources corresponding to the interactive task.
[0144] Optionally, the above historical sliding time window includes multiple tasks.
[0145] The determination module 202 is specifically configured to determine a first number of first target tasks from a plurality of interactive tasks in the historical sliding time window and belonging to the same virtual space, wherein the first target tasks are interactive tasks using virtual resources corresponding to the account to be allocated.
[0146] The determination module 202 is further specifically configured to determine a second number of second target tasks from a plurality of interactive tasks in the historical sliding time window and belonging to the same virtual space, wherein the second target tasks are interactive tasks for allocating virtual resources corresponding to the account to be allocated.
[0147] The determination module 202 is further specifically configured to determine the resource usage rate based on the first number and the second number.
[0148] Optionally, the resource allocation device 20 further includes a sending module 203 .
[0149] The determination module 202 is further configured to determine a resource allocation response to send to the terminal if the number of currently received resource allocation requests is greater than or equal to a number threshold, wherein the resource allocation response is used to notify the terminal that the allocation of the virtual resource corresponding to the target task has failed.
[0150] The sending module 203 is configured to send the resource allocation response to the terminal.
[0151] Optionally, the resource allocation device 20 further includes a processing module 204 .
[0152] The processing module 204 is configured to add the received resource allocation request to the target queue when the received resource allocation request meets the preset processing condition.
[0153] The determination module 202 is specifically configured to determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window according to the queue order of the resource allocation requests in the target queue.
[0154] Optionally, the processing module 204 is configured to allocate virtual resources corresponding to the interactive task to the account to be allocated each time the preset resource allocation time of the interactive task is reached, and each interactive task corresponds to at least one preset resource allocation time.
[0155] As described above, the embodiment of the present disclosure can divide the resource allocation device into functional modules according to the above method example. Among them, the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module.
[0156] Regarding the resource allocation device in the above embodiment, the specific manner in which each module performs operations and the beneficial effects possessed have been described in detail in the above method embodiment and will not be repeated here.
[0157] Fig.12 is a schematic diagram of the structure of another resource allocation device provided by the present disclosure. Fig.12 The resource allocation device 30 may include at least one processor 301 and a memory 303 for storing processor executable instructions. The processor 301 is configured to execute instructions in the memory 303 to implement the resource allocation method in the above embodiment.
[0158] In addition, the resource allocation device 30 may further include a communication bus 302 and at least one communication interface 304 .
[0159] The processor 301 may be a central processing unit (CPU), a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution.
[0160] Communication bus 302 may include a pathway for transmitting information between the above-mentioned components.
[0161] The communication interface 304 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0162] The memory 303 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit through a bus. The memory may also be integrated with the processing unit.
[0163] The memory 303 is used to store instructions for executing the solution of the present disclosure, and the execution is controlled by the processor 301. The processor 301 is used to execute the instructions stored in the memory 303, so as to realize the functions in the method of the present disclosure.
[0164] In a specific implementation, as an embodiment, the processor 301 may include one or more CPUs, such as Fig.12 CPU0 and CPU1 in.
[0165] In a specific implementation, as an embodiment, the resource allocation device 30 may include multiple processors, such as Fig.12 301 and processor 307 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0166] In a specific implementation, as an embodiment, the resource allocation device 30 may further include an output device 305 and an input device 306. The output device 305 communicates with the processor 301 and may display information in a variety of ways. For example, the output device 305 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 306 communicates with the processor 301 and may receive user input in a variety of ways. For example, the input device 306 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0167] Those skilled in the art will understand that Fig.12 The structure shown in the figure does not constitute a limitation on the resource allocation device 30, and may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0168] In addition, the present disclosure also provides a computer-readable storage medium, including instructions, which, when executed by a server, enable the server to execute the resource allocation method provided in the above embodiment.
[0169] In addition, the present disclosure also provides a computer program product, including instructions, which, when executed by a server, enable the server to execute the resource allocation method provided in the above embodiment.
[0170] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
Claims
1. A resource allocation method, characterized in that: include: receiving a resource allocation request sent by a terminal, the resource allocation request including an identifier of an account to be allocated and an identifier of an interactive task, the resource allocation request being used to request allocation of a virtual resource corresponding to the interactive task to the account to be allocated; Determine a resource usage parameter corresponding to the account to be allocated in the historical sliding time window, wherein the resource usage parameter is used to characterize the use of virtual resources by the account to be allocated in the historical sliding time window; the resource usage parameter includes a resource usage rate, wherein the resource usage rate is a ratio of the number of resource usage times to the number of resource allocation times, wherein the number of resource usage times is the number of times the account to be allocated uses the virtual resource in the historical sliding time window, and the number of resource allocation times is the number of times the account to be allocated is allocated the virtual resource in the historical sliding time window; When the resource usage rate is less than the usage rate threshold, and the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold, it is determined to allocate the virtual resource corresponding to the interactive task to the account to be allocated; the resource allocation success rate is the ratio of the number of resource allocation times to the number of resource requests, and the number of resource requests is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window.
2. The resource allocation method according to claim 1, characterized in that: Also includes: When the resource usage rate is greater than or equal to the usage rate threshold, it is determined to allocate the virtual resource corresponding to the interactive task to the account to be allocated.
3. The resource allocation method according to claim 1, characterized in that: The method further comprises: When the resource allocation success rate is greater than the success rate threshold, or the account to be allocated has been allocated the virtual resource corresponding to the interactive task, it is determined that the virtual resource of the account to be allocated corresponding to the interactive task remains unchanged.
4. The resource allocation method according to claim 1, characterized in that: The determining of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window includes: Determine a first number of first target tasks from a plurality of interactive tasks in the same virtual space within the historical sliding time window, where the first target tasks are interactive tasks using virtual resources corresponding to the account to be allocated; Determine a second number of second target tasks from a plurality of interactive tasks in the historical sliding time window and belonging to the same virtual space, where the second target tasks are interactive tasks for allocating virtual resources corresponding to the accounts to be allocated; The resource usage parameter is determined based on the first number and the second number.
5. The resource allocation method according to any one of claims 1 to 4, characterized in that: The method further comprises: If the number of currently received resource allocation requests is greater than or equal to the number threshold, determining a resource allocation response to send to the terminal, the resource allocation response being used to notify the terminal that allocation of the virtual resource corresponding to the interactive task has failed; The resource allocation response is sent to the terminal.
6. The resource allocation method according to any one of claims 1 to 4, characterized in that: Before determining the resource usage parameter corresponding to the historical sliding time window of the account to be allocated, the method further includes: When the received resource allocation request meets the preset processing condition, adding the resource allocation request to the target queue; The determining of the resource usage parameters corresponding to the account to be allocated in the historical sliding time window includes: According to the queue order of the resource allocation requests in the target queue, the resource usage parameters corresponding to the account to be allocated in the historical sliding time window are determined.
7. The resource allocation method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the preset resource allocation time of the interactive task is reached each time, the virtual resources corresponding to the interactive task are allocated to the account to be allocated, and each interactive task corresponds to at least one preset resource allocation time.
8. A resource allocation device, characterized in that: include: A receiving module and a determining module; The receiving module is configured to receive a resource allocation request sent by a terminal, wherein the resource allocation request includes an identifier of an account to be allocated and an identifier of an interactive task, and the resource allocation request is used to request allocation of virtual resources corresponding to the interactive task to the account to be allocated; The determination module is configured to determine the resource usage parameters corresponding to the account to be allocated in the historical sliding time window, the resource usage parameters are used to characterize the use of virtual resources by the account to be allocated in the historical sliding time window; the resource usage parameters include a resource usage rate, the resource usage rate is the ratio of the number of resource usage times to the number of resource allocation times, the resource usage times is the number of times the account to be allocated uses the virtual resources in the historical sliding time window, and the resource allocation times is the number of times the account to be allocated is allocated virtual resources in the historical sliding time window; The determination module is further configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource usage rate is less than the usage rate threshold and the resource allocation success rate corresponding to the account to be allocated in the historical sliding time window is less than or equal to the success rate threshold; the resource allocation success rate is the ratio of the number of resource allocations to the number of resource requests, and the number of resource requests is the number of times the account to be allocated requests for allocation of virtual resources within the historical sliding time window.
9. The resource allocation device according to claim 8, characterized in that: The determination module is further configured to determine to allocate the virtual resource corresponding to the interactive task to the account to be allocated when the resource usage rate is greater than or equal to the usage rate threshold.
10. The resource allocation device according to claim 8, characterized in that: The determination module is further configured to determine that the virtual resources of the account to be allocated corresponding to the interactive task remain unchanged when the resource allocation success rate is greater than the success rate threshold or the account to be allocated has been allocated the virtual resources corresponding to the interactive task.
11. The resource allocation device according to claim 8, characterized in that: The determination module is specifically configured to determine a first number of first target tasks from a plurality of interactive tasks in the historical sliding time window and belonging to the same virtual space, wherein the first target tasks are interactive tasks using virtual resources corresponding to the account to be allocated; The determination module is further configured to determine a second number of second target tasks from a plurality of interactive tasks in the historical sliding time window and belonging to the same virtual space, wherein the second target tasks are interactive tasks for allocating virtual resources corresponding to the account to be allocated; The determination module is further specifically configured to determine the resource usage rate based on the first quantity and the second quantity.
12. The resource allocation device according to any one of claims 8 to 11, characterized in that: The resource allocation device also includes a sending module; The determination module is further configured to determine a resource allocation response to be sent to the terminal if the number of resource allocation requests currently received is greater than or equal to a number threshold, wherein the resource allocation response is used to notify the terminal that the allocation of the virtual resource corresponding to the interactive task has failed; The sending module is configured to send the resource allocation response to the terminal.
13. The resource allocation device according to any one of claims 8 to 11, characterized in that: The resource allocation device also includes a processing module; The processing module is configured to add the received resource allocation request to a target queue when the received resource allocation request meets a preset processing condition; The determination module is specifically configured to determine the resource usage parameters corresponding to the to-be-allocated account in the historical sliding time window according to the queue order of the resource allocation requests in the target queue.
14. The resource allocation device according to any one of claims 8 to 11, characterized in that: The resource allocation device also includes a processing module; The processing module is configured to allocate the virtual resources corresponding to the interactive task to the account to be allocated each time the preset resource allocation time of the interactive task is reached, and each interactive task corresponds to at least one preset resource allocation time.
15. A server, characterized in that: The server comprises: processor; a memory configured to store instructions executable by the processor; The processor is configured to execute the instructions to implement the resource allocation method according to any one of claims 1 to 7.
16. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions in the computer-readable storage medium are executed by a server, the server is enabled to execute the resource allocation method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed on a server, the server is caused to execute the resource allocation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Resource allocation method and device, electronic apparatus, and computer-readable storage medium
CN109191202A
Virtual resource allocation method and device for reader and computer equipment
CN113485843A