Method, apparatus and electronic device for processing virtual resource

By dividing the task period into multiple sub-periods and allocating virtual resources according to a ratio, the problem of uneven resource allocation during the effective task period, which leads to a decline in user experience, is solved, and even resource allocation and high engagement are achieved during the task.

CN116688520BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-02-28
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

If the target fails to complete the task in time during the effective period of the task, they may not be able to obtain virtual resources, resulting in a decline in the user experience and a decrease in participation.

Method used

The effective time period of the task is divided into multiple second time periods. Based on the ratio of the duration of each second time period to the total time period and the total number of allocable virtual resources, the allocable quantity of each second time period is determined to ensure that virtual resources are evenly distributed under preset conditions.

Benefits of technology

Virtual resources are evenly distributed during the effective time period of the task to ensure that the target object can obtain resources with the same probability at any time, thus avoiding a decrease in participation in the later stages of the task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116688520B_ABST
    Figure CN116688520B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a virtual resource processing method and device and electronic equipment, and relate to the fields of Internet technology, intelligent transportation, games and cloud technology. The method comprises: in response to a virtual resource acquisition request associated with a target task by a client, determining an execution result for the acquisition request; if the execution result is that the virtual resource is determined to be obtained and a preset condition is met, allocating the virtual resource corresponding to the client to the client. A second quantity is determined based on the total allocatable quantity of the virtual resource corresponding to the target task, the length of the task valid period and the length of a second period. The preset condition is that the total allocated quantity of the virtual resource within the task valid period of the target task is less than the total allocatable quantity; and the allocated quantity of the virtual resource within the second period to which the initiation time corresponding to the acquisition request belongs is less than the second quantity corresponding to the second period. The virtual resource corresponding to the task is uniformly allocated within the task valid period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing virtual resources. Background Technology

[0002] With the development of internet technology, more and more tasks related to virtual resources (red envelopes, game items, etc.) have emerged. If the corresponding task is completed within the valid period of the task, there is a chance to obtain the virtual resources corresponding to the task.

[0003] Typically, the number of virtual resources in stock (i.e. the number of virtual resources that can be allocated) is limited. If a task is not completed well at the beginning, the user may not be able to receive the virtual resources corresponding to that task, which reduces the user's experience of participating in the task and decreases their participation in subsequent tasks, resulting in a poor user experience. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing virtual resources. It can evenly allocate virtual resources corresponding to a task during the effective time period of the task, improve the perception of the target object, bring a good task experience to the target object, and avoid the target object's participation in the task decreasing in the later stage of the effective time period of the task.

[0005] According to one aspect of the embodiments of this application, a method for processing virtual resources is provided, the method comprising:

[0006] In response to a client's request to acquire virtual resources associated with a target task, determine the execution result for the acquisition request;

[0007] If the execution result indicates that virtual resources have been obtained and the preset conditions are met, the virtual resources corresponding to the client will be allocated to the client.

[0008] The effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to a second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to that second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity corresponding to that second time period, and the second ratio corresponding to each second time period is the ratio of the duration of that second time period to the duration of the first time period;

[0009] The preset conditions include:

[0010] The total number of virtual resources allocated in the first time period is less than the first quantity;

[0011] The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period. The second target time period refers to the second time period to which the time point of responding to the acquisition request belongs.

[0012] According to another aspect provided in the embodiments of this application, a virtual resource processing apparatus is provided, the apparatus comprising:

[0013] The execution result determination module is used to determine the execution result for the virtual resource acquisition request associated with the target task in response to the client.

[0014] The virtual resource allocation module is used to allocate the virtual resource corresponding to the acquisition request to the client when the execution result is that the virtual resource has been obtained and the preset conditions are met.

[0015] The effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to a second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to that second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity corresponding to that second time period, and the second ratio corresponding to each second time period is the ratio of the duration of that second time period to the first duration.

[0016] The preset conditions include:

[0017] The total number of virtual resources allocated in the first time period is less than the first quantity;

[0018] The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period. The second target time period refers to the second time period to which the time point of responding to the acquisition request belongs.

[0019] Optionally, the device can be a target application server corresponding to a client among multiple application servers, where the target application server corresponding to any client is the application server among multiple application servers that corresponds to the geographical location information of the client.

[0020] Optionally, the allocatable virtual resources corresponding to the target task are stored in at least two storage regions, each storage region corresponding to different geographical location information, and the total number of allocatable virtual resources corresponding to each storage region is determined based on a first quantity and the number of storage regions; the allocatable virtual resources corresponding to each second time period include the allocatable virtual resources in each storage region corresponding to that second time period;

[0021] When allocating virtual resources to a client, the virtual resource allocation module specifically performs the following functions:

[0022] Based on the geographical location information of the client, determine the target storage area corresponding to the client;

[0023] Allocate the virtual resources corresponding to the client within the target storage area to the client;

[0024] Wherein, the allocated quantity corresponding to the second target time period is less than the second quantity corresponding to the second target time period means that the allocated quantity of the target storage region in the second target time period is less than the allocatable quantity of the target storage region in the second target time period.

[0025] The preset conditions also include:

[0026] The total number of virtual resources allocated in the target storage region during the first time period is less than the total number of virtual resources available for allocation in the target storage region.

[0027] Alternatively, the device can also be used for:

[0028] The management server balances the remaining allocable quantity for each storage region using the following methods:

[0029] Within the effective time period corresponding to the target task, the first remaining allocable quantity of virtual resources corresponding to each storage area is determined based on a preset frequency.

[0030] Based on the first remaining allocable quantity corresponding to each storage region, the remaining allocable quantity corresponding to each storage region is balanced.

[0031] Optionally, when the device performs a balancing process on the first remaining allocable quantity corresponding to each storage region based on the first remaining allocable quantity corresponding to each storage region, it is specifically used for:

[0032] Based on the first remaining allocable quantity corresponding to each storage region, determine the first average value of the first remaining allocable quantity corresponding to each storage region;

[0033] For each first storage region whose first remaining allocable quantity is greater than the first average, the first remaining allocable quantity of each first storage region is reduced to the first average, and the total reduction of each first storage region is recorded. The total reduction is the sum of the first differences. A first difference is the difference between the first remaining allocable quantity of a first storage region and the first average.

[0034] For each second storage region whose first remaining allocable quantity is less than the first average, the second remaining allocable quantity corresponding to each second storage region is determined again, and the second difference between each second storage region and the first average is determined; based on the second difference corresponding to each second storage region, virtual resources equal to the total reduction amount are evenly increased to each second storage region, and the increase amount corresponding to a second storage region is positively correlated with the corresponding second difference.

[0035] Optionally, the allocatable virtual resources are stored in the storage area, and the device is also used for:

[0036] If the execution result indicates that the virtual resource has been obtained and the preset conditions are met, a request identifier corresponding to the acquisition request will be generated in response to the acquisition request.

[0037] When allocating virtual resources to a client, the virtual resource allocation module specifically performs the following functions:

[0038] Deduct the virtual resources corresponding to the client from the storage area;

[0039] Allocate the virtual resources corresponding to the client to the client;

[0040] Get the allocation status corresponding to the request identifier. The allocation status indicates whether the virtual resource corresponding to the client was successfully allocated or not.

[0041] If the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client has not been successfully allocated, the virtual resource corresponding to the client will be restored to the storage area.

[0042] Optionally, the first time period is divided into at least two second time periods in the following manner:

[0043] Divide the first time period into multiple second time periods with at least two time levels by performing the following operations at least twice:

[0044] The first time period is taken as the initial time period to be divided. According to the first set duration corresponding to the time period to be divided, the time period to be divided is divided into at least two second time periods at a time level, and each second time period at that level is taken as a new time period to be divided.

[0045] The second quantity corresponding to a second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs.

[0046] The allocated quantity corresponding to the second time period of the target is less than the second quantity corresponding to the second time period of the target, including:

[0047] The allocated quantity for the second time period of each level's target is less than the second quantity for the second time period of the corresponding level's target.

[0048] Alternatively, the device can also be used for:

[0049] For any second time period, if at the end of the second time period the number of allocated virtual resources corresponding to the second time period is less than the number of second resources corresponding to the second time period, then the number of second resources corresponding to each subsequent second time period is balanced based on the remaining number of allocated virtual resources corresponding to the second time period.

[0050] According to another aspect provided in the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.

[0051] According to another aspect provided in the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the above-described method.

[0052] According to another aspect provided in the embodiments of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the above-described method.

[0053] The beneficial effects of the technical solutions provided in this application are:

