Virtual resource allocation method and device, storage medium and electronic equipment
By introducing a target allocation server and a request queue in the virtual resource allocation system, processing and cache resource acquisition requests in turn, and batch processing and one-time write when the conditions are met, the problem of low virtual resource allocation efficiency in the prior art is solved, and more efficient resource allocation and storage operations are achieved.
Patent Information
- Application Number
- CN202311071478.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-02-25
AI Technical Summary
When the existing virtual resource allocation method initiates resource acquisition requests at the same time in the face of a large number of object accounts, there will be too much reading and writing pressure, resulting in service overload and data loss.
The target allocation server obtains multiple resource acquisition requests to be processed from the request queue in turn, and when the allocation progress in the virtual resource set meets the conditions, resource allocation information is sent to the storage server to realize batch processing and one-time write.
Reduces the pressure on resource allocation servers and storage servers, improves the allocation efficiency of virtual resources, and avoids service overload and data loss.
Smart Images

Figure CN119514903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for allocating virtual resources, a storage medium and an electronic device. Background Art
[0002] In the process of allocating virtual resources in an application, two different operations are usually required to complete the allocation of virtual resources. The first operation is to allocate virtual resources to different object accounts according to a certain method, and the second operation is to complete the writing and updating of data in the storage server according to the allocation result.
[0003] The existing method of allocating virtual resources usually allocates resources to an account upon receiving a resource acquisition request from an object account, and writes the allocation result to the storage server at the same time. This method will cause excessive reading and writing pressure when a large number of object accounts initiate resource acquisition requests at the same time, and may even cause service overload and data loss. Therefore, the related technology has a technical problem of low virtual resource allocation efficiency when dealing with the problem of virtual resource allocation.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for allocating virtual resources, a storage medium and an electronic device, so as to at least solve the technical problem of low efficiency in allocating existing virtual resources.
[0006] According to one aspect of an embodiment of the present invention, a method for allocating virtual resources is provided, comprising: sequentially acquiring a plurality of resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among a plurality of resource allocation servers for processing the resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store the resource acquisition requests respectively sent by the plurality of object accounts; sequentially allocating virtual resources to the plurality of object accounts that sent the plurality of resource acquisition requests according to the acquired plurality of resource acquisition requests, wherein the plurality of object accounts correspond one-to-one to the plurality of resource acquisition requests; in a case where the allocation progress of the virtual resources in the virtual resource set meets the sending condition, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate an allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
[0007] According to another aspect of an embodiment of the present invention, a virtual resource allocation system is also provided, comprising: a request forwarding server, configured to receive a resource operation request associated with target resource information, and forward the resource operation request to a target allocation server determined from a plurality of resource allocation servers, wherein the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the resource operation request includes: a resource allocation request, a resource acquisition request, and a resource viewing request; a plurality of resource allocation servers, wherein the plurality of resource allocation servers include the target allocation server, and the target allocation server is configured to sequentially acquire a plurality of resource acquisition requests to be processed from a request queue, wherein the request queue is configured to store the resource acquisition requests sent by each of the plurality of the object accounts. source acquisition request; according to the obtained multiple resource acquisition requests, allocating virtual resources to the multiple object accounts that sent the multiple resource acquisition requests in turn, wherein the multiple object accounts correspond to the multiple resource acquisition requests one by one; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information; the storage server is used to write and store the target resource information and the resource allocation information associated with the target resource information.
[0008] According to another aspect of an embodiment of the present invention, a virtual resource allocation system is also provided, comprising: an acquisition unit, used to sequentially acquire multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing the resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store the resource acquisition requests sent by each of the multiple object accounts; an allocation unit, used to sequentially allocate virtual resources to the multiple object accounts that send the multiple resource acquisition requests according to the acquired multiple resource acquisition requests, wherein the multiple object accounts correspond one-to-one to the multiple resource acquisition requests; a sending unit, used to send resource allocation information associated with the target resource information to a storage server according to the allocated virtual resources when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, wherein the resource allocation information is used to indicate an allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information. According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned virtual resource allocation method when running.
[0009] According to another aspect of the embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer instruction being stored in a computer-readable storage medium. A processor of a computer device reads the computer program / instruction from the computer-readable storage medium, and the processor executes the computer program / instruction, so that the computer device executes the above virtual resource allocation method.
[0010] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the virtual resource allocation method through the computer program.
[0011] In an embodiment of the present invention, a target allocation server sequentially obtains a plurality of resource acquisition requests to be processed from a request queue, wherein the target allocation server is a server among a plurality of resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests respectively sent by a plurality of object accounts; according to the obtained plurality of resource acquisition requests, virtual resources are sequentially allocated to a plurality of object accounts that send a plurality of resource acquisition requests, wherein the plurality of object accounts correspond one-to-one to the plurality of resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate an allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information, thereby realizing efficient allocation of virtual resources.
[0012] Through the above-mentioned implementation mode of the present application, firstly, the target allocation server is determined from multiple resource allocation servers through the correspondence between the target resource information and the resource allocation server, thereby reducing the allocation processing pressure of each resource allocation server; then, the multiple resource acquisition requests of multiple object accounts are cached and converged through the request queue in the target allocation server, and the acquisition requests in the request queue are processed in turn. When the allocation progress meets the conditions, the resource allocation information is sent to the storage server, thereby avoiding the immediate processing and synchronous writing of the received requests during the resource allocation process, and reducing the allocation pressure by using a queue, and writing all at once after batch processing of the requests, thereby reducing the write pressure of the storage server and improving the allocation efficiency of virtual resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0014] Figure 1 is a schematic diagram of a hardware environment of an optional method for allocating virtual resources according to an embodiment of the present invention;
[0015] Figure 2 is a flow chart of an optional method for allocating virtual resources according to an embodiment of the present invention;
[0016] Figure 3 is a schematic diagram of a queue structure of an optional request queue according to an embodiment of the present invention;
[0017] Figure 4is a schematic diagram of an optional method for allocating virtual resources according to an embodiment of the present invention;
[0018] Figure 5 is a flow chart of another optional method for allocating virtual resources according to an embodiment of the present invention;
[0019] Figure 6 is a flow chart of another optional method for allocating virtual resources according to an embodiment of the present invention;
[0020] Figure 7 is a schematic diagram of another optional method for allocating virtual resources according to an embodiment of the present invention;
[0021] Figure 8 is a schematic diagram of another optional method for allocating virtual resources according to an embodiment of the present invention;
[0022] Fig. 9 is a schematic diagram of an optional virtual resource allocation system according to an embodiment of the present invention;
[0023] Fig.10 is a schematic diagram of an interface of an optional method for allocating virtual resources according to an embodiment of the present invention;
[0024] Fig.11 is a schematic structural diagram of an optional virtual resource allocation device according to an embodiment of the present invention;
[0025] Fig.12 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] First, the terms used in the embodiments of the present application are explained:
[0029] Zonesvr: lobby server, providing player account login, data caching, business logic processing and other functions;
[0030] Funcsvr: Functional server, providing different game functions. Funcsvr-redenvelope is a red envelope server, encapsulating the functions of the red envelope system;
[0031] DB: DataBase, database. The DB referred to in this article is the Tcaplus database;
[0032] QPS: Queries Per Second, which is the query rate per second or the number of queries per second. It is an indicator to measure the throughput capacity of the system and is also one of the important indicators for evaluating system performance.
[0033] Message queue: A message queue is an application that transmits messages in a distributed system. It achieves decoupling between different applications or services in an asynchronous, event-driven manner, improving the scalability, reliability, and fault tolerance of the system.
[0034] Player Uin: The character ID that uniquely identifies the player in the game;
[0035] According to one aspect of an embodiment of the present invention, a method for allocating virtual resources is provided. As an optional implementation, the method for allocating virtual resources can be applied to, but is not limited to, Figure 1 The virtual resource allocation system in the hardware environment shown in FIG. 1 may include but is not limited to a terminal device 102, a network 104, a server 106, a database 108, and a terminal device 110. The terminal device 102 and the terminal device 110 respectively run a target client (such as a client computer) that can implement virtual resource allocation. Figure 1As shown, the target client is a game application client as an example). The terminal device 102 and the terminal device 110 respectively include a human-computer interaction screen, a processor and a memory. The human-computer interaction screen is used to display a virtual game scene (such as Figure 1 The virtual game scene shown in the figure) is also used to provide a human-computer interaction interface to receive human-computer interaction operations for controlling a controlled virtual character in the virtual scene, and the virtual character will complete the game tasks set in the virtual scene. The processor is used to generate an interaction instruction in response to the above human-computer interaction operation, and send the interaction instruction to the server. The memory is used to store relevant attribute data, such as object attribute information of the controlled virtual character, and attribute information of the virtual props held, etc. Among them, a client logged in by a first object account is running in the terminal device 102, and the first object account is used to send a resource acquisition request; a client logged in by a target object account in the terminal device 110. The target object account logged in in the terminal device 110 can send virtual resource allocation information (for example, it can be a virtual red envelope issuance information) in the interactive area of the above game application, and the first object account logged in in the above terminal device 102 can participate in the virtual resource allocation operation (for example, it can be a red envelope grabbing operation) according to the above virtual resource allocation information.
[0036] In addition, the server 106 includes a processing engine, which is used to perform storage or reading operations on the database 108. Specifically, the processing engine reads target resource information from the database 108, wherein the target resource information is used to indicate the set of virtual resources that the target object account requests to be allocated.
[0037] Assumptions Figure 1 The terminal device 102 in the embodiment has a first object account logged in, and the terminal device 110 has a target object account logged in. The specific process of this embodiment is as follows: In step S102, the terminal device 110 sends a resource allocation request to the server 106 through the network 104, for example, it can be a request to send a virtual red envelope; the server 106 executes S104, and writes the target resource information in the storage server according to the resource allocation request, wherein the target resource information is used to indicate the set of virtual resources requested to be allocated by the target object account;
[0038] Then, step S106 is executed on the terminal device 102, and a resource acquisition request is sent to the server 106 through the network 104, for example, it can be a "grab red envelope" request; the server 106 then executes steps S108 to S114, and obtains multiple resource acquisition requests to be processed from the request queue in sequence through the target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing resource acquisition requests associated with target resource information, and the request queue is used to store resource acquisition requests sent by multiple object accounts respectively; according to the obtained multiple resource acquisition requests, virtual resources are allocated to the multiple object accounts that send the multiple resource acquisition requests in sequence, wherein the multiple object accounts correspond one-to-one to the multiple resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information; resource acquisition response information is sent to the terminal device 102 through the network 104.
[0039] Finally, the terminal device 102 executes step S116 to display information resource acquisition response information, wherein the resource acquisition response information is used to indicate the resource acquisition status of the first object account.
[0040] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a client that supports providing shooting game tasks, such as a video client, an instant messaging client, a browser client, an educational client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.
[0041] Optionally, in this embodiment, the above-mentioned method for allocating virtual resources can be applied to, but not limited to, a game terminal application (Application, referred to as APP) that completes a predetermined social game task in a virtual scene, such as a virtual confrontation game application in a multiplayer online tactical competitive game (Multiplayer Online Battle Arena, referred to as MOBA) application; the above-mentioned social game task can be, but not limited to, a game task completed by a virtual character in a virtual scene of the current player through human-computer interaction and virtual social interaction with virtual characters controlled by other players; the above-mentioned method for allocating virtual resources can also be applied to terminal applications of massively multiplayer online role-playing games (Multiplayer Online Role-Playing Game, referred to as MMORPG), in which the current player can complete the social game task in the game from the first perspective of the virtual character through role-playing, for example, completing the game task together with other virtual characters, etc. The social game task here can be, but not limited to, running in an application (such as a non-independent game APP) in the form of a plug-in or applet, or running in an application (such as an independent game APP) in a game engine. The types of the above-mentioned game applications may include, but are not limited to, at least one of the following: two-dimensional (2D) game applications, three-dimensional (3D) game applications, virtual reality (VR) game applications, augmented reality (AR) game applications, and mixed reality (MR) game applications. The above is only an example, and this embodiment does not impose any limitation on this.
[0042] In an embodiment of the present invention, a target allocation server sequentially obtains a plurality of resource acquisition requests to be processed from a request queue, wherein the target allocation server is a server among a plurality of resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests respectively sent by a plurality of object accounts; according to the obtained plurality of resource acquisition requests, virtual resources are sequentially allocated to a plurality of object accounts that send a plurality of resource acquisition requests, wherein the plurality of object accounts correspond one-to-one to the plurality of resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate an allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information, thereby realizing efficient allocation of virtual resources.
[0043] Through the above-mentioned implementation mode of the present application, firstly, the target allocation server is determined from multiple resource allocation servers through the correspondence between the target resource information and the resource allocation server, thereby reducing the allocation processing pressure of each resource allocation server; then, the multiple resource acquisition requests of multiple object accounts are cached and converged through the request queue in the target allocation server, and the acquisition requests in the request queue are processed in turn. When the allocation progress meets the conditions, the resource allocation information is sent to the storage server, thereby avoiding the immediate processing and synchronous writing of the received requests during the resource allocation process, and reducing the allocation pressure by using a queue, and writing all at once after batch processing of the requests, thereby reducing the write pressure of the storage server and improving the allocation efficiency of virtual resources.
[0044] As an optional implementation, Figure 2 As shown, the above virtual resource allocation method includes the following steps:
[0045] S202, sequentially obtaining multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests respectively sent by multiple object accounts;
[0046] S204, allocating virtual resources to multiple object accounts that send multiple resource acquisition requests in sequence according to the multiple resource acquisition requests, wherein the multiple object accounts correspond to the multiple resource acquisition requests one by one;
[0047] S206, when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
[0048] It should be noted that the above implementation of the present application can be applied to, but not limited to, an application program that can be used to implement virtual resource allocation. The above virtual resource allocation process can be a virtual resource allocation request initiated by an object account to distribute virtual resources to other object accounts by consuming the virtual resources of the object account.
[0049] Optionally, the program type of the above application may include, but is not limited to, an application that can realize information interaction between multiple object accounts, such as an instant messaging application, a game application that provides account social functions, etc.
[0050] Optionally, the virtual resources may include but are not limited to account resources that can be consumed and used by the target account in the application. For example, when the application is an instant messaging program, the carrier of the virtual resources may be a virtual red envelope, which may include virtual currency that can be allocated to multiple target accounts; when the application is a game program, the virtual resources may be virtual tokens, virtual items, virtual accessories, etc. in the game application. In this embodiment, the types of the virtual resources are not limited.
[0051] In a specific form, in a game application, the target object account triggers the "send red envelope" operation in the chat area provided by the game application, and displays the "red envelope information" in the chat area. The "red envelope information" may include multiple virtual resources that can be allocated to multiple target accounts, such as virtual game accessories, etc. The target account can initiate a resource acquisition request to the server by triggering the "red envelope information" in the chat area. Since the virtual resources included in the "red envelope information" are limited, the above resource acquisition request can be a "grab red envelope" operation.
[0052] It is understandable that the number of accounts online at the same time in a game application is usually very large. Therefore, after the "send red envelope" operation is triggered in the chat area of the game application, the number of "grab red envelope" requests that the server needs to respond to is also huge. Therefore, the server performance pressure of handling a large number of "grab red envelope" requests is also very significant.
[0053] In the above implementation of the present application, the target allocation server in the above step S202 may be a server for processing the above resource acquisition request, responsible for allocating corresponding virtual resources to the object account in response to the resource acquisition request. The target resource information in the above step S202 may be resource information corresponding to a resource allocation request, used to indicate the set of virtual resources requested to be allocated by the target object account;
[0054] It should be noted that the above-mentioned target allocation server can be a server associated with the target resource information among multiple resource allocation servers. In other words, in this embodiment, each piece of resource information corresponds to a resource allocation server, and the resource allocation request, resource viewing request and resource acquisition request related to the resource information are processed by the corresponding resource allocation server. Optionally, the above-mentioned resource allocation request is used to consume the target virtual resource already owned by the target object account and allocate the virtual resource set to at least one of the object accounts; the above-mentioned resource viewing request is used to view the virtual resource set related to the above-mentioned resource information and the corresponding resource allocation situation.
[0055] It should be noted that, in this embodiment, the target allocation server can obtain resource acquisition requests from the above request queue in sequence according to the target period, and process the obtained resource acquisition requests in sequence. It can be understood that the resource acquisition requests obtained from the above request queue can be obtained in the order of request time, that is, the resource acquisition requests with earlier timestamps are obtained first and processed later, and the resource acquisition requests with later timestamps are processed.
[0056] In the above step S204, the manner of allocating virtual resources to the multiple object accounts that send multiple resource acquisition requests in turn can be determined according to the resource type of the virtual resources. For example, when the above virtual resource set includes multiple virtual resources, one or more virtual resources can be randomly allocated to each of the above object accounts; when the above virtual resource set includes a target amount of virtual resources, a random amount of virtual resources can be randomly allocated to each of the above object accounts, wherein the total amount of virtual resources allocated to each object account is equal to the target amount. The manner of allocating the above virtual resources is not limited here.
[0057] It should also be noted that, in response to the above resource acquisition request, virtual resources can be issued to multiple object accounts. The specific implementation method of issuing virtual resources to object accounts can include two processes. In the first process, the virtual resources allocated to each object account can be determined first (that is, virtual resources are allocated to each object account), and then in the second process, the virtual resources allocated to each object account are added to the virtual resource set already owned by each object account. In an optional manner, both of the above processes can be implemented in the above target allocation server; in another optional manner, the above target allocation server is only used to implement the allocation operation of virtual resources, and the specific issuance operation of virtual resources can be implemented through other servers, thereby realizing the decoupling of the allocation operation and the issuance operation, and improving the issuance efficiency of virtual resources.
[0058] In the above step S206, when the allocation progress of the virtual resources in the virtual resource set meets the sending condition, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, thereby realizing the writing record of the resource allocation information in the storage server. In an optional implementation, the above storage server can be specifically a database for storing various resource information and their corresponding resource allocation information.
[0059] The resource allocation information in step S206 may be used to indicate the allocation of virtual resources in the virtual resource set, and may include but is not limited to resource identifiers of each allocated virtual resource, account identifiers of object accounts corresponding to each virtual resource, operation timestamps of allocation operations, etc. In this embodiment, the specific content of the resource allocation information is not limited.
[0060] In an embodiment of the present invention, a target allocation server sequentially obtains a plurality of resource acquisition requests to be processed from a request queue, wherein the target allocation server is a server among a plurality of resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests respectively sent by a plurality of object accounts; according to the obtained plurality of resource acquisition requests, virtual resources are sequentially allocated to a plurality of object accounts that send a plurality of resource acquisition requests, wherein the plurality of object accounts correspond one-to-one to the plurality of resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate an allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information, thereby realizing efficient allocation of virtual resources.
[0061] Through the above-mentioned implementation mode of the present application, firstly, the target allocation server is determined from multiple resource allocation servers through the correspondence between the target resource information and the resource allocation server, thereby reducing the allocation processing pressure of each resource allocation server; then, the multiple resource acquisition requests of multiple object accounts are cached and converged through the request queue in the target allocation server, and the acquisition requests in the request queue are processed in turn. When the allocation progress meets the conditions, the resource allocation information is sent to the storage server, thereby avoiding the immediate processing and synchronous writing of the received requests during the resource allocation process, and reducing the allocation pressure by using a queue, and writing all at once after batch processing of the requests, thereby reducing the write pressure of the storage server and improving the allocation efficiency of virtual resources.
[0062] In an optional implementation, when the allocation progress of the virtual resources in the virtual resource set meets the sending condition, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources includes at least one of the following:
[0063] Method 1: when the number of allocated virtual resources is greater than or equal to the first number threshold, sending resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources;
[0064] Method 2: When the allocation duration indicated by the generation timestamp of the target resource information and the current timestamp meets the allocation duration threshold, resource allocation information associated with the target resource information is sent to the storage server based on the allocated virtual resources, wherein the generation timestamp is used to indicate the generation time of the target resource information in the storage server.
[0065] It is understandable that in this embodiment, the resource allocation information to be written can be sent to the storage server according to the allocation progress of the virtual resources. In the first manner above, it can be determined whether to send the resource allocation information to the storage server according to the comparison of the resource quantity threshold of the allocated virtual resources. In a preferred manner, the resource allocation information to be written can be sent to the storage server when the virtual resources in the above virtual resource set have been allocated;
[0066] In the second method described above, the allocation progress can be determined according to the time condition, and then the resource allocation information to be written can be sent to the storage server according to a certain period; for example, the resource allocation information associated with the target resource information can be sent to the storage server with a sending period of 5 seconds. When the time indicated by the timestamp difference between the current timestamp and the generation timestamp of the target server in the storage server is a multiple of the above sending time of 5 seconds, the resource allocation information to be written is sent to the storage server, thereby avoiding the problem of untimely update and recording of resource allocation information when the allocation speed of virtual resources is slow;
[0067] In the third method, the first method and the second method mentioned above can be used in combination. For example, when the virtual resources have not been fully allocated, resource allocation information associated with the target resource information can be sent to the storage server according to the allocated virtual resources at a certain period; when the virtual resources have been fully allocated, resource allocation information associated with the target resource information can be sent to the storage server according to the allocated virtual resources, thereby realizing timely updating and writing of the resource allocation information in the storage server.
[0068] Through the above-mentioned implementation mode of the present application, by sending resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources when the resource quantity of the allocated virtual resources is greater than or equal to the first quantity threshold; and / or, when the allocation duration indicated by the generation timestamp of the target resource information and the current timestamp meets the allocation duration threshold, sending resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources, thereby achieving decoupling of the resource allocation operation performed in the target allocation server and the resource allocation information writing operation performed in the storage server, reducing the pressure of writing resource allocation information in the storage server and improving the allocation efficiency of resource allocation.
[0069] In an optional implementation, the above-mentioned allocating virtual resources to multiple object accounts that send multiple resource acquisition requests in sequence according to the acquired multiple resource acquisition requests includes:
[0070] Case 1: when the current resource acquisition request among multiple resource acquisition requests is the first resource request sent by the corresponding current object account, and the virtual resource set includes unallocated virtual resources, allocate virtual resources to the current object account, and send a prompt message of successful allocation to the current object account;
[0071] Case 2: When the current resource acquisition request among the multiple resource acquisition requests is the resource request sent by the corresponding current object account for the Nth time, an allocation failure prompt message is sent to the current object account, where N is an integer greater than or equal to 2;
[0072] Case 3: When the virtual resource set does not include unallocated virtual resources, an allocation failure prompt message is sent to the current target account.
[0073] It can be understood that in this embodiment, in the process of executing resource allocation operations for each resource acquisition request, certain verification operations can be performed, which may include but are not limited to verification operations on whether the above-mentioned resources have been allocated, and verification operations on whether the resource acquisition request is the first time for the object account (usually for a red envelope, an object account can only grab it once).
[0074] Optionally, the above-mentioned target resource information can also be checked for timeliness. For example, the validity period of a "red envelope information" is one day. If the target object account sends the red envelope for more than one day, then when a "grab red envelope" request related to the "red envelope information" is received, a prompt message of "failed to grab red envelope" will be returned.
[0075] In an optional manner, different allocation prompt messages may be configured for situations where the above-mentioned verification conditions fail. For example, when the virtual resource set does not include unallocated virtual resources, the above-mentioned allocation failure prompt message may be "the red envelopes have been snatched up"; when the virtual resource set does not meet the timeliness conditions, the above-mentioned allocation failure prompt message may be "the red envelopes have expired."
[0076] Through the above-mentioned implementation mode of the present application, when the current resource acquisition request among multiple resource acquisition requests is the resource request sent for the first time by the corresponding current object account, and the virtual resource set includes unallocated virtual resources, virtual resources are allocated to the current object account, and an allocation success prompt message is sent to the current object account; when the current resource acquisition request among multiple resource acquisition requests is the resource request sent for the Nth time by the corresponding current object account, an allocation failure prompt message is sent to the current object account, wherein N is an integer greater than or equal to 2; when the virtual resource set does not include unallocated virtual resources, an allocation failure prompt message is sent to the current object account, thereby achieving accurate and efficient allocation of virtual resources.
[0077] In an optional implementation manner, before sequentially acquiring the plurality of resource acquisition requests to be processed from the request queue through the target allocation server, the method further includes:
[0078] S1, obtaining a reference resource acquisition request sent by a reference object account through a target allocation server;
[0079] S2-1, when the number of resource acquisition requests included in the request queue is less than a second number threshold, adding a reference resource acquisition request to the request queue;
[0080] S2-2: When the number of resource acquisition requests included in the request queue is equal to the second number threshold, an allocation failure prompt message is sent to the reference object account.
[0081] It is understandable that, in this embodiment, the request queue can be used to control the number of resource acquisition requests processed by the target allocation server, thereby reducing the processing pressure of the target allocation server on the resource acquisition requests.
[0082] In this embodiment, a large number of resource acquisition requests can be quickly processed by limiting the capacity of the request queue. In an optional manner, the capacity of the request queue can be set to be the same as the number of virtual resources included in the virtual resource set requested for allocation by the target object account. For example, if there are 100 virtual resources to be allocated in the virtual resource set, the capacity of the request queue can be set to 100, that is, the resource acquisition request that arrives after the 100th resource acquisition request will be directly responded to with an allocation failure prompt message;
[0083] In another optional manner, the capacity of the request queue may be set to a target value greater than the number of virtual resources included in the virtual resource set requested for allocation by the target object account. For example, when there are 100 virtual resources to be allocated in the virtual resource set, the capacity of the request queue may be set to 120, that is, a resource acquisition request arriving after the 120th resource acquisition request is directly responded to with an allocation failure prompt message, thereby providing a certain amount of redundant processing capacity to avoid allocation failures in the process of processing resource acquisition requests in the queue, which in turn causes the inability to fully allocate resources.
[0084] In another optional manner, when the resource acquisition request included in the above request queue is dynamically changing, it can be determined whether to add the current resource acquisition request to the request queue according to the dynamically changing resource acquisition request. For example, when the capacity of the request queue is set to 100, assuming that at the first moment, the request queue is full, an allocation failure prompt message is returned to the current resource acquisition request received at the first moment; assuming that at the second moment, the target allocation server takes out a resource acquisition request from the request queue for processing, the number of resource acquisition requests included in the request queue is 99, and the current resource acquisition request received at the second moment is added to the request queue.
[0085] The following combination Figure 3 The queue structure of the request queue included in the target distribution server is described in detail.
[0086] like Figure 3 As shown, a global red envelope queue 301 may be stored in the target allocation server, wherein the global red envelope queue may further include single red envelope queues corresponding to each red envelope, including a first red envelope queue 302, a second red envelope queue 303, and a third red envelope queue 304. Among them, the first red envelope queue 302 is used to indicate a single red envelope queue of red envelope information corresponding to the first red envelope identifier. In the single red envelope queue corresponding to the first red envelope queue 302, the user identifier of each user can be used to represent the resource acquisition request sent by each object account. Specifically, the above-mentioned user identifier can be a player Uin, which is used to globally and uniquely identify the character ID of the game player in the game.
[0087] like Figure 3 In the target allocation server, the method for acquiring and processing the resource acquisition requests included in the red envelope queue can be to traverse each single red envelope queue separately, that is, the traversal operations of each single red envelope queue do not affect each other; in another method, each single red envelope queue in the global red envelope queue 301 in the target allocation server can be traversed in turn, and the acquisition requests in the current single red envelope queue traversed can be traversed, acquired and processed.
[0088] Through the above-mentioned implementation mode of the present application, the reference resource acquisition request sent by the reference object account is obtained through the target allocation server; when the number of resource acquisition requests included in the request queue is less than the second number threshold, the reference resource acquisition request is added to the request queue; when the number of resource acquisition requests included in the request queue is equal to the second number threshold, an allocation failure prompt message is sent to the reference object account, thereby realizing the decoupling of the resource allocation operation performed in the target allocation server and the resource allocation information writing operation performed in the storage server, reducing the pressure of writing resource allocation information in the storage server and improving the allocation efficiency of resource allocation.
[0089] In an optional implementation, when the allocation progress of the virtual resources in the virtual resource set meets the sending condition, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources includes:
[0090] S1, obtaining multiple allocation records cached in a target allocation server, wherein the allocation records include resource identifiers of allocated virtual resources and account identifiers of object accounts corresponding to the allocated virtual resources;
[0091] S2, sending the plurality of allocation records and resource identifiers of unallocated virtual resources in the virtual resource set to the storage server.
[0092] It is understandable that, in this embodiment, the resource allocation information may be used to indicate the allocation of virtual resources in the virtual resource set, and may include but is not limited to resource identifiers of each allocated virtual resource, account identifiers of object accounts corresponding to each virtual resource, operation timestamps of allocation operations, etc. In this embodiment, the specific content of the resource allocation information is not limited.
[0093] The following combination Figure 4 , Figure 5 , Figure 6 A specific resource allocation method is described.
[0094] like Figure 4 As shown, the implementation of the above-mentioned resource allocation method may involve three subjects, including a first client for initiating a resource acquisition request (specifically, it may be a red envelope grabbing request), a forwarding server for forwarding the request message (specifically, it may be a Zonesvr, lobby server), and an allocation server for processing the resource acquisition request.
[0095] It is understandable that when grabbing red envelopes (resource acquisition requests), the maximum QPS (Queries PerSecond, i.e., query rate per second or number of queries per second) of a single red envelope can be considered to be 10,000. In order to ensure the security and uniqueness of the red envelope data, if each update of the red envelope data requires updating the DB (DataBase) before returning the operation result, then when the extreme read and write QPS appears, the server machine resources are not enough for the game service to create and start so many asynchronous transactions, and 10,000 QPS is also a very large burden for DB reading and writing. And because this solution needs to ensure data consistency, grabbing red envelopes must first update the DB before generating the operation result. Generating such a high read and write QPS for the same primary key will inevitably lead to a very high DB conflict rate, so it is necessary to think about how to reduce the 10,000 DB read and write QPS as much as possible.
[0096] In this embodiment, a message queue mechanism is introduced. For concurrent red envelope grabbing operations, the present invention converges all write requests of the same red envelope in the same time period into the message queue MQ, and the red envelope service periodically takes out the operation request of each red envelope from MQ to read and write the DB. In this way, the game service can converge all the peak requests at the moment, and for a single red envelope, up to 10,000 requests can be consumed at one time. In the end, a single red envelope only needs to read and write the DB once to resolve up to 10,000 operation requests.
[0097] The specific steps are as follows:
[0098] First, the first client sends a red envelope grabbing request to the forwarding server, and the forwarding server executes S402 to forward the request to the allocation server; the allocation server executes steps S404 to S410 to determine whether there is a cache; if there is no cache, further determine whether the message queue is full; if the message queue is not full, push the request into the message queue; then, obtain the request from the message queue for processing;
[0099] If there is a cache, execute S412 to perform basic verification; if the verification is successful, execute step S406;
[0100] It can be understood that when the message queue is full or the verification fails, the result of failure to grab the red envelope can be returned to the forwarding server; after obtaining the request from the message queue for processing, the result of the distribution of the red envelope can be returned to the forwarding server.
[0101] In the forwarding server, continue to execute S414 to S422, receive the red envelope grabbing result; and determine whether it is successful; if the red envelope grabbing is successful, update the player's red envelope record and issue rewards; if the red envelope grabbing fails, or if the red envelope grabbing is successful, notify the player of the red envelope grabbing result.
[0102] The specific steps for the target shard server to obtain the request from the message queue for processing are as follows: Figure 5 As shown, it includes: S410-1 and step S410-2, reading red envelope data from the storage server; updating the cache; and cyclically executing steps S410-3, S410-4 or step S410-7 for each request in the queue to perform basic verification; if the verification passes, distributing player rewards; if the verification fails, recording error information; finally executing steps S410-5 and S410-6, updating the red envelope storage server; replying to each player in the queue, that is, returning the red envelope grabbing result information.
[0103] The above verification steps can be specifically as follows: Figure 6 The method includes: executing three verification and judgment operations from step S412-1 to S412-3 in sequence, including: judging whether the red envelope is received repeatedly; judging whether the red envelope has been received; judging whether the red envelope has expired; if the verification results of the three verifications are all "no", executing S412-4 to determine that the verification is successful; otherwise, executing S412-5 and returning the corresponding error code.
[0104] Through the above-mentioned implementation mode of the present application, the resource allocation operation performed in the target allocation server and the writing operation of the resource allocation information performed in the storage server are decoupled, which reduces the pressure of writing resource allocation information in the storage server and improves the allocation efficiency of resource allocation.
[0105] In an optional embodiment, before the target allocation server sequentially obtains multiple resource acquisition requests to be processed from the request queue, it also includes: receiving resource status cache information sent by the request forwarding server, wherein the resource status cache information is used to indicate the allocation status of the virtual resource collection, and the resource status cache information is cache information generated by the request forwarding server according to the resource parameters carried in the resource allocation request when the resource allocation request sent by the target object account is received.
[0106] In an optional embodiment, after obtaining the request identifier of the resource allocation request by requesting the forwarding server, the method further includes: sending a generation instruction of the target resource information to the storage server according to the resource parameters carried in the resource allocation request, wherein the generation instruction is used to write the target resource information in the storage server.
[0107] It is understandable that in this embodiment, when the resource allocation request is received by the request forwarding server, a target resource information generation instruction may be sent to the storage server to write the target resource information into the storage server.
[0108] Specifically, in this embodiment, when the resource allocation request is a "send red envelope" request sent by the target object account, the red envelope data matching the "send red envelope" request can be directly written into the storage server.
[0109] In another optional implementation, the resource allocation request sent by the target object account may be first received from the client via a forwarding server, and then the resource allocation request sent by the target object account may be obtained according to information forwarded by the forwarding server.
[0110] It can be understood that in this embodiment, after the above-mentioned target resource information is written in the storage server, resource status cache information indicating the allocation status of the virtual resource collection can be received in the target allocation server, so that when resource viewing information related to the target resource information is received, the resource allocation status can be directly returned through the resource status cache information.
[0111] It should be noted that, in the case where the above-mentioned resource allocation request is specifically a red envelope request sent by a user received in the application, since red envelopes generally have many preconditions and the probability of a large number of players sending red envelopes at the same time is low, the concurrency is also minimal. In this embodiment, the operation path of sending red envelopes is designed separately from the operation paths of the other two behaviors (viewing red envelopes and grabbing red envelopes) to reduce the coupling and concurrency effects on the service path. For the red envelope operation, the red envelope data can be directly written to the DB, and the preheating cache and chat notification can be generated after the DB is successfully updated.
[0112] Specific steps are as follows Figure 7 As shown, assuming that the target object account corresponding to the triggering red envelope sending operation is logged in on the first client, in response to the target object's red envelope sending request, the forwarding server (specifically, it can be Zonesvr, lobby server) executes step S702, parameter check (for example, verifying the security parameters of the request, and verifying the virtual resource parameters already owned by the target object account); then executes S704 to pre-generate red envelope content; S706 to consume resources (that is, consuming virtual resources already owned by the target object account); S708 to update the red envelope details to the storage server; S710 to update the user issuance record to the storage server; S712 to notify the allocation server cache preheating; finally, execute S714 to generate a chat message notification, and return the generated chat message notification to multiple clients including the first client, so as to realize the distribution of red envelope information to multiple clients.
[0113] In an optional implementation, the above-mentioned allocating virtual resources to multiple object accounts that send multiple resource acquisition requests in sequence according to the acquired multiple resource acquisition requests includes:
[0114] S1, determining a target resource consumption method and a target resource allocation method matching the target resource information from an allocation information set, wherein the allocation information set includes resource consumption methods and resource allocation methods matching each of multiple types of resource information;
[0115] S2, consuming the first virtual resource from the virtual resources already owned by the target object account according to the target resource consumption method;
[0116] S3: Allocate a second virtual resource to a current target account among the multiple target accounts according to the target resource allocation method.
[0117] In this embodiment, a method is provided to distribute different types of red envelopes by consuming different game resources (virtual points / virtual essence / virtual props) by players. In this embodiment, these different red envelopes are defined as different "red envelope types". Specifically, a registry can be used to support different red envelope types to customize specific resource consumption methods and methods for generating different red envelope data. Different red envelope types provide the registration functions required by the registry information, which can implement the consumption and content random logic of the red envelope type. There is no need to care about the specific red envelope sending operation details of the red envelope framework, and the specific red envelope business and the system framework are well decoupled and separated.
[0118] In an optional implementation manner, before the target allocation server receives the resource allocation request sent by the target object account, the method further includes:
[0119] S1, obtain a request identifier of a resource allocation request by requesting a forwarding server;
[0120] S2, determining the server identifier corresponding to the request identifier through the target mapping rule;
[0121] S3: forward the resource allocation request to the target allocation server indicated by the server identifier.
[0122] It is understandable that in this embodiment, when a resource allocation request of a target object account is received in a request forwarding server, a target allocation server can be determined from multiple resource allocation servers according to a request identifier of the resource allocation request through a target mapping rule.
[0123] In a preferred manner, the target mapping rule may be a consistent hashing algorithm, which may specifically include the following steps:
[0124] S1, through the consistent hashing algorithm, the hash value space is organized into a virtual ring in a clockwise direction, which is called a hash ring;
[0125] S2, using a hash function to calculate the server identifier (such as a server IP or host identifier) of each resource allocation server, thereby determining the position of each resource allocation server on the hash ring;
[0126] S3, use the hash algorithm to locate the request identifier to the corresponding resource allocation server: use the hash algorithm to calculate the hash value of the request identifier, and determine the position of the hash value on the hash ring, and search clockwise from this position until the first resource allocation server is found.
[0127] It is understandable that in this embodiment, a distributed resource allocation service cluster will be introduced, and each red envelope will be assigned a unique red envelope GID. All operation requests for the same red envelope (sending red envelopes, viewing red envelopes, grabbing red envelopes) will be consistently hashed and routed to the same red envelope service through the GID for operation. In this way, through the clustering of red envelope servers, the availability of the red envelope service can still be guaranteed when some of the servers fail, and when the server pressure is unstable, the capacity can be quickly expanded or reduced to improve or reduce the performance of the red envelope service to achieve load balancing.
[0128] In an optional implementation manner, after creating the resource status cache information in the target allocation server according to the resource parameters carried in the resource allocation request, the method further includes:
[0129] S1, receiving a resource viewing request sent by a reference object account, wherein the resource viewing request is used to obtain the allocation status of a virtual resource set;
[0130] S2, when the resource status cache information in the target allocation server is in a valid state, sending a viewing response information generated according to the resource status cache information to the reference object account;
[0131] S3, when the resource status cache information in the target allocation server is in an invalid state, obtain resource allocation information associated with the target resource information from the storage server, and update the resource status cache information based on the resource allocation information.
[0132] Specifically, the above-mentioned resource viewing request may correspond to a "view red envelope" request in a specific scenario. Viewing red envelopes is the most frequently used function of red envelope products. Since a red envelope can be seen by everyone in the chat channel, and the same chat channel can accommodate up to 10,000 players, a single red envelope may be viewed by 10,000 players at the same time in the chat channel, and the QPS of its request can theoretically reach 10,000. Viewing red envelopes is a read-only operation and does not change the content of the red envelopes. It can be assumed that the red envelope data seen by 10,000 players at this moment are the same. The present invention reduces read requests to the DB (database) by establishing a read-only cache, and all viewing requests can be digested within the server without passing the pressure to the DB.
[0133] When the query request reaches the resource allocation server, if there is a valid red envelope cache, the cache data is returned directly. If there is no valid cache, a specific error code is returned to zonesvr to let it try again later, and an invalid cache is created first while reading data from the DB to update the cache. At the same time, in the previous red envelope design, after each red envelope is sent, the server will actively generate a red envelope cache to preheat the cache, further reducing the possibility of concurrent viewing requests and reading the DB.
[0134] The following combination Figure 8 The complete processing process of the red envelope viewing request is explained.
[0135] like Figure 8 As shown, when the request forwarding server receives the red envelope viewing request sent by the first client, S802 is executed to forward the request; the resource allocation server executes S804 to determine whether there is a cache; when the resource allocation server stores the cache, S806 is executed to determine whether the cache is being established; when the resource allocation server does not store the cache, steps S808 and S818 are executed;
[0136] If the cache is being established, S808 is executed and "the cache is being established" is returned; then the forwarding server is requested to execute S810, delay 800ms, and retry 5 times;
[0137] If the cache is not being established, execute S812 to determine whether the cache is expired; if the cache is not expired, execute S814 to return the red envelope data; then, request the forwarding server to execute S816 to return the red envelope data to the first client;
[0138] When no cache is saved or the cache has expired, execute S818 to create / rebuild the cache and mark it as "building"; then as in S820, read data from the storage server, update the cache, and mark the cache as available.
[0139] Through the above-mentioned implementation mode of the present application, the red envelope system (resource allocation server) is separated from the zonesvr (request forwarding server), and the single-point service mode is abandoned. A red envelope system based on distributed technology is designed, which can be independently deployed and quickly expanded and reduced, reducing dependence on business and other services, and providing a more general high-performance and highly available red envelope service.
[0140] According to one aspect of an embodiment of the present invention, a virtual resource allocation system is provided. As an optional implementation mode, Fig. 9 As shown, the above virtual resource allocation system includes:
[0141] The request forwarding server 901 is used to receive a resource operation request associated with target resource information, and forward the resource operation request to a target allocation server determined from multiple resource allocation servers, wherein the target resource information is used to indicate a set of virtual resources that the target object account requests to allocate, and the resource operation request includes: a resource allocation request, a resource acquisition request, and a resource viewing request;
[0142] A plurality of resource allocation servers 902, wherein the plurality of resource allocation servers include a target allocation server, and the target allocation server is used to sequentially obtain a plurality of resource acquisition requests to be processed from a request queue, wherein the request queue is used to store resource acquisition requests respectively sent by a plurality of object accounts; according to the obtained plurality of resource acquisition requests, virtual resources are sequentially allocated to a plurality of object accounts that send the plurality of resource acquisition requests, wherein the plurality of object accounts correspond one to one with the plurality of resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending condition, resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information;
[0143] The storage server 903 is used to write and store the target resource information and the resource allocation information associated with the target resource information.
[0144] Specifically, the above virtual resource allocation system can be a red envelope system. Since the red envelope system involves player resources, the game service must ensure the uniqueness of the red envelope data. This embodiment uses the DB (i.e., storage server 903) as the only data source. Sending and grabbing red envelopes will modify the red envelope data. At this time, the DB will be updated first and then the result will be returned, which can ensure the uniqueness and security of the red envelope data in the DB.
[0145] The operation of a single-point red envelope service depends on a single server. Once a hardware failure or other problem occurs, the entire red envelope service will be unavailable. And when there are too many red envelope operation requests, it is difficult for a single-point red envelope service to carry high-concurrency access requests. Therefore, this implementation method designs the red envelope service as a distributed service cluster. Each red envelope will be assigned a unique red envelope GID. All operation requests for the same red envelope (sending red envelopes, viewing red envelopes, grabbing red envelopes) will be consistently hashed and routed to the same red envelope service through the GID for operation. In this way, through the clustering of red envelope servers, the availability of the red envelope service can still be guaranteed when some of the servers fail, and when the server pressure is unstable, the capacity can be quickly expanded or reduced to improve or reduce the performance of the red envelope service to achieve load balancing.
[0146] Specifically, regarding the red envelope sending process, there are generally many preconditions for sending red envelopes, and the probability of a large number of players sending red envelopes at the same time is low, and the concurrency is also minimal. The present invention separates the operation path of sending red envelopes from the operation paths of the other two behaviors to reduce the coupling and concurrency effects on the service path. For the red envelope sending operation, the red envelope data can be directly written to the DB, and the DB can be successfully updated to generate the preheating cache and chat notification. The specific process is as follows Figure 7 As shown;
[0147] Regarding the red envelope viewing process, the above-mentioned resource viewing request can correspond to the "view red envelope" request in a specific scenario. Viewing red envelopes is the most frequently used function of red envelope products. Since a red envelope can be seen by everyone in the chat channel, and the same chat channel can accommodate up to 10,000 players, then a single red envelope may be viewed by 10,000 players at the same time in the chat channel, and the QPS of its request can theoretically reach 10,000. Viewing red envelopes is a read-only operation and will not change the content of the red envelope. It can be assumed that the red envelope data seen by 10,000 players at this moment is the same. The present invention reduces read requests to the DB (database) by establishing a read-only cache, so that all viewing requests can be digested within the server without passing the pressure to the DB. The specific process is as follows: Figure 8 shown.
[0148] In view of the red envelope grabbing process, a message queue mechanism is introduced. For concurrent red envelope grabbing operations, the present invention converges all write requests of the same red envelope in the same time period into the message queue MQ. The red envelope service periodically takes out the operation request of each red envelope from MQ to read and write the DB. In this way, the game service can converge all the peak requests at the moment. For a single red envelope, up to 10,000 requests can be consumed at one time. In the end, a single red envelope only needs to read and write the DB once to resolve up to 10,000 operation requests. The specific process can be as follows: Figure 4 shown.
[0149] The following combination Fig.10 The relevant red envelope interface displayed in the client is described. In this embodiment, the functions of sending red envelopes, grabbing red envelopes, and viewing red envelopes are provided. Players can send a red envelope message in any chat channel by consuming game resources. Other players can view the chat message and grab the red envelope, and can also view the record of a red envelope being grabbed.
[0150] like Fig.10 As shown in Figure (a), when the target object account receives a virtual resource gift package, the interface displays a sharing prompt 1001, indicating that the current virtual resource gift package can be shared with other target accounts. At the same time, multiple resource identifiers including a virtual resource identifier 1002 are displayed, indicating the virtual resources included in the gift package. In addition, the interface also displays a first control 1003 and a second control 1004, wherein the first control 1003 is used to display the historical sharing record of the target object account, and the second control 1004 is used to trigger the red envelope sending operation.
[0151] In response to the triggering operation on the second control 1004, the interface may display the following: Fig.10 As shown in FIG. 1 (b), a red envelope prompt message 1005 is displayed in the chat interface to prompt other object accounts to participate in the red envelope grabbing activity.
[0152] Then, in response to the triggering operation of the "Receive Reward" control in the red envelope prompt information 1005, the interface may display the following: Fig.10 As shown in FIG. (c), the collection prompt information 1006 is displayed;
[0153] In response to the triggering operation of the "Share Record" control, the interface may display the following: Fig.10 As shown in Figure (d), the virtual resources obtained by each object account are displayed.
[0154] Through the above-mentioned virtual resource allocation system of the present application, a target allocation server sequentially obtains multiple resource acquisition requests to be processed from a request queue, wherein the target allocation server is a server among multiple resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate the set of virtual resources requested for allocation by the target object account, and the request queue is used to store the resource acquisition requests sent by the multiple object accounts respectively; according to the multiple resource acquisition requests obtained, virtual resources are sequentially allocated to the multiple object accounts that send the multiple resource acquisition requests, wherein the multiple object accounts correspond one-to-one to the multiple resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information, thereby realizing efficient allocation of virtual resources.
[0155] Through the above-mentioned implementation mode of the present application, firstly, the target allocation server is determined from multiple resource allocation servers through the correspondence between the target resource information and the resource allocation server, thereby reducing the allocation processing pressure of each resource allocation server; then, the multiple resource acquisition requests of multiple object accounts are cached and converged through the request queue in the target allocation server, and the acquisition requests in the request queue are processed in turn. When the allocation progress meets the conditions, the resource allocation information is sent to the storage server, thereby avoiding the immediate processing and synchronous writing of the received requests during the resource allocation process, and reducing the allocation pressure by using a queue, and writing all at once after batch processing of the requests, thereby reducing the write pressure of the storage server and improving the allocation efficiency of virtual resources.
[0156] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0157] According to another aspect of the embodiment of the present invention, a virtual resource allocation device for implementing the above virtual resource allocation method is also provided. Fig.11 As shown, the device comprises:
[0158] The acquisition unit 1102 is used to sequentially acquire multiple resource acquisition requests to be processed from the request queue through the target allocation server, wherein the target allocation server is a server among the multiple resource allocation servers used to process resource acquisition requests associated with target resource information, the target resource information is used to indicate the set of virtual resources requested to be allocated by the target object account, and the request queue is used to store the resource acquisition requests sent by the multiple object accounts respectively;
[0159] The allocating unit 1104 is used to allocate virtual resources to the multiple object accounts that send the multiple resource acquisition requests in sequence according to the multiple resource acquisition requests obtained, wherein the multiple object accounts correspond to the multiple resource acquisition requests one by one;
[0160] The sending unit 1106 is used to send resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
[0161] Optionally, the sending unit 1106 includes at least one of the following:
[0162] A first sending module, configured to send resource allocation information associated with target resource information to a storage server according to the allocated virtual resources when the resource quantity of the allocated virtual resources is greater than or equal to a first quantity threshold;
[0163] The second sending module is used to send resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources when the allocation duration indicated by the generation timestamp of the target resource information and the current timestamp meets the allocation duration threshold, wherein the generation timestamp is used to indicate the generation time of the target resource information in the storage server.
[0164] Optionally, the allocating unit 1104 includes:
[0165] A third sending module is used to allocate virtual resources to the current object account and send a prompt message of successful allocation to the current object account when the current resource acquisition request among the multiple resource acquisition requests is the resource request sent for the first time by the corresponding current object account and the virtual resource set includes unallocated virtual resources;
[0166] a fourth sending module, configured to send allocation failure prompt information to the current object account when the current resource acquisition request among the multiple resource acquisition requests is the resource request sent by the corresponding current object account for the Nth time, wherein N is an integer greater than or equal to 2;
[0167] The fifth sending module is used to send allocation failure prompt information to the current object account when the virtual resource set does not include unallocated virtual resources.
[0168] Optionally, the above-mentioned virtual resource allocation device is also used to: obtain a reference resource acquisition request sent by a reference object account through a target allocation server; when the number of resource acquisition requests included in the request queue is less than a second quantity threshold, add the reference resource acquisition request to the request queue; when the number of resource acquisition requests included in the request queue is equal to the second quantity threshold, send an allocation failure prompt message to the reference object account.
[0169] Optionally, the above-mentioned sending unit 1106 is used to: obtain multiple allocation records cached in the target allocation server, wherein the allocation records include the resource identifier of the allocated virtual resources and the account identifier of the object account corresponding to the allocated virtual resources; and send the multiple allocation records and the resource identifier of the unallocated virtual resources in the virtual resource set to the storage server.
[0170] Optionally, the above-mentioned virtual resource allocation device is also used to: receive resource status cache information sent by the request forwarding server, wherein the resource status cache information is used to indicate the allocation status of the virtual resource collection, and the resource status cache information is cache information generated by the request forwarding server according to the resource parameters carried in the resource allocation request when the resource allocation request sent by the target object account is received.
[0171] Optionally, the above-mentioned virtual resource allocation device is also used to: receive a resource viewing request sent by a reference object account, wherein the resource viewing request is used to obtain the allocation status of a virtual resource collection; when the resource status cache information in the target allocation server is in a valid state, send a viewing response information generated according to the resource status cache information to the reference object account; when the resource status cache information in the target allocation server is in an invalid state, obtain resource allocation information associated with the target resource information from the storage server, and update the resource status cache information based on the resource allocation information.
[0172] Optionally, the above-mentioned virtual resource allocation device is also used to: obtain a request identifier of the resource allocation request through a request forwarding server; determine a server identifier corresponding to the request identifier through a target mapping rule; and send resource status cache information to a target allocation server indicated by the server identifier.
[0173] Optionally, the above-mentioned virtual resource allocation device is further used for: sending a target resource information generation instruction to the storage server according to the resource parameters carried in the resource allocation request, wherein the generation instruction is used to write the target resource information in the storage server.
[0174] Optionally, the above-mentioned virtual resource allocation device is used to: determine a target resource consumption method and a target resource allocation method that match the target resource information from an allocation information set, wherein the allocation information set includes resource consumption methods and resource allocation methods that match multiple types of resource information; consume a first virtual resource from the virtual resources already owned by the target object account according to the target resource consumption method; and allocate a second virtual resource to a current object account among multiple object accounts according to the target resource allocation method.
[0175] Optionally, in this embodiment, the embodiments to be implemented by the above-mentioned various unit modules can refer to the above-mentioned various method embodiments, which will not be repeated here.
[0176] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above virtual resource allocation method is also provided. The electronic device may be Fig.12 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig.12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps in any of the above method embodiments through the computer program.
[0177] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0178] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0179] S1, sequentially obtaining multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests sent by each of the multiple object accounts;
[0180] S2, according to the obtained multiple resource acquisition requests, sequentially allocating virtual resources to multiple object accounts that send the multiple resource acquisition requests, wherein the multiple object accounts correspond to the multiple resource acquisition requests one by one;
[0181] S3, when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
[0182] Alternatively, a person skilled in the art may understand that: Fig.12 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig.12 The electronic device and the electronic equipment described above are not limited in structure. Fig.12 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.12 Different configurations shown.
[0183] Among them, the memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for allocating virtual resources in the embodiments of the present invention. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, that is, to implement the above-mentioned method for allocating virtual resources. The memory 1202 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include a memory remotely arranged relative to the processor 1204, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1202 may specifically be used, but is not limited to, to store information such as various elements in the scene screen, allocation information of virtual resources, and so on. As an example, such as Fig.12 As shown, the memory 1202 may include but is not limited to the acquisition unit 1102, allocation unit 1104 and sending unit 1106 in the virtual resource allocation device. In addition, it may also include but is not limited to other module units in the virtual resource allocation device, which will not be repeated in this example.
[0184] Optionally, the transmission device 1206 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1206 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1206 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0185] In addition, the electronic device further includes: a display 1208 for displaying a virtual scene in an interface; and a connection bus 1210 for connecting various module components in the electronic device.
[0186] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. Among them, a peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, a terminal or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0187] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.
[0188] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0189] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned virtual resource allocation method.
[0190] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0191] S1, sequentially obtaining multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store resource acquisition requests sent by each of the multiple object accounts;
[0192] S2, according to the obtained multiple resource acquisition requests, sequentially allocating virtual resources to multiple object accounts that send the multiple resource acquisition requests, wherein the multiple object accounts correspond to the multiple resource acquisition requests one by one;
[0193] S3, when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, the resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
[0194] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0195] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the above methods of various embodiments of the present invention.
[0196] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0197] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0198] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0200] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for allocating virtual resources, characterized in that: include: Sequentially obtaining multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers used to process the resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store the resource acquisition requests sent by each of the multiple object accounts; Allocate virtual resources to the plurality of object accounts that send the plurality of resource acquisition requests in sequence according to the plurality of resource acquisition requests obtained, wherein the plurality of object accounts correspond to the plurality of resource acquisition requests in a one-to-one manner; When the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, resource allocation information associated with the target resource information is sent to the storage server based on the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
2. The method according to claim 1, characterized in that When the allocation progress of the virtual resources in the virtual resource set meets the sending condition, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources includes at least one of the following: When the number of the allocated virtual resources is greater than or equal to a first number threshold, sending resource allocation information associated with the target resource information to a storage server according to the allocated virtual resources; When the allocation duration indicated by the generation timestamp and current timestamp of the target resource information meets the allocation duration threshold, resource allocation information associated with the target resource information is sent to the storage server based on the allocated virtual resources, wherein the generation timestamp is used to indicate the generation time of the target resource information in the storage server.
3. The method according to claim 2, characterized in that The allocating virtual resources to the plurality of object accounts that send the plurality of resource acquisition requests in sequence according to the plurality of resource acquisition requests comprises: In the case where the current resource acquisition request among the multiple resource acquisition requests is a resource request sent for the first time by the corresponding current object account, and the virtual resource set includes the unallocated virtual resources, allocating the virtual resources to the current object account, and sending an allocation success prompt message to the current object account; When the current resource acquisition request among the multiple resource acquisition requests is the resource request sent by the corresponding current object account for the Nth time, sending allocation failure prompt information to the current object account, wherein N is an integer greater than or equal to 2; In the case that the virtual resource set does not include the unallocated virtual resource, an allocation failure prompt message is sent to the current target account.
4. The method according to claim 2, characterized in that: Before sequentially acquiring the plurality of resource acquisition requests to be processed from the request queue through the target allocation server, the method further includes: Obtaining, through the target allocation server, a reference resource acquisition request sent by a reference object account; When the number of the resource acquisition requests included in the request queue is less than a second number threshold, adding the reference resource acquisition request to the request queue; When the number of the resource acquisition requests included in the request queue is equal to the second number threshold, an allocation failure prompt message is sent to the reference object account.
5. The method according to claim 2, characterized in that: When the allocation progress of the virtual resources in the virtual resource set meets the sending condition, sending the resource allocation information associated with the target resource information to the storage server according to the allocated virtual resources includes: Acquire a plurality of the allocation records cached in the target allocation server, wherein the allocation records include resource identifiers of the allocated virtual resources and account identifiers of target accounts corresponding to the allocated virtual resources; The plurality of allocation records and resource identifiers of the unallocated virtual resources in the virtual resource set are sent to the storage server.
6. The method according to claim 1, characterized in that Before sequentially acquiring the plurality of resource acquisition requests to be processed from the request queue through the target allocation server, the method further includes: Receive resource status cache information sent by a request forwarding server, wherein the resource status cache information is used to indicate the allocation status of the virtual resource set, and the resource status cache information is cache information generated by the request forwarding server based on resource parameters carried in the resource allocation request when the request forwarding server receives the resource allocation request sent by the target object account.
7. The method according to claim 6, characterized in that Before sequentially acquiring the plurality of resource acquisition requests to be processed from the request queue through the target allocation server, the method further includes: receiving a resource viewing request sent by a reference object account, wherein the resource viewing request is used to obtain the allocation status of the virtual resource set; When the resource status cache information in the target allocation server is in a valid state, sending a viewing response message generated according to the resource status cache information to the reference object account; When the resource status cache information in the target allocation server is in an invalid state, the resource allocation information associated with the target resource information is acquired from the storage server, and the resource status cache information is updated based on the resource allocation information.
8. The method according to claim 6, characterized in that Before sequentially acquiring the plurality of resource acquisition requests to be processed from the request queue through the target allocation server, the method further includes: Obtaining a request identifier of the resource allocation request through the request forwarding server; Determine the server identifier corresponding to the request identifier through a target mapping rule; The resource status cache information is sent to the target allocation server indicated by the server identifier.
9. The method according to claim 8, characterized in that After obtaining the request identifier of the resource allocation request through the request forwarding server, the method further includes: A generation instruction for target resource information is sent to the storage server according to the resource parameters carried in the resource allocation request, wherein the generation instruction is used to write the target resource information in the storage server.
10. The method according to claim 1, characterized in that The allocating virtual resources to the plurality of object accounts that send the plurality of resource acquisition requests in sequence according to the plurality of resource acquisition requests comprises: Determining a target resource consumption method and a target resource allocation method matching the target resource information from an allocation information set, wherein the allocation information set includes resource consumption methods and resource allocation methods respectively matching multiple types of resource information; Consume the first virtual resource from the virtual resources already owned by the target object account according to the target resource consumption method; Allocate a second virtual resource to a current target account among the plurality of target accounts according to the target resource allocation method.
11. A virtual resource allocation system, characterized in that: include: A request forwarding server, configured to receive a resource operation request associated with target resource information, and forward the resource operation request to a target allocation server determined from a plurality of resource allocation servers, wherein the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the resource operation request includes: a resource allocation request, a resource acquisition request, and a resource viewing request; A plurality of resource allocation servers, wherein the plurality of resource allocation servers include the target allocation server, the target allocation server is used to sequentially obtain a plurality of resource acquisition requests to be processed from a request queue, wherein the request queue is used to store the resource acquisition requests respectively sent by the plurality of object accounts; according to the obtained plurality of resource acquisition requests, virtual resources are sequentially allocated to the plurality of object accounts that send the plurality of resource acquisition requests, wherein the plurality of object accounts correspond one to one to the plurality of resource acquisition requests; when the allocation progress of the virtual resources in the virtual resource set meets the sending condition, resource allocation information associated with the target resource information is sent to the storage server according to the allocated virtual resources, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information; The storage server is used to write and store the target resource information and the resource allocation information associated with the target resource information.
12. A virtual resource allocation device, characterized in that: include: an acquisition unit, configured to sequentially acquire multiple resource acquisition requests to be processed from a request queue through a target allocation server, wherein the target allocation server is a server among multiple resource allocation servers for processing the resource acquisition requests associated with target resource information, the target resource information is used to indicate a set of virtual resources requested to be allocated by a target object account, and the request queue is used to store the resource acquisition requests respectively sent by the multiple object accounts; an allocating unit, configured to allocate virtual resources to the plurality of object accounts that send the plurality of resource acquisition requests in sequence according to the plurality of resource acquisition requests obtained, wherein the plurality of object accounts correspond to the plurality of resource acquisition requests in a one-to-one manner; A sending unit is used to send resource allocation information associated with the target resource information to a storage server based on the allocated virtual resources when the allocation progress of the virtual resources in the virtual resource set meets the sending conditions, wherein the resource allocation information is used to indicate the allocation record of the allocated virtual resources, and the storage server is used to store the target resource information and the resource allocation information.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 11 when executed.
14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 11 through the computer program.