[0054] The virtual resource processing method provided in this application involves dividing the effective time period (first time period) of the target task into at least two second time periods. Based on the ratio between the duration of each second time period and the duration of the first time period, and the total allocable quantity of virtual resources corresponding to the target task (i.e., the first quantity), the allocable quantity of virtual resources corresponding to each second time period (i.e., the second quantity) is determined. After receiving a virtual resource acquisition request from a client associated with the target task, in response to the acquisition request, if the execution result of the acquisition request is to obtain virtual resources, and the allocated quantity of virtual resources in the first time period is less than the first quantity, and the allocated quantity corresponding to the target second time period to which the acquisition request belongs is less than the second quantity corresponding to the target second time period, the virtual resources corresponding to the acquisition request are sent to the client. This ensures that virtual resources for the target task can be allocated normally in each time period within the effective time period of the target task. It guarantees that regardless of whether the target object participates in the target task in each time period included in the effective time period of the target task, it can obtain virtual resources with the same probability. This avoids the situation where the corresponding virtual resources have been allocated before the effective time period of the target task ends, which would lead to a decrease in the participation of the target object in the later stage of the effective time period of the target task. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0056] Figure 1 A flowchart illustrating the virtual resource processing method provided in an embodiment of this application is shown.

[0057] Figure 2 This is a schematic diagram illustrating how to determine whether a virtual resource meets preset conditions, as provided in an embodiment of this application.

[0058] Figure 3 A schematic diagram illustrating the allocation of virtual resources as provided in an embodiment of this application;

[0059] Figure 4 This is a schematic diagram illustrating the relationship between a server and a target task distribution area, provided as an embodiment of this application.

[0060] Figure 5 A schematic diagram illustrating a storage method for allocable virtual resources provided in an embodiment of this application;

[0061] Figure 6 This is a schematic diagram illustrating the balancing of the remaining allocable quantity of virtual resources, provided as an embodiment of this application.

[0062] Figure 7 A schematic diagram of the structure of a virtual resource processing system provided in an embodiment of this application;

[0063] Figure 8 A schematic diagram of the structure of a virtual resource processing system provided in an embodiment of this application;

[0064] Figure 9 A flowchart illustrating a method for processing virtual resources provided in an embodiment of this application;

[0065] Figure 10 A schematic diagram of a virtual resource processing apparatus provided in an embodiment of this application is shown;

[0066] Figure 11 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown. Detailed Implementation

[0067] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0068] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”

[0069] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0070] Based on the foregoing description, and addressing the technical problems or areas for improvement in related technologies where the target audience's experience declines and their interest in participating in the task decreases in the later stages of the task's effective period, this application proposes a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing virtual resources. This solution divides the effective period (first period) of the target task into at least two second periods. Based on the ratio between the duration of each second period and the duration of the first period, and the total allocable quantity of virtual resources corresponding to the target task (i.e., the first quantity), the allocable quantity of virtual resources corresponding to each second period is determined (i.e., the second quantity). This ensures that the relationship between the allocated quantity of virtual resources in the first period and the first quantity, and the relationship between the allocated quantity of virtual resources in the second period and the second quantity, both satisfy preset conditions. Furthermore, if the execution result of a virtual resource acquisition request associated with the target task by a client is that virtual resources are obtained, the virtual resources corresponding to that client are sent to the client. This allows for the allocation of virtual resources corresponding to the task in each period included in the effective period, preventing a decrease in the target audience's participation in the task in the later stages of the effective period.

[0071] The virtual resource processing method provided in this application embodiment can be implemented based on cloud technology. For example, the data computation involved in determining the execution result of a virtual resource acquisition request and determining whether preset conditions are met can be performed using cloud computing. Cloud technology refers to a hosting technology that unifies hardware, software, network, and other resources within a wide area network or local area network to achieve data computation, storage, processing, and sharing.

[0072] The virtual resource processing method provided in this application embodiment can be applied to various application scenarios, including any scenario where a computer program can run. Based on this method, any scenario involving the acquisition of virtual resources associated with a target task can be obtained. For example, this method can be applied to the field of intelligent transportation, such as the process of lottery for license plate numbers. The license plate numbers displayed on the internet are the virtual resources in this application embodiment, and the task of lottery is the target task. This method can be applied to the process of assigning license plate numbers to the target object that completed the lottery operation after the lottery operation is performed. As another example, this method can be applied to a game scenario, where game props in the game scenario can be identified as virtual resources in this application embodiment. This method can be applied to the process of assigning game props corresponding to the game task to the target object that completed the game task after a certain game task is completed.

[0073] The execution entity of the virtual resource processing method provided in this application embodiment can be a virtual resource processing device. This virtual resource processing device can be any computer device, including but not limited to a terminal or server. The terminal (also referred to as the terminal corresponding to the target object or the device corresponding to the target object (User Equipment, UE)) can be a smartphone, tablet computer, laptop computer, desktop computer, intelligent voice interaction device (e.g., smart speaker), wearable electronic device (e.g., smartwatch), in-vehicle terminal, smart home appliance (e.g., smart TV), AR (Augmented Reality) / VR (Virtual Reality) device, etc., but is not limited to these.

[0074] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0075] Alternatively, the processing of the virtual resource can also be implemented by the processor calling computer-readable instructions stored in memory.

[0076] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0077] This application provides a method for processing virtual resources. This method can be applied to any of the aforementioned terminals or servers, and this application does not impose any limitations. In this application embodiment, the method is described using an application to a server as an example. Of course, when this method is applied to a terminal, a server can also be invoked to better implement the virtual resource processing method.

[0078] Figure 1 A flowchart illustrating a virtual resource processing method provided in an embodiment of this application is shown. Figure 1 As shown, the method may include steps S110 and S120.

[0079] Step S110: In response to the client's virtual resource acquisition request associated with the target task, determine the execution result for the acquisition request.

[0080] Step S120: If the execution result indicates that virtual resources have been obtained and the preset conditions are met, the virtual resources corresponding to the client are allocated to the client.

[0081] The effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to a second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to that second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity corresponding to that second time period, and the second ratio corresponding to each second time period is the ratio of the duration of that second time period to the duration of the first time period.

[0082] The preset conditions include:

[0083] The total number of virtual resources allocated in the first time period is less than the first quantity;

[0084] The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period. The second target time period refers to the second time period to which the time point of responding to the acquisition request belongs.

[0085] In this embodiment, the method of setting the target task and the corresponding virtual resources is not limited and can be determined according to the actual situation. Optionally, the target task can be a target task based on the browser task system, for example, the target task can be set as a card collection task or a like task. The virtual resources associated with the target task can be virtual props, virtual gifts, etc.

[0086] After the target task is completed, a virtual resource acquisition request for the target task can be initiated based on the completion operation of the target task. Of course, the virtual resource acquisition request for the target task can be initiated immediately upon completion of the target task. Alternatively, the virtual resource acquisition request can be initiated after a preset time period based on the completion operation of the target task. The preset time period can be determined according to actual circumstances, and this embodiment does not impose any restrictions on it.

[0087] The virtual resource acquisition request may include an identifier corresponding to the client and an indicator indicating that the target task has been completed. In this embodiment, the form of the client identifier and the target task status identifier is not limited, as long as they can be distinguished. For example, the client identifier can be a letter, used to indicate the client corresponding to the current virtual resource acquisition request. The target task status identifier can be a number; for example, 0 can be set to indicate that the target task is not completed, and 1 to indicate that the target task is completed. As an example, if the client identifier in the virtual resource acquisition request is 'a' and the target task status identifier is '1', then the virtual resource acquisition request can be represented as a virtual resource acquisition request issued by client 'a' who has completed the target task.

[0088] It should be understood that if the status flag of the target task in the retrieval request is 0, then no response needs to be given to the retrieval request; if the status flag of the target task in the retrieval request is 1, then a response needs to be given to the retrieval request, and subsequent processing should be performed based on the corresponding result of the retrieval request.

[0089] In this implementation, at least two execution results for the acquisition request can be preset. This application embodiment does not limit the specific number of execution results set, which can be determined according to actual circumstances. Specifically, based on whether virtual resources are obtained, the at least two execution results can be divided into "determined to have obtained virtual resources" and "determined not to have obtained virtual resources." As an example, the target task can be a lottery activity, and the preset execution results can include "Thank you for participating," "first virtual resource," and "second virtual resource," where "Thank you for participating" corresponds to "determined not to have obtained virtual resources," and "first virtual resource" and "second virtual resource" correspond to "determined to have obtained virtual resources."

[0090] After receiving a virtual resource acquisition request from a client for a target task, random sampling can be performed based on at least two preset execution results, and the random sampling result can be used as the execution result of the acquisition request. Specifically, if the execution result indicates that no virtual resource was obtained, the execution result can be directly sent to the client corresponding to the client identifier in the acquisition request. If the execution result indicates that a virtual resource was obtained, it can be further determined whether preset conditions are met. If the execution result indicates that a virtual resource was obtained and the preset conditions are met, the virtual resource indicated by the execution result can be used as the virtual resource corresponding to the client corresponding to the client identifier in the acquisition request, and the virtual resource corresponding to that client can be allocated to the client. If the execution result indicates that a virtual resource was obtained but the preset conditions are not met, "determined not to obtain virtual resource" is sent as the execution result to the client corresponding to the client identifier in the acquisition request. In this embodiment, the method for processing the virtual resource is mainly described using the example of obtaining a virtual resource, and only one type of virtual resource is used as an example.

[0091] The effective time period of the target task refers to the period during which virtual resources are available, the duration of the target task, and the first time period. The total number of allocatable virtual resources corresponding to the target task refers to the total number of allocatable virtual resources in the first time period and the first quantity. The specific values ​​of the first time period and the first quantity can be determined according to the actual situation, and this application does not impose any restrictions on them.

[0092] In this embodiment, the duration of each second time period can be the same or different. Since the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity, and the second ratio corresponding to each second time period is the ratio of the duration of the second time period to the duration of the first time period, and the first ratio corresponding to each second time period is positively correlated with the first ratio corresponding to the second time period, when the duration of each second time period is the same (i.e., when the first time period is divided into at least two second time periods), the second quantity corresponding to each second time period should also be the same. When the duration of each second time period is different, the second quantity corresponding to each second time period should also differ. In the case where the ratio of the duration of a second time period to the duration of the first time period is 1:3, the second quantity corresponding to that second time period is 1 / 3 of the first quantity.

[0093] If the execution result of the acquisition request is that virtual resources are obtained, the target second time period can be determined based on the time point at which the executing entity of the method responds to the acquisition request (hereinafter referred to as "the time point corresponding to the acquisition request") and the start and end times corresponding to each second time period. That is, if the time point corresponding to the acquisition request is greater than or equal to the start time point corresponding to a second time period, and the time point corresponding to the acquisition request is less than the end time point corresponding to that second time period, then that second time period is the second time period to which the time point of responding to the acquisition request belongs, and that second time period is determined as the target second time period.

[0094] After determining the target second time period, based on the total number of virtual resources allocated in the first time period, the number allocated in the target second time period, the first quantity, and the second quantity corresponding to the target second time period, it can be determined whether preset conditions are met. If the execution result indicates that virtual resources have been obtained and the preset conditions are met, the virtual resources corresponding to the client are allocated to the client. The total number of virtual resources allocated in the first time period refers to the number of virtual resources allocated during the time period from the start time of the first time period to the time corresponding to the acquisition request. The number of virtual resources allocated in the target second time period refers to the number of virtual resources allocated during the time period from the start time of the target second time period to the time corresponding to the acquisition request. The number of virtual resources allocated can be determined based on the allocation operation of successfully allocating the virtual resources corresponding to the client to the client; that is, if an allocation operation is successfully executed, the number of allocated virtual resources is increased by 1.

[0095] As a concrete example, suppose the first time period is from 00:00 on September 1, 2021 to 24:00 on September 30, 2021, with a first quantity of 7200. Dividing this first time period into three equal second time periods, each second time period corresponds to a second quantity of 2400. The resulting first second time period is from 00:00 on September 1, 2021 to 24:00 on September 10, 2021; the second second time period is from 00:00 on September 11, 2021 to 24:00 on September 20, 2021; and the third second time period is from 00:00 on September 21, 2021 to 24:00 on September 30, 2021. Taking the time point of responding to the virtual resource acquisition request associated with the target task as 13:07 on September 15, 2021, it can be determined that the time point corresponding to this acquisition request belongs to the second second time period, i.e., the second second time period is the target second time period. When determining that the execution result of the request is to obtain virtual resources, assuming that the number of virtual resources allocated in the first time period is 3000 and the number allocated in the target second time period is 1000, it can be determined that the total number of virtual resources allocated in the first time period is less than the first quantity, and the number allocated in the target second time period is less than the second quantity in the target second time period. This satisfies the preset conditions, and the virtual resources corresponding to the client can be sent to the client. Optionally, after receiving the virtual resources corresponding to the client, the client can store the virtual resources in the client's corresponding virtual resource library.

[0096] It should be understood that, since the execution result of a request to obtain a virtual resource can be determined to be obtained, there can be multiple types of virtual resources. Therefore, a first target quantity (i.e., the total number of allocable virtual resources corresponding to various virtual resources within the effective time period of the target task) and a second target quantity (i.e., the number of allocable virtual resources corresponding to various virtual resources within the second target time period) can be set for different virtual resources. Correspondingly, the preset conditions are: the total number of allocated target virtual resources corresponding to the current request within the first time period is less than the first target quantity; and the number of allocated target virtual resources within the second target time period is less than the second target quantity. And if the execution result determines that the target virtual resource has been obtained and the preset conditions are met, the target virtual resource corresponding to the request is allocated to the client.

[0097] Based on the virtual resource processing method provided in the embodiments of this application, it is possible to allocate virtual resources corresponding to the target task in different time periods in the time dimension within the effective time period of the target task. This ensures that no matter which time period the target object participates in the target task within the effective time period of the target task, it can obtain virtual resources with the same probability. This avoids the situation where the corresponding virtual resources have been allocated before the effective time period of the target task ends, resulting in a decrease in the participation of the target object in the later part of the effective time period of the target task.

[0098] Optionally, the first time period is divided into at least two second time periods in the following manner:

[0099] Divide the first time period into multiple second time periods with at least two time levels by performing the following operations at least twice:

[0100] The first time period is taken as the initial time period to be divided. According to the first set duration corresponding to the time period to be divided, the time period to be divided is divided into at least two second time periods at a time level, and each second time period at that level is taken as a new time period to be divided.

[0101] The second quantity corresponding to a second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs.

[0102] The allocated quantity corresponding to the second time period of the target is less than the second quantity corresponding to the second time period of the target, including:

[0103] The allocated quantity for the second time period of each level's target is less than the second quantity for the second time period of the corresponding level's target.

[0104] Time hierarchy refers to the hierarchy along the time dimension. Optionally, a period of time can be divided into sub-periods of different time levels based on different time units, with each time unit corresponding to a time hierarchy. For example, dividing 30 days into "days" yields 30 second periods, each lasting one day (i.e., 24 hours). Alternatively, a period of time can be divided into sub-periods of different time levels based on the same time unit but different set durations (i.e., the duration of the resulting periods). For example, dividing 30 days into "two days" as the first set duration yields 15 second periods, each lasting two days.

[0105] The number of levels in the second time period obtained in this application embodiment is not limited and can be determined according to the actual situation. Of course, the time level corresponding to the first time period can be determined as the first time level; the time level corresponding to each second time period obtained after dividing the first time period into two time periods according to the first set duration can be determined as the second time level; the time level corresponding to each second time period obtained after dividing any of the first time periods into two time periods according to the second set duration can be determined as the third time level, and so on. The time level corresponding to each time period (including the first time period and the second time period) can be determined, and each time period can be determined as a time period corresponding to a different time level.

[0106] Specifically, each time a time period to be divided is defined, the set duration corresponding to the current time period to be divided can be determined based on the duration of the current time period to be divided and the preset number of second time periods to be obtained based on the current time period to be divided. Then, the current time period to be divided is divided according to the set duration corresponding to the current time period to be divided, resulting in each second time period corresponding to the current time period. Furthermore, for one of the divided second time periods, the allocatable quantity of virtual resources corresponding to the second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs. This is the second quantity corresponding to the second time period.

[0107] Based on this division method, the effective time period of the target task can be divided into second time periods at different levels.

[0108] After dividing the first time period according to the above division method, during the allocation of virtual resources, the preset conditions can be set as follows: the total number of virtual resources allocated in the first time period is less than the first quantity; the number of virtual resources allocated in the target second time period of each level is less than the second quantity corresponding to the target second time period of the corresponding level.

[0109] By using the above division method, it is possible to more evenly distribute the virtual resources corresponding to the target task in the time dimension within the effective time period of the target task, and more accurately ensure that the target object can obtain virtual resources with the same probability regardless of which time period it participates in the target task within the effective time period of the target task.

[0110] like Figure 2As shown in the example above, if the first time period (the first time level) is from 00:00 on September 1, 2021 to 24:00 on September 30, 2021, the first time period is 30 days long and has 72,000 segments. This first time period needs to be divided into multiple second time periods corresponding to two time levels. The first division results in 30 second time periods, and the second division results in 24 second time periods. When performing the first division with the first time period as the segment to be divided, the first set duration corresponding to the current segment is 1 day; when performing the second division with one of the second time periods obtained from the first division as the segment to be divided, the second set duration corresponding to the current segment is 1 hour. According to this division method, the first time period can be divided into 30 second time periods of 1 day each, with each second time period resulting from the first division having 2,400 segments. Similarly, each second time period resulting from the first division can be divided into 24 second time periods of 1 hour each, with each second time period resulting from the second division having 100 segments. Accordingly, the preset condition can be set as follows: when responding to a request for virtual resources, the total number of allocated virtual resources is less than 72,000 (i.e., the corresponding...). Figure 2 (Middle-level restrictions configuration); the total number of allocated virtual resources on the same day the request is received is less than 2400 (corresponding to...) Figure 2 (Mid-level restriction configuration); within the current hour to which the request belongs, the total number of allocated virtual resources is less than 100 (corresponding to...) Figure 2 (Mid-hour level restriction configuration). Virtual resources can only be allocated to the client if the execution result of the request determines that a virtual resource has been obtained, and all preset conditions are met. Specifically, determining whether the preset conditions are met means... Figure 2 The system determines the inventory status of virtual resources (corresponding to the target task).

[0111] In the actual processing of virtual resources, due to factors such as a small number of target objects participating in and completing the target task within a certain second time period, the allocated quantity of virtual resources corresponding to that second time period may be less than the second quantity corresponding to that second time period at the end of that second time period. That is, at the end of a certain second time period, there may still be an unallocated quantity of virtual resources corresponding to that second time period (i.e., a remaining allocable quantity). Therefore, it may be possible that a large number of remaining allocable quantities remain after the effective time period of the target task ends, which contradicts the original design intent of the target task. Considering this, the embodiments of this application also provide the following optional implementation methods:

[0112] Optionally, the method further includes:

[0113] For any second time period, if at the end of the second time period the number of allocated virtual resources corresponding to the second time period is less than the number of second resources corresponding to the second time period, then the number of second resources corresponding to each subsequent second time period is balanced based on the remaining allocable number of virtual resources corresponding to the second time period.

[0114] In the actual process of allocating virtual resources, if there is a remaining allocable quantity of virtual resources corresponding to a certain second time period at the end of that second time period, the remaining allocable quantity corresponding to that second time period can be added to the second quantity corresponding to each second time period after that second time period (i.e., the allocable quantity of virtual resources corresponding to each second time period after that second time period) according to the proportional relationship between the allocable quantities of virtual resources corresponding to each second time period after that second time period.

[0115] As an example, the first period mentioned above is from 00:00 on September 1, 2021 to 24:00 on September 30, 2021, with a first quantity of 7200. Dividing this first period into three equal second periods, each second period corresponds to a second quantity of 2400. If, at the end of the first second period, the allocated quantity of virtual resources corresponding to that second period is 1800, which is less than 2400 (the second quantity corresponding to that second period), then the remaining allocable quantity of virtual resources corresponding to that first second period is 600. Since each second period after that first second period corresponds to... The second quantity is 2400, meaning the ratio between the allocable virtual resources for the second and third time periods is 1:1. Therefore, based on this ratio, 600 allocable virtual resources can be added equally to the allocable virtual resources for the second and third time periods, increasing both the allocable virtual resources for the second and third time periods to 2700.

[0116] Based on the above-mentioned balancing method, at the end of a certain second time period, the remaining allocable amount of virtual resources corresponding to that second time period can be used to balance the second quantity corresponding to each subsequent second time period, thereby increasing the second quantity corresponding to each subsequent second time period and further improving the participation experience of the target objects participating in the target task in each subsequent second time period.

[0117] If the execution result confirms that virtual resources have been obtained and preset conditions are met, during the actual allocation of virtual resources, network call failures or other reasons may occur. This could result in the virtual resources being deducted from the storage area corresponding to the client, but not actually being successfully sent to the client, leading to wasted virtual resources and instances of insufficient or missed allocation of virtual resources. To avoid this situation, this application embodiment also provides the following optional implementation methods:

[0118] Optionally, the allocatable virtual resources are stored in a storage area, and the method further includes:

[0119] If the execution result indicates that the virtual resource has been obtained and the preset conditions are met, a request identifier corresponding to the acquisition request will be generated in response to the acquisition request.

[0120] Allocate the virtual resources corresponding to the client to the client, including:

[0121] Deduct the virtual resources corresponding to the client from the storage area;

[0122] Allocate the virtual resources corresponding to the client to the client;

[0123] Get the allocation status corresponding to the request identifier. The allocation status indicates whether the virtual resource corresponding to the client was successfully allocated or not.

[0124] If the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client has not been successfully allocated, the virtual resource corresponding to the client will be restored to the storage area.

[0125] In this implementation, the request identifier corresponding to the request can be used to indicate that the execution result of the request is that virtual resources have been obtained and preset conditions are met, i.e., the conditions for allocating gifts are met. This application embodiment does not limit the way the request identifier is set; optionally, the request identifier can be numbers, letters, or a combination of at least two types of characters.

[0126] Since the virtual resources in this embodiment may not actually exist, the virtual resources corresponding to the acquisition request can be deducted from the storage area by subtracting one from the storage quantity of the virtual resources corresponding to the client in the storage area.

[0127] This application can either obtain the allocation status of the request identifier while allocating the virtual resource corresponding to the client, or it can detect whether the client has acquired the corresponding virtual resource. If the client has acquired the virtual resource, the allocation status of the request identifier is determined to be successful; otherwise, it is determined to be unsuccessful. This application does not limit the actual method of obtaining the allocation status of the request identifier. For example, any of the above methods can be used, or a combination of both methods can be used. When combining the above two methods, if both allocation statuses indicate successful allocation, the allocation status of the request identifier is determined to be successful; if either allocation status indicates unsuccessful allocation, the allocation status of the request identifier is determined to be unsuccessful.

[0128] Optionally, if the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client is not allocated, or if the allocation status corresponding to the request identifier is not obtained, indicating that the virtual resource corresponding to the client currently deducted from the storage area has not been successfully allocated to the client, then the virtual resource corresponding to the client currently deducted from the storage area can be restored to the storage area.

[0129] Based on the above method, even if the virtual resources corresponding to the client have been deducted from the storage area but not successfully allocated to the client, the deducted virtual resources can be restored to the storage area. This avoids the waste of deducted virtual resources due to network call failures or other reasons, preventing situations where virtual resources are under-allocated or missed. It also avoids the situation where, when a client fails to acquire a virtual resource and then re-acquires it (i.e., re-initiates an acquisition request), virtual resources in the storage area are deducted repeatedly for the same acquisition request (since both acquisition requests from the client correspond to the same virtual resource, they can be considered as a single acquisition request).

[0130] Based on the above, in order to avoid under-issuance or omission of virtual resources, it is necessary to ensure that the operation of deducting the virtual resources corresponding to the client from the storage area (i.e., the virtual resource deduction operation) and the operation of allocating the virtual resources corresponding to the client to the client (i.e., the virtual resource allocation operation) are executed simultaneously. That is, if the execution result of the acquisition request is that the virtual resources are obtained and the preset conditions are met, the virtual resource deduction operation and the virtual resource allocation operation need to support idempotency (the virtual resource deduction operation and the virtual resource allocation operation are executed successfully at the same time).

[0131] Optionally, such as Figure 3 As shown, a transaction-supporting storage component can be used to place the virtual resource deduction operation and the virtual resource allocation operation into the same transaction generated by the transaction-supporting storage component. This ensures that the virtual resource deduction operation and the virtual resource allocation operation can be successfully executed simultaneously. When the virtual resource deduction operation is successfully executed, the virtual resource allocation operation will also be successfully executed. This application embodiment does not limit the specific implementation method of the transaction-supporting storage component. For example, MySQL transactions, TDSQL transactions (a type of database transaction), or Lua (a scripting language) for Redis (a type of database) can be used as the transaction-supporting storage component.

[0132] In related technologies, the allocation of virtual resources typically relies on the performance of the underlying storage components. During the allocation process, if, within a certain timeframe, the number of client-initiated virtual resource acquisition requests associated with the target task exceeds the performance of the underlying storage components, it can lead to excessive storage load on those components, triggering a cascading failure. This can cause the virtual resource allocation system to be unable to handle the client-initiated virtual resource acquisition requests associated with the target task, significantly impacting the user experience. To address this, this application provides the following optional implementation methods:

[0133] Optionally, the method is executed by the target application server corresponding to the client among multiple application servers, where the target application server corresponding to any client is the application server among the multiple application servers that corresponds to the geographical location information of the client.

[0134] In this implementation, the target task distribution area can be divided into different target task distribution sub-regions based on any regional division method; this application does not impose specific limitations on this. For example, the target task distribution area can be divided into South China, North China, and Central China, etc. One or more application servers are set up for each target task distribution sub-region to respond to virtual resource acquisition requests initiated by clients within the corresponding target task distribution sub-region (i.e., the client's geographical location information belongs to the first target task distribution sub-region). The number of application servers for different target task distribution sub-regions can be determined according to actual conditions. For example, if the historical participation volume for the target task is high in a target task distribution sub-region, more application servers can be set up for that target task distribution sub-region.

[0135] It should be understood that the target task distribution can be further divided into sub-regions, and an application server corresponding to each sub-region can be set up. Furthermore, if an application server has a very large data processing volume, all client virtual resource acquisition requests can be handled by a single application server.

[0136] like Figure 4 As shown, the target task is executed in three target task distribution sub-regions: the first target task distribution sub-region, the second target task distribution sub-region, and the third target task distribution sub-region. The first target task distribution sub-region corresponds to one application server ①, which responds to virtual resource acquisition requests initiated by clients within this sub-region. The second target task distribution sub-region corresponds to two application servers, application server ② and application server ③, which also respond to virtual resource acquisition requests initiated by clients within this sub-region. Specifically, the idle server among application servers ② and ③ can respond to virtual resource acquisition requests initiated by clients within the current second target task distribution sub-region. The third target task distribution sub-region corresponds to three application servers: application server ④, application server ⑤, and application server ⑥. Specifically, the third target task distribution sub-region can be further divided into sub-region a, sub-region b, and sub-region c. Sub-region a corresponds to application server ④, sub-region b corresponds to application server ⑤, and sub-region c corresponds to application server ⑥. That is, application server ④ is used to respond to virtual resource acquisition requests initiated by clients in sub-region a, application server ⑤ is used to respond to virtual resource acquisition requests initiated by clients in sub-region a, and application server ⑥ is used to respond to virtual resource acquisition requests initiated by clients in sub-region a.

[0137] Optionally, based on the geographic location information corresponding to a client and the target task distribution sub-region to which that geographic location information belongs, the target task distribution sub-region to which the geographic location information belongs can be determined as the target task distribution sub-region to which the client belongs. Furthermore, based on the correspondence between the target task distribution sub-regions to which each client belongs and the application servers corresponding to each target task distribution sub-region, the target application server corresponding to that client can be determined. Thus, when the client issues a virtual resource acquisition request, the response to the acquisition request issued by the client is based on the target application server corresponding to that client.

[0138] For example, when a client in the North China region issues a virtual resource acquisition request, the application server in the North China region responds to the acquisition request, determines the execution result of the acquisition request, and further determines whether to send the virtual resource corresponding to the client to the client.

[0139] By processing virtual resource acquisition requests for each client through an application server corresponding to that client, independent processing of acquisition requests for each target task distribution sub-region can be achieved. This avoids processing all acquisition requests for all target task distribution sub-regions through a single application server, reducing the data processing pressure on the application servers corresponding to each client. This ensures that even when the number of virtual resource acquisition requests suddenly increases, the system can still respond quickly to each client's acquisition request, guaranteeing the high-speed operation of the virtual resource processing system. Compared to related technologies that rely on the performance of underlying storage components to process virtual resource acquisition requests, this avoids situations where excessive storage load on the underlying storage components triggers a cascading failure, leading to an inability to respond to client acquisition requests.

[0140] Furthermore, since the processing of virtual resource acquisition requests for each client is based on the application server corresponding to each client, the processing efficiency of virtual resource acquisition requests can be improved and the participation experience of the target object can be enhanced when the request volume of virtual resource acquisition requests is normal.

[0141] Furthermore, since one client can correspond to multiple application servers, if one application server fails, other application servers can still respond to the virtual resource acquisition requests sent by the client, ensuring that the virtual resource acquisition requests sent by the client can be successfully responded to.

[0142] As described above, allocable virtual resources are stored in the storage area. When the number of requests for virtual resource acquisition suddenly increases, the data access volume to this storage area will also increase. To avoid this situation, the embodiments of this application also provide the following optional implementation methods:

[0143] Optionally, the allocatable virtual resources corresponding to the target task are stored in at least two storage regions, each storage region corresponding to different geographical location information, and the total number of allocatable virtual resources corresponding to each storage region is determined based on a first quantity and the number of storage regions; the allocatable virtual resources corresponding to each second time period include the allocatable virtual resources of each storage region corresponding to that second time period:

[0144] Allocate the virtual resources corresponding to the client to the client, including:

[0145] Based on the geographical location information of the client, determine the target storage area corresponding to the client;

[0146] Allocate the virtual resources corresponding to the client within the target storage area to the client;

[0147] Wherein, the allocated quantity corresponding to the second target time period is less than the second quantity corresponding to the target time period means that the allocated quantity of the target storage area in the second target time period is less than the allocatable quantity of the target storage area in the second target time period.

[0148] The preset conditions also include:

[0149] The total number of virtual resources allocated in the target storage region during the first time period is less than the total number of virtual resources available for allocation in the target storage region.

[0150] In this implementation, the allocatable virtual resources corresponding to the target task can be stored in different regions, with at least two storage regions. The total number of allocatable virtual resources in each storage region can be the same or different; this embodiment does not impose any restrictions on this. Figure 5 As shown, the allocatable virtual resources corresponding to the target task can be stored in three storage areas (the first storage area, the second storage area, and the third storage area, respectively), and each storage area can be divided into three storage sub-areas.

[0151] Optionally, the storage area in this implementation can correspond one-to-one with the target task distribution sub-regions described above. The storage area in this implementation can also correspond one-to-one with the application servers described above. This application embodiment does not impose any limitations on this. Of course, when each target task distribution sub-region corresponds to one application server (i.e., the target task distribution sub-region and the application server correspond one-to-one), the storage area, the target task distribution sub-region, and the application server are all one-to-one. Correspondingly, if the historical participation volume for the target task is high in a target task distribution sub-region, more application servers, more storage areas, or a larger total number of allocable virtual resources can be set for that target task distribution sub-region.

[0152] The sum of the total number of allocable virtual resources corresponding to all storage regions is the first quantity. Correspondingly, if the total number of allocated virtual resources in the first time period under the preset conditions described above is less than the first quantity, that is, the sum of the total number of allocated virtual resources corresponding to all storage regions in the first time period is less than the first quantity.

[0153] In this implementation, the second quantity corresponding to each second time period can be determined based on the duration of the first time period, the duration of the second time period, and the first quantity. Based on the duration of the first time period, the duration of the second time period, and the total number of allocatable virtual resources corresponding to each storage region, the allocatable quantity of each storage region in each second time period can be determined.

[0154] Correspondingly, for the preset conditions described above, the number of allocated items corresponding to the target second time period is less than the second number corresponding to the target second time period, that is, the number of allocated items of the target storage area corresponding to the target second time period is less than the number of allocatable items of the target storage area corresponding to the target second time period.

[0155] For each target storage region, the above-mentioned preset conditions should also include: the total number of virtual resources allocated in the target storage region during the first time period is less than the total number of virtual resources available for allocation in the target storage region.

[0156] Of course, based on the above method of determining the second quantity corresponding to each second time period when the first time period is divided into at least two time levels, the total number of allocable virtual resources corresponding to each storage area can be divided into the number of allocable resources corresponding to each storage area in each second time period.

[0157] By storing the allocatable virtual resources corresponding to the target task in at least two storage regions, and determining the allocatable quantity for each storage region in each second time period based on the total number of allocatable virtual resources corresponding to each storage region, the preset conditions for each storage region are determined based on the aforementioned method of determining preset conditions. That is, for each storage region, in response to a request from a client corresponding to that storage region, if the execution result of the request is that virtual resources are obtained and the preset conditions for that storage region are met, the virtual resources corresponding to the client in that storage region are allocated to the client. This allows for independent allocation of virtual resources in different storage regions, independent control of each storage region, and reduces the data access pressure when only one storage region is set up. In cases where the execution result of a request is that virtual resources are obtained, it is possible to quickly determine whether the preset conditions are further met, and if the preset conditions are met, virtual resources can be quickly obtained from the storage region and allocated to the client.

[0158] It is understandable that, although storing the allocatable virtual resources corresponding to the target task in at least two storage areas can reduce the data access pressure when only one storage area is set, during the effective period of the target task, the remaining allocatable resources in different storage areas may be uneven due to differences in the geographical location information (i.e., the acquisition requests initiated by the client) of different storage areas. This leads to differences in the probability of the target object obtaining virtual resources in different storage areas, resulting in a deviation in the user experience. To address this, this application embodiment also provides the following optional implementation methods to ensure that the remaining allocatable resources in each storage area remain consistent during the effective period of the target task. The specific solutions are as follows:

[0159] Optionally, the method may further include:

[0160] The management server balances the remaining allocable quantity for each storage region using the following methods:

[0161] Within the effective time period corresponding to the target task, the first remaining allocable quantity of virtual resources corresponding to each storage area is determined based on a preset frequency.

[0162] Based on the first remaining allocable quantity corresponding to each storage region, the remaining allocable quantity corresponding to each storage region is balanced.

[0163] This implementation can be achieved through a management server (i.e., a migration server). This migration server can be an execution entity independent of the virtual resource processing method, or it can be an execution entity for the virtual resource processing method. That is, the migration server can be one of the multiple application servers described above; this application embodiment does not impose any limitations on this. Of course, if a server is powerful enough to simultaneously respond to all acquisition requests, distribute the virtual resources corresponding to the client to the client, and balance the remaining allocable resources for each storage area, then the aforementioned application server and the management server can be the same server.

[0164] Specifically, the migration server can be a local server or a cloud server. Currently, there can also be multiple migration servers. When there are multiple migration servers, one migration server can be designated as the master migration server, and the others can be designated as slave migration servers. If the master migration server fails, the migration operation can be performed through the remaining slave migration servers, that is, the remaining allocable quantity corresponding to each storage region can be balanced.

[0165] In this implementation, the preset frequency, which is the frequency at which the first remaining allocable quantity corresponding to each storage area is balanced, can be an experimental value or an empirical value, or it can be determined according to the actual situation. For example, the preset frequency can be set to 1 time / hour.

[0166] After obtaining the first remaining allocable quantity for each storage region, we can first determine the first average of the first remaining allocable quantity for each storage region, and then adjust the first remaining allocable quantity for each storage region to the first average, thereby achieving balanced processing of the first remaining allocable quantity for each storage region. Specifically, this can be achieved through the following steps:

[0167] First storage regions are identified where the first remaining allocable quantity in each storage region is greater than the first average, and second storage regions are identified where the first remaining allocable quantity in each storage region is less than the first average.

[0168] For each first storage region, determine the difference between the first remaining allocable quantity corresponding to each first storage region and the first average value, and migrate (i.e., take out) virtual resources with the corresponding difference from each first storage region, reduce the first remaining allocable quantity corresponding to each first storage region to the first average value, and record the total number of virtual resources migrated from each first storage region.

[0169] For each second storage region, determine the difference between the first remaining allocable quantity and the first average value corresponding to each second storage region, and obtain the allocable resources corresponding to each difference from all migrated allocable resources, add them to the corresponding second storage region, and add the first remaining allocable quantity of each second storage region to the first average value.

[0170] By balancing the first remaining allocable quantity for each storage region based on a preset frequency, it can be ensured that the remaining allocable quantity for each storage region remains consistent during the effective time period of the target task, thus ensuring that the probability of the client obtaining virtual resources is the same in each storage region.

[0171] It should be noted that, as described above, the types of virtual resources can include a variety of types. When the remaining allocable quantity corresponding to each storage region is balanced through the management server, the remaining allocable quantity of different types of virtual resources corresponding to each storage region can be treated as a whole and balanced for the remaining allocable quantity corresponding to each storage region; or, for a certain type of virtual resource, the remaining allocable quantity corresponding to each storage region can be balanced based on the remaining allocable quantity of that type of virtual resource corresponding to each storage region. This application embodiment does not limit this.

[0172] As an example, such as Figure 6 As shown, if there are three storage regions, and the first remaining allocable quantities for the first, second, and third storage regions are obtained at a frequency of once per hour (9, 12, and 15 respectively), and the first average is determined to be 12, then the first remaining allocable quantity for the third storage region is greater than the first average, and the first remaining allocable quantity for the first storage region is less than the first average. By migrating 3 virtual resources from the third storage region to the first storage region using a migration server, the remaining allocable quantity for each storage region is reduced to 12.

[0173] Considering that the remaining allocatable quantity of each storage region is constantly changing during the effective time period of the target task, that is, during the process of migrating virtual resources out of each first storage region or adding virtual resources to each second storage region, the remaining allocatable quantity of each storage region will change dynamically, which may cause the remaining allocatable quantity of each storage region to not remain completely consistent. In view of this, the embodiments of this application also provide the following optional implementation methods:

[0174] Optionally, the above-mentioned balancing of the first remaining allocable quantity for each storage region based on the first remaining allocable quantity for each storage region may include:

[0175] Based on the first remaining allocable quantity corresponding to each storage region, determine the first average value of the first remaining allocable quantity corresponding to each storage region;

[0176] For each first storage region whose first remaining allocable quantity is greater than the first average, the first remaining allocable quantity of each first storage region is reduced to the first average, and the total reduction of each first storage region is recorded. The total reduction is the sum of the first differences. A first difference is the difference between the first remaining allocable quantity of a first storage region and the first average.

[0177] For each second storage region whose first remaining allocable quantity is less than the first average, the second remaining allocable quantity corresponding to each second storage region is determined again, and the second difference between each second storage region and the first average is determined; based on the second difference corresponding to each second storage region, virtual resources equal to the total reduction amount are evenly increased to each second storage region, and the increase amount corresponding to a second storage region is positively correlated with the corresponding second difference.

[0178] For a second storage region, the difference between the first remaining allocable quantity and the second remaining allocable quantity corresponding to the second storage region is the amount of virtual resources allocated to the client from the virtual resources corresponding to the second storage region that are equal to the first remaining allocable quantity during the time period between the time point when the first remaining allocable quantity of the second storage region is determined and the time point when the second remaining allocable quantity of the second storage region is determined. In other words, it is the actual reduction in the remaining allocable quantity of virtual resources in the second storage region.

[0179] It should be understood that in this implementation, for the third storage area corresponding to the first remaining allocable quantity equal to the first average value in each storage area, no processing is required for each third storage area.

[0180] When virtual resources, equal to the total reduction, are evenly added to each second storage region based on the second difference corresponding to each second storage region, the increase for each second storage region can be the corresponding second difference. Of course, if the sum of the second differences is less than the sum of the first differences (i.e., the total reduction), then the virtual resources can be added to each second storage region according to the ratio between the second differences within the second storage region.

[0181] Of course, in order to more accurately balance the first remaining allocable quantity corresponding to each storage region, after taking out virtual resources of the corresponding first difference from each first storage region, the second remaining allocable quantity corresponding to each storage region can be reconfirmed, and based on the second difference corresponding to each storage region, the virtual resources of the total reduction amount can be evenly added to each storage region.

[0182] After confirming the first remaining allocable quantity for each storage region, virtual resources equal to the first difference are migrated from each first storage region where the first remaining allocable quantity is greater than the first average. Then, the second remaining allocable quantity for each second storage region where the first remaining allocable quantity is less than the first average is confirmed again. Based on the second difference for each second storage region, the virtual resources migrated from each first storage region are evenly added to each second storage region. By combining the dynamic changes in the remaining allocable quantity of each storage region, the remaining allocable quantity of each storage region can be kept consistent, ensuring that the probability of clients obtaining virtual resources is the same in each storage region.

[0183] As an example, if there are four storage regions, and the first remaining allocable quantities for each region are 9 (for the first storage region), 12 (for the second storage region), 15 (for the third storage region), and 16 respectively, and the first average is determined to be 13 (for the fourth storage region), then the third and fourth storage regions have first remaining allocable quantities greater than the first average, meaning they belong to the first storage region. The first remaining allocable quantities for the first and second storage regions are less than the first average, meaning they belong to the second storage region. Based on this load balancing method, 2 virtual resources can be migrated from the third storage region and 3 virtual resources can be migrated from the fourth storage region, resulting in a total reduction of 5 for each of the first storage regions. The second remaining allocable quantities for each storage region are then determined to be 8, 10, 12, and 11 respectively, and the second differences between the first and second storage regions are 5 and 3 respectively. If the ratio of the second difference between the first and second storage regions is 5:3, then 5 virtual resources can be added to the first and second storage regions according to this ratio, with 3 virtual resources added to the first storage region and 2 virtual resources added to the second storage region. After leveling off, the remaining allocable resources for the first storage region are 11, the second storage region is 12, the third storage region is 12, and the fourth storage region is 11. It is evident that by considering the dynamic changes in each storage region, the remaining allocable resources in each storage region can be kept consistent.

[0184] To more clearly illustrate the virtual resource processing method provided in this application embodiment, this application embodiment also provides the following virtual resource processing system. This virtual resource processing system can be implemented based on the browser task system. By completing tasks in the browser, the customer can participate in a lottery (i.e., initiate a virtual resource acquisition request as mentioned above) and has a certain probability of receiving a red envelope (i.e., the execution result of the acquisition request as mentioned above, where the red envelope is the virtual resource mentioned above).

[0185] like Figure 7As shown, this browser-based task system can include an access layer, a logic layer, and a storage layer. The access layer mainly includes a login state verification module and an application access module. The client's identity can be verified through either the login state verification module or the application access module. Once verified, the task can be executed. The logic layer mainly includes a card-drawing system, a task system, a red envelope system, a probability system, a security system, a settlement system, and a warehouse system. The card-drawing system and the task system handle the logic of different tasks. The warehouse system, as provided in this embodiment, is the system specifically for processing virtual resources. This warehouse system ensures that virtual resources are not over-issued, are evenly distributed over time, can still smoothly handle all acquisition requests even when the number of acquisition requests suddenly increases, and can still smoothly handle all acquisition requests even if any server fails. The red envelope system handles specific virtual resources, the probability system determines the execution result of acquisition requests, the security system ensures the client's payment security during the processing of virtual resources, and the settlement system processes the settlement of virtual resources. The task event database and the card collection instruction database indicate the processing status of events related to the target task. The pre-issue event library and the acquire event library are used to indicate the processing status of events related to the acquisition and allocation of virtual resources. The storage area center stores virtual resources, which can be acquired from the storage area center and allocated to clients. Transaction support components 1 and 2 ensure that the operation of deducting the virtual resource corresponding to the client from the storage area and the operation of allocating the virtual resource corresponding to the client to the client are executed simultaneously, avoiding under-issuance or missed issuance of virtual resources.

[0186] The following is combined Figure 8 The virtual resource processing system shown and Figure 9 The flowchart shown illustrates the processing procedure for virtual resources in this application scenario. Figure 9 As shown, this method utilizes server 101, client (i.e., the target terminal described above) 102, and network 103. Figure 8 (Not shown) combined implementation. As described above, each client can correspond to one or more servers. In this embodiment, taking a client 102 corresponding to multiple servers 101, the target task being to collect 5 cards, the virtual resource being a red envelope, and the time level being three levels (30 days, 1 day, and 1 hour respectively) as an example, the method may include the following steps S11 to S16.

[0187] Step S11: After collecting 5 cards, client 102 sends a request to server 101 to receive a red envelope.

[0188] Step S12: Server 101 responds to the request to obtain a red envelope and determines the lottery result of the request to obtain a red envelope based on the probability system.

[0189] Step S13: If the lottery result is a red envelope, server 101 further determines the number of red envelopes allocated from the start of the task to the current time, the number of red envelopes allocated on the same day, and the number of red envelopes allocated in the hour corresponding to the current time. If the number of red envelopes allocated from the start of the task to the current time is less than the total number of red envelopes, the number of red envelopes allocated on the same day is less than 1 / 30 of the total number of red envelopes stored in the storage area center, and the number of red envelopes allocated in the hour corresponding to the current time is less than 1 / 720 of the total number of red envelopes, the red envelope corresponding to the request to obtain the red envelope (i.e., the lottery result) is allocated to client 102.

[0190] Step S14: After receiving the red envelope, the client 102 stores the received red envelope in the red envelope library.

[0191] Based on the same principle as the virtual resource processing method provided in the embodiments of this application, the embodiments of this application also provide a virtual resource processing device. Figure 10 A schematic diagram of a virtual resource processing apparatus provided in an embodiment of this application is shown. Figure 10 As shown, the device 10 includes:

[0192] The execution result determination module 101 is used to determine the execution result for the acquisition request in response to the virtual resource acquisition request associated with the target task by the client.

[0193] The virtual resource allocation module 102 is used to allocate the virtual resource corresponding to the client to the client when the execution result is that the virtual resource is obtained and the preset conditions are met.

[0194] The effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to a second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to that second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity corresponding to that second time period, the second ratio corresponding to each second time period is the ratio of the second quantity to the first quantity, and the second ratio corresponding to each second time period is the ratio of the duration of that second time period to the duration of the first time period;

[0195] The preset conditions include:

[0196] The total number of virtual resources allocated in the first time period is less than the first quantity;

[0197] The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period. The second target time period refers to the second time period to which the time point of responding to the acquisition request belongs.

[0198] Optionally, the device can be a target application server corresponding to a client among multiple application servers, where the target application server corresponding to any client is the application server among multiple application servers that corresponds to the geographical location information of the client.

[0199] Optionally, the allocatable virtual resources corresponding to the target task are stored in at least two storage regions, each storage region corresponding to different geographical location information, and the total number of allocatable virtual resources corresponding to each storage region is determined based on a first quantity and the number of storage regions; the allocatable virtual resources corresponding to each second time period include the allocatable virtual resources in each storage region corresponding to that second time period;

[0200] When allocating virtual resources to a client, the virtual resource allocation module specifically performs the following functions:

[0201] Based on the geographical location information of the client, determine the target storage area corresponding to the retrieval request;

[0202] Allocate the virtual resources corresponding to the client within the target storage area to the client;

[0203] Wherein, the allocated quantity corresponding to the second target time period is less than the second quantity corresponding to the second target time period means that the allocated quantity of the target storage region in the second target time period is less than the allocatable quantity of the target storage region in the second target time period.

[0204] The preset conditions also include:

[0205] The total number of virtual resources allocated in the target storage region during the first time period is less than the total number of virtual resources available for allocation in the target storage region.

[0206] Alternatively, the device can also be used for:

[0207] The management server balances the remaining allocable quantity for each storage region using the following methods:

[0208] Within the effective time period corresponding to the target task, the first remaining allocable quantity of virtual resources corresponding to each storage area is determined based on a preset frequency.

[0209] Based on the first remaining allocable quantity corresponding to each storage region, the remaining allocable quantity corresponding to each storage region is balanced.

[0210] Optionally, when the device performs a balancing process on the first remaining allocable quantity corresponding to each storage region based on the first remaining allocable quantity corresponding to each storage region, it is specifically used for:

[0211] Based on the first remaining allocable quantity corresponding to each storage region, determine the first average value of the first remaining allocable quantity corresponding to each storage region;

[0212] For each first storage region whose first remaining allocable quantity is greater than the first average, the first remaining allocable quantity of each first storage region is reduced to the first average, and the total reduction of each first storage region is recorded. The total reduction is the sum of the first differences. A first difference is the difference between the first remaining allocable quantity of a first storage region and the first average.

[0213] For each second storage region whose first remaining allocable quantity is less than the first average, the second remaining allocable quantity corresponding to each second storage region is determined again, and the second difference between each second storage region and the first average is determined; based on the second difference corresponding to each second storage region, virtual resources equal to the total reduction amount are evenly increased to each second storage region, and the increase amount corresponding to a second storage region is positively correlated with the corresponding second difference.

[0214] Optionally, the allocatable virtual resources are stored in the storage area, and the device is also used for:

[0215] If the execution result indicates that the virtual resource has been obtained and the preset conditions are met, a request identifier corresponding to the acquisition request will be generated in response to the acquisition request.

[0216] When allocating virtual resources corresponding to a client to another client, the virtual resource allocation module 102 is specifically used for:

[0217] Deduct the virtual resources corresponding to the client from the storage area;

[0218] Allocate the virtual resources corresponding to the client to the client;

[0219] Get the allocation status corresponding to the request identifier. The allocation status indicates whether the virtual resource corresponding to the client was successfully allocated or the virtual resource corresponding to the request was not successfully allocated.

[0220] If the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client has not been successfully allocated, the virtual resource corresponding to the client will be restored to the storage area.

[0221] Optionally, the first time period is divided into at least two second time periods in the following manner:

[0222] Divide the first time period into multiple second time periods with at least two time levels by performing the following operations at least twice:

[0223] The first time period is taken as the initial time period to be divided. According to the first set duration corresponding to the time period to be divided, the time period to be divided is divided into at least two second time periods at a time level, and each second time period at that level is taken as a new time period to be divided.

[0224] The second quantity corresponding to a second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs.

[0225] The allocated quantity corresponding to the second time period of the target is less than the second quantity corresponding to the second time period of the target, including:

[0226] The allocated quantity for the second time period of each level's target is less than the second quantity for the second time period of the corresponding level's target.

[0227] Alternatively, the device can also be used for:

[0228] For any second time period, if at the end of the second time period the number of allocated virtual resources corresponding to the second time period is less than the number of second resources corresponding to the second time period, then the number of second resources corresponding to each subsequent second time period is balanced based on the remaining number of allocated virtual resources corresponding to the second time period.

[0229] The apparatus in this application embodiment can execute the method provided in this application embodiment, and the implementation principle is similar. The actions performed by each module in the apparatus of each embodiment of this application correspond to the steps in the method of each embodiment of this application. For detailed functional descriptions of each module of the apparatus, please refer to the descriptions in the corresponding methods shown above, which will not be repeated here.

[0230] Based on the same principle as the virtual resource processing and apparatus provided in the embodiments of this application, the embodiments of this application also provide an electronic device (such as a server), which may include a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method provided in any optional embodiment of this application.

[0231] Optionally, Figure 11 A schematic diagram of the structure of an electronic device to which this application embodiment applies is shown, such as... Figure 11 As shown, Figure 11The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.

[0232] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0233] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0234] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.

[0235] The memory 4003 stores computer programs that execute embodiments of this application, and its execution is controlled by the processor 4001. The processor 4001 executes the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.

[0236] This application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding content of the aforementioned method embodiments.

[0237] This application also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0238] The terms "first," "second," "third," "fourth," "1," "2," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0239] It should be understood that although arrows indicate various operation steps in the flowcharts of this application's embodiments, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of this application's embodiments, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all steps in each flowchart, based on the actual implementation scenario, may include multiple sub-steps or multiple stages. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured according to requirements, and this application's embodiments do not limit this.

[0240] The above description is only an optional implementation method for some implementation scenarios of this application. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this application without departing from the technical concept of this application also fall within the protection scope of the embodiments of this application.

Claims

1. A method for processing virtual resources, characterized in that, include: In response to a virtual resource acquisition request associated with a target task from a client, determine the execution result for the acquisition request; The allocatable virtual resources corresponding to the target task are stored in at least two storage areas, each of which corresponds to different geographical location information; If the execution result indicates that virtual resources have been obtained and preset conditions are met, the virtual resources corresponding to the client will be allocated to the client. Wherein, the effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to one second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to the second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity, the second ratio corresponding to each second time period is the ratio of the duration of the second time period to the duration of the first time period, the total number of allocable virtual resources corresponding to each storage area is determined based on the first quantity and the number of storage areas; the allocable virtual resources corresponding to each second time period include the allocable virtual resources in each storage area corresponding to the second time period; The step of allocating the virtual resources corresponding to the client to the client includes: Based on the geographical location information corresponding to the client, the target storage area corresponding to the client is determined; Allocate the virtual resources corresponding to the client within the target storage area to the client; The preset conditions include: The total number of virtual resources allocated during the first time period is less than the first number; The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period, where the second target time period refers to the second time period to which the time point of responding to the acquisition request belongs; the number of allocated resources corresponding to the second target time period is less than the second number corresponding to the second target time period means that the number of allocated resources of the target storage area corresponding to the second target time period is less than the number of allocatable resources of the target storage area corresponding to the second target time period. The total number of virtual resources allocated to the target storage area during the first time period is less than the total number of virtual resources available for allocation to the target storage area.

2. The method according to claim 1, characterized in that, The method is executed by the target application server corresponding to the client among multiple application servers, and the target application server corresponding to any client is the application server among the multiple application servers that corresponds to the geographical location information of the client.

3. The method according to claim 1, characterized in that, The method further includes: The management server balances the remaining allocatable quantities for each storage region using the following method: Within the effective time period corresponding to the target task, the first remaining allocable quantity of virtual resources corresponding to each storage area is determined based on a preset frequency. Based on the first remaining allocable quantity corresponding to each storage region, the remaining allocable quantity corresponding to each storage region is balanced.

4. The method according to claim 3, characterized in that, The step of balancing the first remaining allocable quantity corresponding to each storage region based on the first remaining allocable quantity corresponding to each storage region includes: Based on the first remaining allocable quantity corresponding to each storage region, determine the first average value of the first remaining allocable quantity corresponding to each storage region; For each first storage region whose first remaining allocable quantity is greater than the first average, the first remaining allocable quantity corresponding to each first storage region is reduced to the first average, and the total reduction corresponding to each first storage region is recorded. The total reduction is the sum of each first difference, and each first difference is the difference between the first remaining allocable quantity corresponding to a first storage region and the first average. For each second storage region whose first remaining allocable quantity is less than the first average, the second remaining allocable quantity corresponding to each second storage region is determined again, and the second difference between each second storage region and the first average is determined; based on the second difference corresponding to each second storage region, virtual resources equal to the total reduction amount are evenly increased to each second storage region, and the increase amount corresponding to a second storage region is positively correlated with the corresponding second difference.

5. The method according to claim 1, characterized in that, The allocatable virtual resources are stored in a storage area, and the method further includes: If the execution result is that virtual resources have been obtained and preset conditions are met, a request identifier corresponding to the acquisition request is generated in response to the acquisition request. The step of allocating the virtual resources corresponding to the client to the client includes: The virtual resources corresponding to the client are deducted from the storage area; Allocate the virtual resources corresponding to the client to the client; Obtain the allocation status corresponding to the request identifier, wherein the allocation status indicates that the virtual resource corresponding to the client has been successfully allocated or the virtual resource corresponding to the client has not been successfully allocated; If the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client has not been successfully allocated, the virtual resource corresponding to the client will be restored to the storage area.

6. The method according to claim 1, characterized in that, The first time period is divided into at least two second time periods in the following manner: By performing the following operations at least twice, the first time period is divided into multiple second time periods at at least two time levels: The first time period is taken as the initial time period to be divided. According to the first set duration corresponding to the time period to be divided, the time period to be divided is divided into at least two second time periods at a time level, and each second time period at that level is taken as a new time period to be divided. The second quantity corresponding to a second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs. The allocated quantity corresponding to the second target time period is less than the second quantity corresponding to the second target time period, including: The allocated quantity for the second time period of each level's target is less than the second quantity for the second time period of the corresponding level's target.

7. The method according to claim 1 or 6, characterized in that, The method further includes: For any second time period, if at the end of the second time period the number of allocated virtual resources corresponding to the second time period is less than the number of second resources corresponding to the second time period, then the number of second resources corresponding to each subsequent second time period is balanced based on the remaining number of allocated virtual resources corresponding to the second time period.

8. A virtual resource processing device, characterized in that, include: The execution result determination module is used to determine the execution result for the virtual resource acquisition request associated with the target task in response to the client. The allocatable virtual resources corresponding to the target task are stored in at least two storage areas, each of which corresponds to different geographical location information; A virtual resource allocation module is used to allocate the virtual resource corresponding to the acquisition request to the client when the execution result is that a virtual resource has been obtained and a preset condition is met. Wherein, the effective time period corresponding to the target task is the first time period, the total number of allocable virtual resources corresponding to the target task is the first quantity, the first time period is divided into at least two second time periods, the number of allocable virtual resources corresponding to one second time period is the second quantity, the first ratio corresponding to each second time period and the second ratio corresponding to the second time period are positively correlated, the first ratio corresponding to each second time period is the ratio of the second quantity to the first quantity, the second ratio corresponding to each second time period is positively correlated with the ratio of the duration of the second time period to the first duration, the total number of allocable virtual resources corresponding to each storage area is determined based on the first quantity and the number of storage areas; the allocable virtual resources corresponding to each second time period include the allocable virtual resources in each storage area corresponding to the second time period; When the virtual resource allocation module allocates virtual resources corresponding to the client to the client, it is used for: Based on the geographical location information corresponding to the client, the target storage area corresponding to the client is determined; Allocate the virtual resources corresponding to the client within the target storage area to the client; The preset conditions include: The total number of virtual resources allocated during the first time period is less than the first number; The number of virtual resources allocated during the second target time period is less than the second number corresponding to the second target time period, where the second target time period refers to the second time period to which the time point of responding to the acquisition request belongs; the number of allocated resources corresponding to the second target time period is less than the second number corresponding to the second target time period means that the number of allocated resources of the target storage area corresponding to the second target time period is less than the number of allocatable resources of the target storage area corresponding to the second target time period. The total number of virtual resources allocated to the target storage area during the first time period is less than the total number of virtual resources available for allocation to the target storage area.

9. The apparatus according to claim 8, characterized in that, The device is a target application server corresponding to the client among a plurality of application servers, wherein the target application server corresponding to any client is the application server among the plurality of application servers that corresponds to the geographical location information of the client.

10. The apparatus according to claim 8, characterized in that, The device is also used for: The management server balances the remaining allocatable quantities for each storage region using the following method: Within the effective time period corresponding to the target task, the first remaining allocable quantity of virtual resources corresponding to each storage area is determined based on a preset frequency. Based on the first remaining allocable quantity corresponding to each storage region, the remaining allocable quantity corresponding to each storage region is balanced.

11. The apparatus according to claim 10, characterized in that, When the device performs a balancing process on the first remaining allocable quantity corresponding to each storage region based on the first remaining allocable quantity corresponding to each storage region, it is used to: Based on the first remaining allocable quantity corresponding to each storage region, determine the first average value of the first remaining allocable quantity corresponding to each storage region; For each first storage region whose first remaining allocable quantity is greater than the first average, the first remaining allocable quantity corresponding to each first storage region is reduced to the first average, and the total reduction corresponding to each first storage region is recorded. The total reduction is the sum of each first difference, and each first difference is the difference between the first remaining allocable quantity corresponding to a first storage region and the first average. For each second storage region whose first remaining allocable quantity is less than the first average, the second remaining allocable quantity corresponding to each second storage region is determined again, and the second difference between each second storage region and the first average is determined. Based on the second difference corresponding to each second storage region, virtual resources equal to the total reduction amount are evenly increased to each second storage region, and the increase amount corresponding to a second storage region is positively correlated with the corresponding second difference.

12. The apparatus according to claim 8, characterized in that, The allocatable virtual resources are stored in a storage area, and the device is further configured to: If the execution result is that virtual resources have been obtained and preset conditions are met, a request identifier corresponding to the acquisition request is generated in response to the acquisition request. When the virtual resource allocation module allocates virtual resources corresponding to the client to the client, it is used for: The virtual resources corresponding to the client are deducted from the storage area; Allocate the virtual resources corresponding to the client to the client; Obtain the allocation status corresponding to the request identifier, wherein the allocation status indicates that the virtual resource corresponding to the client has been successfully allocated or the virtual resource corresponding to the client has not been successfully allocated; If the allocation status corresponding to the request identifier indicates that the virtual resource corresponding to the client has not been successfully allocated, the virtual resource corresponding to the client will be restored to the storage area.

13. The apparatus according to claim 8, characterized in that, The first time period is divided into at least two second time periods in the following manner: By performing the following operations at least twice, the first time period is divided into multiple second time periods at at least two time levels: The first time period is taken as the initial time period to be divided. According to the first set duration corresponding to the time period to be divided, the time period to be divided is divided into at least two second time periods at a time level, and each second time period at that level is taken as a new time period to be divided. The second quantity corresponding to a second time period is determined based on the ratio of the duration of the second time period to the duration of the time period to which the second time period belongs, and the allocatable quantity of virtual resources corresponding to the time period to which the second time period belongs. The allocated quantity corresponding to the second target time period is less than the second quantity corresponding to the second target time period, including: The allocated quantity for the second time period of each level's target is less than the second quantity for the second time period of the corresponding level's target.

14. The apparatus according to claim 8 or 13, characterized in that, The device is also used for: For any second time period, if at the end of the second time period the number of allocated virtual resources corresponding to the second time period is less than the number of second resources corresponding to the second time period, then the number of second resources corresponding to each subsequent second time period is balanced based on the remaining number of allocated virtual resources corresponding to the second time period.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-7.