Resource distribution method, device, computer equipment and storage medium
By allocating parallel distribution of sub-resource packages to multiple resource packages linked to the resource, the problem of low virtual resource allocation efficiency is solved, and parallel allocation and distribution of multi-user identifiers is realized, which improves the overall distribution efficiency.
Patent Information
- Application Number
- CN202011140446.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-22
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2040-10-22
AI Technical Summary
In the prior art, the issuance of virtual resources is inefficient. When multiple users trigger the same resource link, they can only issue resource packages in sequence according to the user's request order, resulting in inefficiency.
By allocating resource packages for multiple resource packages corresponding to the resource link and generating sub-resource packages for user IDs, using different resource packages to be distributed in parallel, breaking the limitation of order and sequential distribution.
It improves the efficiency of resource distribution, realizes parallel resource package allocation and distribution of multiple user identifiers, and improves the overall efficiency of resource distribution.
Smart Images

Figure CN113516330B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a resource distribution method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development of network technology, various virtual resources, such as virtual currency and virtual items, have emerged, allowing users to exchange virtual resources. These resources are typically stored in multiple resource packages, and resource links corresponding to these packages are created and displayed to users. Users trigger these resource links to request resource packages. However, when multiple users trigger the same resource link, resource packages are distributed sequentially, based on the order in which they requested them, resulting in inefficient distribution. Summary of the Invention
[0003] The embodiments of the present application provide a resource distribution method, apparatus, computer device, and storage medium that can improve resource distribution efficiency. The technical solution is as follows:
[0004] In one aspect, a resource allocation method is provided, the method comprising:
[0005] Receive at least one resource acquisition request, each resource acquisition request carrying a resource link and a user identifier requesting to acquire a resource corresponding to the resource link;
[0006] Allocating a resource package to at least one user identifier from a plurality of resource packages corresponding to the resource link;
[0007] According to the target resource parameters of the allocated resource package, a sub-resource package is generated for the user identifier corresponding to the resource package, and the sub-resource package is distributed to the user identifier corresponding to the resource package.
[0008] In one possible implementation, the target resource parameter includes the number of remaining sub-resource packages; after allocating a resource package to at least one user identifier from the multiple resource packages corresponding to the resource link, the method further includes:
[0009] In response to the number of remaining sub-resource packages in the target resource parameter being 0, another resource package is reallocated to the user identifier corresponding to the resource package from the multiple resource packages corresponding to the resource link.
[0010] In another possible implementation, the target resource parameters include the number of remaining sub-resource packages and the amount of remaining resources; after generating the sub-resource package for the user identifier corresponding to the resource package based on the target resource parameters of the allocated resource package, the method further includes:
[0011] The number of remaining sub-resource packages corresponding to the resource package is reduced by 1, and the number of remaining resources corresponding to the resource package is reduced by the number of resources corresponding to the sub-resource package.
[0012] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages and the unit resource quantity, where the unit resource quantity indicates the resource quantity corresponding to each sub-resource package in the resource package;
[0013] After generating a sub-resource package for the user identifier corresponding to the resource package according to the target resource parameters of the allocated resource package, the method further includes:
[0014] Subtract 1 from the number of remaining sub-resource packages in the target resource parameter of the resource package.
[0015] In another possible implementation, the issuing of the sub-resource package to the user identifier corresponding to the resource package includes:
[0016] A resource distribution instruction is sent to the terminal logged in by the user identifier, where the resource distribution instruction carries the sub-resource package corresponding to the user identifier.
[0017] In another possible implementation, after generating the issuance identifier corresponding to the user identifier based on the user identifier and the resource link, the method further includes:
[0018] In response to finding the issuance identifier corresponding to the user identifier in the database, an issuance completion notification is sent to the user identifier, where the issuance completion notification is used to prompt the user identifier that the resource in the resource link has been obtained.
[0019] In another possible implementation, after allocating a resource bundle to at least one user identifier from the multiple resource bundles corresponding to the resource link, the method further includes:
[0020] The state of the allocated resource package is set to a locked state.
[0021] In another possible implementation, after generating a sub-resource package for the user identifier corresponding to the resource package according to the target resource parameters of the allocated resource package, the method further includes:
[0022] Set the state of the resource bundle to unlocked.
[0023] In another possible implementation, allocating a resource bundle to at least one user identifier from the multiple resource bundles corresponding to the resource link includes:
[0024] A resource package in an unlocked state is allocated to the at least one user identifier from a plurality of resource packages corresponding to the resource link.
[0025] On the other hand, a resource distribution system is provided, the system comprising at least one terminal and a server;
[0026] The terminal is configured to display a resource link and, in response to a triggering operation on the resource link, send a resource acquisition request to the server, wherein the resource acquisition request carries the resource link and a logged-in user identifier;
[0027] The server is configured to receive at least one resource acquisition request, allocate a resource package to at least one user identifier from a plurality of resource packages corresponding to the resource link, generate a sub-resource package for the user identifier corresponding to the resource package based on target resource parameters of the allocated resource package, and distribute the sub-resource package to the user identifier corresponding to the resource package.
[0028] In a possible implementation, the terminal is further configured to receive the sub-resource package issued by the server, and display the sub-resource package and the quantity of resources corresponding to the sub-resource package.
[0029] In another aspect, a resource distribution device is provided, the device comprising:
[0030] A receiving module, configured to receive at least one resource acquisition request, each resource acquisition request carrying a resource link and a user identifier requesting to acquire a resource corresponding to the resource link;
[0031] A first allocation module is configured to allocate a resource package to at least one user identifier from a plurality of resource packages corresponding to the resource link;
[0032] The issuing module is configured to generate a sub-resource package for a user identifier corresponding to the resource package according to target resource parameters of the allocated resource package, and issue the sub-resource package to the user identifier corresponding to the resource package.
[0033] In a possible implementation, the target resource parameter includes the remaining resource quantity, and the issuing module includes:
[0034] The generating unit is configured to generate a sub-resource package for the user identifier corresponding to the resource package according to the remaining resource quantity, so that the resource quantity corresponding to the sub-resource package is not greater than the remaining resource quantity.
[0035] In another possible implementation, the target resource parameter also includes the number of remaining sub-resource packages; the generation unit is configured to, in response to the number of remaining sub-resource packages being greater than 1, generate a sub-resource package for the user identifier based on the number of remaining resources, the number of resources corresponding to the sub-resource package being less than the number of remaining resources; and in response to the number of remaining sub-resource packages being equal to 1, generate a sub-resource package for the user identifier based on the number of remaining resources, the number of resources corresponding to the sub-resource package being equal to the number of remaining resources.
[0036] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages; and the apparatus further includes:
[0037] The second allocation module is configured to reallocate another resource package to the user identifier corresponding to the resource package from the multiple resource packages corresponding to the resource link in response to the number of remaining sub-resource packages in the target resource parameter being 0.
[0038] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages and the amount of remaining resources; and the apparatus further includes:
[0039] The updating module is configured to reduce the number of remaining sub-resource packages corresponding to the resource package by 1, and reduce the number of remaining resources corresponding to the resource package by the number of resources corresponding to the sub-resource package.
[0040] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages and the unit resource quantity, where the unit resource quantity indicates the resource quantity corresponding to each sub-resource package in the resource package;
[0041] The device further comprises:
[0042] The updating module is configured to reduce the number of remaining sub-resource packages in the target resource parameter of the resource package by 1.
[0043] In another possible implementation, the issuing module includes:
[0044] The sending unit is configured to send a resource issuing instruction to the terminal logged in by the user identifier, wherein the resource issuing instruction carries a sub-resource package corresponding to the user identifier.
[0045] In another possible implementation, the issuing module includes:
[0046] A generating unit, configured to generate a distribution identifier corresponding to the user identifier according to the user identifier and the resource link;
[0047] The issuing unit is configured to issue the sub-resource package to the user identifier corresponding to the resource package in response to not finding the issuing identifier corresponding to the user identifier in the database, wherein the database is configured to store the issuing identifiers corresponding to the user identifiers to which the resources in the resource link have been issued.
[0048] In another possible implementation, the apparatus further includes:
[0049] The sending module is configured to send an issuance completion notification to the user identifier in response to finding an issuance identifier corresponding to the user identifier in the database, wherein the issuance completion notification is used to prompt the user identifier that the resource in the resource link has been obtained.
[0050] In another possible implementation, the apparatus includes:
[0051] The receiving module is further configured to receive a resource creation request, wherein the resource creation request carries the total number of sub-resource packages and the total number of resources;
[0052] A generating module, configured to generate the resource link according to the resource creation request;
[0053] The generation module is further used to generate the multiple resource packages based on the total number of the sub-resource packages and the total number of resources, the target resource parameters of each resource package include the number of sub-resource packages and the number of resources, the sum of the number of sub-resource packages corresponding to the multiple resource packages is equal to the total number of the sub-resource packages, and the sum of the number of resources corresponding to the multiple resource packages is equal to the total number of resources.
[0054] In another possible implementation, the apparatus further includes:
[0055] The first setting module is configured to set the state of the allocated resource package to a locked state.
[0056] In another possible implementation, the apparatus further includes:
[0057] The second setting module is configured to set the state of the resource package to an unlocked state.
[0058] In another possible implementation, the first allocation module includes:
[0059] The allocating unit is configured to allocate a resource package in an unlocked state to the at least one user identifier from the multiple resource packages corresponding to the resource link.
[0060] In another possible implementation, the first allocation module includes:
[0061] The allocating unit is configured to allocate a resource bundle to the at least one user identifier from a plurality of resource bundles corresponding to the resource link in response to the resource link being verified successfully.
[0062] In another possible implementation, the apparatus further includes:
[0063] a determination module, configured to determine that the resource link verification is successful in response to the current time point belonging to the valid time period corresponding to the resource link; or
[0064] The determining module is further configured to determine whether the resource link verification has passed in response to a resource package that has not been released corresponding to the resource link.
[0065] In another possible implementation, the first allocation module includes:
[0066] The allocation unit is configured to allocate a resource package to the user identifier from a plurality of resource packages corresponding to the resource link in response to successful verification of the user identifier carried in any resource acquisition request.
[0067] In another possible implementation, the apparatus further includes:
[0068] a determination module, configured to determine that the user identifier is successfully authenticated in response to the number of resources acquired by the user identifier through the resource link being less than a first reference number; or
[0069] The determining module is further configured to determine that the user identifier is successfully verified in response to the number of sub-resource packages acquired by the user identifier through the resource link being less than a second reference number; or
[0070] The determining module is further configured to determine that the user identification is successfully verified in response to failure to find the user identification in the database, wherein the database is configured to record the user identification that has obtained the resource through the resource link.
[0071] In another possible implementation, each resource acquisition request carries a resource link published in the live broadcast room and a viewer user identifier requesting to acquire the resource corresponding to the resource link;
[0072] The issuing module includes:
[0073] The sending unit is used to send a resource distribution instruction to the terminal logged in by the audience user identifier, wherein the resource distribution instruction carries the sub-resource package corresponding to the audience user identifier, and the terminal is used to display the sub-resource package in the live broadcast interface of the live broadcast room.
[0074] In another possible implementation, the resource link is an item link;
[0075] The issuing module includes:
[0076] The sending unit is configured to send an item distribution instruction to the terminal logged in by the user identifier, wherein the item distribution instruction carries a sub-item package corresponding to the user identifier, and the sub-item package includes items.
[0077] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the resource issuance method described in the above aspects.
[0078] On the other hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the resource distribution method described in the above aspects.
[0079] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to implement the operations performed in the resource provisioning method described in the above aspects.
[0080] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0081] In the method, apparatus, computer device, and storage medium provided by the embodiments of the present application, resource links correspond to multiple resource packages. During resource distribution via resource links, each resource package is assigned to a user ID, and then a sub-resource package is generated from the assigned resource package, thereby distributing the sub-resource package for the user ID. Because different resource packages do not interfere with each other, resources can be distributed in parallel, breaking the limitation of related technologies that only distribute resource packages to different user IDs in a sequential order, thereby improving resource distribution efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0083] Figure 1This is a schematic diagram of the structure of a resource distribution system provided in an embodiment of the present application;
[0084] Figure 2 This is a flow chart of a resource distribution method provided in an embodiment of the present application;
[0085] Figure 3 This is a flow chart of a resource distribution method provided in an embodiment of the present application;
[0086] Figure 4 This is a schematic diagram of a red envelope storage provided by an embodiment of the present application;
[0087] Figure 5 This is a flow chart of a user grabbing a red envelope provided by an embodiment of the present application;
[0088] Figure 6 This is a flowchart of creating a red envelope in a live broadcast room provided by an embodiment of the present application;
[0089] Figure 7 This is a flow chart of grabbing red envelopes in a live broadcast room provided by an embodiment of the present application;
[0090] Figure 8 This is a schematic diagram of a funnel filtration method provided in an embodiment of the present application;
[0091] Figure 9 This is a schematic diagram of a live broadcast interface provided by an embodiment of the present application;
[0092] Figure 10 This is a schematic diagram of the structure of a resource distribution device provided in an embodiment of the present application;
[0093] Figure 11 This is a schematic diagram of the structure of a resource distribution device provided in an embodiment of the present application;
[0094] Figure 12 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application;
[0095] Figure 13 This is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0096] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0097] As used herein, the terms "at least one," "plurality," "each," and "any" include one, two, or more, "plurality" includes two or more, "each" refers to each of the corresponding "plurality," and "any" refers to any one of the "plurality." For example, if the "plurality" includes three user identifiers, "each" refers to each of the three user identifiers, and "any" refers to any one of the three user identifiers, which may be the first, second, or third user identifier.
[0098] Figure 1 This is a schematic diagram of the structure of a resource distribution system provided by an embodiment of the present application. Figure 1 As shown, the system includes multiple terminals 101 and a server 102. The multiple terminals 101 are directly or indirectly connected to the server 102 through wired or wireless communication, which is not limited in this application.
[0099] Optionally, the terminal 101 is a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart TV, smart watch, etc., but is not limited thereto. Optionally, the server 102 is an independent physical server, or the server 102 is a server cluster or distributed system composed of multiple physical servers, or the server 102 is a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0100] Each terminal 101 is used to display resource links and can also display sub-resource packages obtained through resource links. For example, terminal 101 displays a link to a red envelope to be grabbed, and after the user clicks on the red envelope, the sub-red envelope obtained by the user is displayed. Server 102 provides resource distribution functions. In response to the resource acquisition request of the terminal 101 for the resource link, the server 102 generates and distributes sub-resource packages to the terminal 101.
[0101] Optionally, a target application is installed on each terminal 101, and the server 102 provides services for the target application. Each terminal 101 logs in to the target application based on a user identifier, and sends a resource acquisition request to the server 102 through the target application. The server is used to receive the resource acquisition request sent by the terminal 101, generate and issue a sub-resource package for the terminal 101, so that the terminal 101 can display the acquired sub-resource package.
[0102] The method provided in the embodiments of the present application can be used in a variety of scenarios.
[0103] For example, in the live broadcast room red envelope grabbing scenario:
[0104] When a live broadcast terminal issues a red envelope in the live broadcast room, the audience terminal in the live broadcast room can preempt the red envelope. The audience terminal responds to the trigger operation of the red envelope link displayed in the live broadcast interface and sends a resource acquisition request to the server. After receiving the resource acquisition request sent by at least one audience terminal, the server adopts the resource issuance method provided in the embodiment of the present application to issue a sub-red envelope to the audience terminal. Through multiple resource packages corresponding to the red envelope, sub-red envelopes can be issued to multiple audience terminals in parallel, thereby improving the efficiency of red envelope issuance.
[0105] For example, in the scenario of rush buying items:
[0106] The terminal displays items to be purchased in an item display application, and the user purchases the items displayed in the item display application through the item display application. After the terminal detects the user's purchase operation, it sends an item acquisition request to the server corresponding to the item display application. After the server receives the item acquisition request sent by at least one terminal, it uses the method provided in the embodiment of the present application to distribute items to multiple users. Through multiple item packages corresponding to the item, items can be distributed to multiple users at the same time, thereby improving the efficiency of item distribution.
[0107] Figure 2 This is a flow chart of a resource distribution method provided in an embodiment of the present application. The method can be executed by a terminal or a server, or by both a terminal and a server. The embodiment of the present application is described by taking the method executed by the server as an example. Figure 2 As shown, the method includes:
[0108] 201. The server receives at least one resource acquisition request. Each resource acquisition request carries a resource link and a user identifier requesting to acquire a resource corresponding to the resource link.
[0109] The resource acquisition request indicates the user ID and requests to acquire the resource through the resource link. In the at least one resource acquisition request, different resource acquisition requests carry the same resource link and different user IDs.
[0110] 202. The server allocates a resource package to at least one user identifier from a plurality of resource packages corresponding to the resource link.
[0111] In the embodiment of the present application, the resource link corresponds to multiple resource bundles, and the server allocates a resource bundle to the user identifier that requests to obtain a sub-resource bundle, so that a sub-resource bundle can be subsequently generated for the user identifier through the resource bundle.
[0112] 203. The server generates a sub-resource package for the user ID corresponding to the resource package according to the target resource parameters of the allocated resource package, and distributes the sub-resource package to the user ID corresponding to the resource package.
[0113] The target resource parameter is used to indicate the parameters of the sub-resource package corresponding to the resource package. Based on the target resource parameter of the allocated resource package, a sub-resource package is generated for the user ID corresponding to the resource package, and the generated sub-resource package is sent to the user ID so that the user can obtain the sub-resource package corresponding to the resource link.
[0114] In the method provided in the embodiments of this application, a resource link corresponds to multiple resource packages. During the resource distribution process via the resource link, each resource package is assigned to a user ID, and then a sub-resource package is generated from the assigned resource package, thereby distributing the sub-resource package for the user ID. Because different resource packages do not interfere with each other, resources can be distributed in parallel, breaking the limitation of related technologies that only distribute resource packages to different user IDs in a sequential order, thereby improving resource distribution efficiency.
[0115] Figure 3 This is a flow chart of a resource distribution method provided in an embodiment of the present application. The method can be executed by a terminal or a server, or by both a terminal and a server. The embodiment of the present application is described by taking the method executed by the server as an example. Figure 3 As shown, the method includes:
[0116] 301. The server receives a resource creation request, which carries the total number of sub-resource packages and the total number of resources.
[0117] In an embodiment of the present application, the server will first create a resource package, which includes certain resources, such as virtual currency, virtual gifts, virtual items, coupons, etc. In an embodiment of the present application, the resource package will no longer be issued directly, but a sub-resource package will be generated based on the resource package, thereby issuing the sub-resource package. The sub-resource package will also include a certain number of resources and can be regarded as a subset of the resource package. Then, multiple sub-resource packages can be generated based on one resource package, and different sub-resource packages can be issued to different user identifiers. When generating a sub-resource package, it is necessary to ensure that the total number of resources corresponding to the sub-resource package does not exceed the total number of resources set in the resource package.
[0118] In an embodiment of the present application, after receiving a resource creation request, the server creates a resource link and corresponding multiple resource packages, so that a sub-resource package can be subsequently distributed to the user through the resource link, so that the user can obtain the sub-resource package corresponding to the resource link. Each resource package has a resource parameter, which is used to indicate information about the sub-resource package corresponding to the resource package. The resource parameters of each resource package include the number of sub-resource packages and the number of resources. The sub-resource package is a resource package for distribution to the user. Each resource package corresponds to multiple sub-resource packages. The number of sub-resource packages corresponding to the resource package indicates the number of sub-resource packages corresponding to the resource package. The number of resources corresponding to the resource package is the sum of the corresponding quantities of the multiple sub-resource packages corresponding to the resource package.
[0119] The resource creation request is used to request the creation of a resource link, which is a link for users to access resources. Optionally, the resource link is a red envelope link, a website, etc. For example, the resource link is a red envelope logo, or a shopping website URL. The total number of sub-resource packages represents the total number of sub-resource packages corresponding to the multiple resource packages corresponding to the resource link. The total number of resources is the sum of the number of resources corresponding to the sub-resource packages corresponding to the total number of sub-resource packages.
[0120] For example, if the total number of sub-resource packages is 100 and the total number of resources is 200, it means that the total number of resources of 200 is divided into 100 sub-resource packages for users to obtain, and subsequent users can obtain the sub-resource packages.
[0121] In a possible implementation method, step 301 includes: the terminal sends a resource creation request to the server, and the server receives the resource creation request.
[0122] For example, if the terminal is a live broadcast terminal and the server is a live broadcast server, the live broadcast terminal sends a resource creation request to the live broadcast server so that the server generates a resource link. The generated resource link can then be published in the live broadcast room for the audience terminals in the live broadcast room to obtain the resource corresponding to the resource link.
[0123] Optionally, the resource creation request also carries a user ID, which is the user ID of the user requesting to create the resource link, that is, the user ID of the user logged in to the terminal. For example, the user ID is the user ID of the anchor requesting to distribute red envelopes in the live broadcast room, or the user ID is the user ID of the user requesting to distribute red envelopes in a chat group.
[0124] Optionally, the terminal obtains the total number of sub-resource packages and the total number of resources input by the user, and in response to detecting a confirmation operation, sends a resource creation request to the server, where the resource creation request carries the number of sub-resource packages and the total number of resources. For example, the terminal's display interface includes an input area and a confirmation option, and the user enters the total number of sub-resource packages and the total number of resources in the input area. After the user clicks the confirmation option, the terminal sends the resource creation request to the server.
[0125] In one possible implementation, the resource acquisition request is generated by an administrator through backend configuration of the server. The administrator controls the server in the backend and inputs the total number of sub-resource packages and the total number of resources, and the server then obtains the resource creation request.
[0126] 302. The server generates a resource link based on the resource creation request.
[0127] The resource link is a link for indicating the resource corresponding to the resource creation request, and different resource creation requests correspond to different resource links.
[0128] In one possible implementation, step 302 includes: verifying the total number of sub-resource packages and the total number of resources in the resource creation request, and generating a resource link according to the resource creation request in response to passing the verification.
[0129] Optionally, in response to the total number of sub-resource packages and the total number of resources being greater than 0, it is determined that the total number of sub-resource packages and the total number of resources have both passed verification; in response to the total number of sub-resource packages or the total number of resources being less than 0, it is determined that the verification has failed.
[0130] 303. The server generates multiple resource packages according to the total number of sub-resource packages and the total number of resources.
[0131] Each resource package has a resource parameter, which is used to indicate the information of the sub-resource package corresponding to the resource package. The resource parameter of each resource package includes the number of sub-resource packages and the number of resources. The number of sub-resource packages indicates the number of sub-resource packages corresponding to the resource package, and the number of resources indicates the sum of the number of resources corresponding to the sub-resource packages corresponding to the resource package. For example, for any resource package, the number of sub-resource packages corresponding to the resource package is 5, and the number of resources corresponding to the resource package is 100, indicating that the resource package corresponds to 5 sub-resource packages, and the sum of the number of resources corresponding to the 5 resource packages is 100. Optionally, the resource parameters of the resource package also include the number of remaining sub-resource packages and the number of remaining resources. The number of remaining sub-resource packages indicates the number of sub-resource packages that can be generated by the resource package, and the number of remaining resources indicates the number of unissued resources of the resource package excluding the issued sub-resource packages. When the resource package is just generated, in the resource parameters of the resource package, the number of sub-resource packages is equal to the number of remaining sub-resource packages, and the number of resources is equal to the number of remaining sub-resources.
[0132] The sum of the number of sub-resource bundles corresponding to multiple resource bundles equals the total number of sub-resource bundles, and the sum of the number of resources corresponding to multiple resource bundles equals the total number of resources. Different resource bundles may or may not have the same number of sub-resource bundles corresponding to them; and different resource bundles may or may not have the same number of resources corresponding to them.
[0133] By generating multiple resource packages corresponding to resource links, when resources are subsequently distributed to users, resources can be distributed to multiple users in parallel through multiple resource packages, thereby improving resource distribution efficiency.
[0134] In one possible implementation, a server generates resource bundle identifiers for multiple resource bundles and stores the generated resource bundle identifiers in association with resource links. The resource bundle identifiers are used to identify resource bundles, and different resource bundles correspond to different resource bundle identifiers. By storing the resource links in association with the multiple resource bundle identifiers, the corresponding resource bundles can subsequently be determined based on the resource links.
[0135] In one possible implementation, the server stores the generated multiple resource bundles in multiple memory areas. For example, each resource bundle is stored in a Redis (Remote Dictionary Server), which includes resource parameters of the resource bundle.
[0136] Since the resource package needs to be locked in the process of generating sub-resource packages through the resource package in the future to avoid the situation where the number of sub-resource packages generated by the resource package is greater than the number of resource packages corresponding to the resource package, multiple resource packages are stored in different memory areas respectively, so that after the resource package is assigned to the user ID, the memory area is locked, thereby achieving the locking of the resource package. Figure 4 As shown, taking the creation of red envelopes as an example, by creating a red envelope, a record is stored in the memory area, which includes the red envelope link, the number of sub-red envelopes corresponding to each red envelope, the red envelope amount of each red envelope, the memory area route corresponding to each sub-red envelope, the remaining number of sub-red envelopes corresponding to each red envelope, and the remaining red envelope amount corresponding to each red envelope, and each red envelope is stored in a memory area, and each memory area stores a red envelope identifier, the red envelope amount corresponding to the red envelope identifier, the number of sub-red envelopes corresponding to the red envelope identifier, the remaining number of sub-red envelopes corresponding to the red envelope identifier, and the remaining red envelope amount corresponding to the red envelope identifier.
[0137] In one possible implementation, the number of resources corresponding to each resource package is equal to the number of sub-resource packages, and the number of sub-resource packages corresponding to each resource package is the number of first sub-resource packages, which is a fixed value. Then, step 303 includes: determining the ratio between the total number of sub-resource packages and the number of first sub-resource packages as the number of resource packages, and determining the ratio between the total number of resources and the number of resource packages as the number of resources corresponding to each resource package, thereby obtaining multiple resource packages.
[0138] In one possible implementation, each resource bundle corresponds to a second number of sub-resource bundles, where the second number of sub-resource bundles represents the maximum number of sub-resource bundles corresponding to each resource bundle. If the number of sub-resource bundles in the resource parameters of each resource bundle is not greater than the second number of sub-resource bundles, step 303 includes generating multiple resource bundles based on the second number of sub-resource bundles, the total number of resources, and the total number of sub-resource bundles.
[0139] Optionally, if the number of unit resources corresponding to each sub-resource package is equal, then the ratio between the total number of resources and the total number of sub-resource packages is determined as the number of unit resources corresponding to each sub-resource package. Based on the number of the second sub-resource packages and the total number of sub-resource packages, the number of sub-resources corresponding to multiple resource packages is determined. The product of the unit resource number and the number of sub-resources corresponding to each resource package is used to determine the number of resources corresponding to the multiple resource packages, thereby obtaining the multiple resource packages.
[0140] For example, the total number of sub-resource packages is 10,000, the total number of resources is 20,000, the number of second sub-resource packages is 200, and the number of unit resources corresponding to each sub-resource package is equal. Then, the number of unit resources corresponding to each sub-resource package is determined to be 2, the number of resource packages is 50, and the number of resources corresponding to each resource package is 100, that is, 50 resource packages are obtained, the number of sub-resources corresponding to each resource package is 200, and the number of resources corresponding to each resource package is 400.
[0141] Optionally, the resource quantity corresponding to each sub-resource package falls within a first reference quantity range, and different sub-resource packages may have different resource quantities. For any resource package, a second first reference quantity range is determined based on the number of sub-resource packages corresponding to the resource package and the first reference quantity range. A random quantity within the second first reference quantity range is selected as the resource quantity corresponding to the resource package, and the sum of the resource quantities corresponding to multiple resource packages equals the total resource quantity.
[0142] For example, if the first reference quantity range is [0.1, 100], it means that the minimum value of the unit resource quantity corresponding to each sub-resource package is 0.1, and the maximum value is 100. The number of sub-resource packages corresponding to the resource package is 5, and the second first reference quantity range is [0.5, 500], which means that the minimum value of the sum of the unit resource quantities corresponding to the 5 sub-resource packages is 0.1, and the maximum value is 500.
[0143] 304. The server receives at least one resource acquisition request. Each resource acquisition request carries a resource link and a user identifier requesting to acquire a resource corresponding to the resource link.
[0144] In an embodiment of the present application, after the server creates a resource link, the resource link is published to terminals logged in by multiple user identifiers. After the user views the resource connection, the resource link is triggered, and a resource acquisition request is sent to the server. The server can receive the resource acquisition request so as to subsequently issue a sub-resource package to the user identifier that requests to obtain the resource corresponding to the resource link.
[0145] The resource acquisition request is used to acquire the resource corresponding to the resource link. Optionally, different resource acquisition requests are sent by different terminals. The user identifier requesting to acquire the resource corresponding to the resource link is the user requesting to acquire the sub-resource package through the resource link.
[0146] In one possible implementation, step 304 includes: issuing the resource link to multiple terminals, the multiple terminals displaying the resource link, and in response to any terminal detecting a triggering operation on the resource link, sending a resource acquisition request to the server, the resource acquisition request carrying the resource link and the user identifier of the user logged in to the terminal, and the server receiving the resource acquisition request sent by the terminal.
[0147] It should be noted that the embodiment of the present application is only described based on the resource link carried in at least one received resource acquisition request being the same resource link. In another embodiment, the server can receive resource acquisition requests carrying different resource links. The server can then process the resource acquisition requests corresponding to different resource links separately using the method provided in the embodiment of the present application. The processing process for each resource link is similar, and the embodiment of the present application will not be further described.
[0148] 305. The server allocates a resource package to at least one user identifier from the multiple resource packages corresponding to the resource link.
[0149] Since the resource link corresponds to multiple resource packages, a resource package is allocated to each user identifier in the at least one user identifier, so that a sub-resource package is subsequently issued to the user identifier through the allocated resource package.
[0150] In one possible implementation, step 305 includes, in response to the resource link being verified, allocating a resource bundle to at least one user identifier from the plurality of resource bundles corresponding to the resource link. Verifying the resource link ensures the accuracy of the resource link, thereby ensuring the accuracy of subsequent sub-resource bundles allocated to the user identifier using the resource link.
[0151] Optionally, the resource link is verified by using the following two methods.
[0152] The first way: in response to the current time point belonging to the valid time period corresponding to the resource link, it is determined that the resource link verification is passed.
[0153] In an embodiment of the present application, each resource link has a valid time period, which is used to indicate the valid time corresponding to the resource link. For example, the valid time period is from 10:00 a.m. to 10:30 a.m. If the current time point falls within the valid time period, it means that the resource link is valid at the current time point, and the resource link is determined to have passed verification.
[0154] Optionally, in response to the current time point not belonging to the valid time period corresponding to the resource link, it is determined that the resource link verification has failed.
[0155] Optionally, the server includes a correspondence between the resource link and the valid time period. When generating the resource link, a valid time period is generated for the resource link, and the resource link and the valid time period of the resource link are stored in correspondence. When verifying the resource link, the correspondence is queried through the resource link to determine the valid time period corresponding to the resource link.
[0156] The second method: in response to a resource link corresponding to a resource package that has not been released, determining that the resource link verification is passed.
[0157] By verifying whether there are any unissued resource packages among the multiple resource packages corresponding to the resource link, it is determined whether the resource link can still generate sub-resource packages for the user ID. If there are any unissued resource packages corresponding to the resource link, it means that sub-resource packages can still be issued for the user ID through the resource link, and the resource link verification has passed. If the multiple resource packages corresponding to the resource link have all been issued, it means that the resources corresponding to the resource link have been issued, and the resource link verification is determined to have failed.
[0158] Optionally, if the resource parameters of the resource package include the number of remaining sub-resource packages, the remaining number of sub-resource packages corresponding to the multiple resource packages corresponding to the resource link is traversed, and in response to any remaining number of sub-resource packages being not 0, it is determined that the resource packages corresponding to the remaining number of sub-resource packages have not been issued.
[0159] Optionally, if the target resource parameter of the resource package includes the remaining resource quantity, the remaining resource quantities corresponding to multiple resource packages corresponding to the resource link are traversed, and in response to any remaining resource quantity not being 0, it is determined that the resource package corresponding to the remaining resource quantity has not been fully distributed.
[0160] In a possible implementation, step 305 includes: for any resource acquisition request, in response to successful verification of the user identifier carried in the resource acquisition request, allocating a resource bundle to the user identifier from multiple resource bundles corresponding to the resource link.
[0161] To ensure accurate resource allocation, the user ID requesting a sub-resource bundle must be verified to prevent duplicate sub-resource bundles or blacklisted users. Therefore, resource bundles are allocated to users only if the user ID passes verification, ensuring accurate resource allocation.
[0162] Optionally, the user ID is verified by using the following four methods.
[0163] The first way: in response to the number of resources acquired by the user identifier through the resource link being less than a first reference number, it is determined that the user identifier is authenticated.
[0164] The first reference number represents the maximum number of resources that a user identifier can obtain through a resource link. The first reference number is an arbitrary value, such as 10 or 20.
[0165] In order to prevent a user identifier from obtaining too many resources through a resource link, the maximum number of resources that a user identifier can obtain from a resource link is limited based on a first reference number. If the number of resources obtained by the user identifier through the resource link is less than the first reference number, it means that the user identifier can still obtain sub-resource packages through the resource link, and the user identifier is determined to have been verified successfully, so that the user identifier can subsequently obtain sub-resource packages through the resource link. If the number of resources obtained by the user identifier through the resource link is not less than the first reference number, it means that the number of resources obtained by the user identifier through the resource link has reached the upper limit, and the user identifier can no longer obtain sub-resource packages through the resource link, and the user identifier is determined to have failed verification.
[0166] Optionally, the database in the server stores a correspondence between user identifiers, resource links and the number of resources obtained through the resource links. Then, based on the user identifier and the resource link, the database is queried to determine the number of resources obtained by the user identifier through the resource link.
[0167] Optionally, in the database, the correspondence between the user ID, the resource link, and the number of resources obtained through the resource link is stored in the form of a list. The correspondence is shown in Table 1. The number of resources obtained by user ID 1 through resource link A is 5, the number of resources obtained by user ID 2 through resource link A is 4, and the number of resources obtained by user ID 3 through resource link A is 6.
[0168] Table 1
[0169] User ID Resource Links Number of resources User ID 1 Resource Link A 5 User ID 2 Resource Link A 4 User ID 3 Resource Link A 6
[0170] The second way: in response to the number of sub-resource packages acquired by the user identifier through the resource link being less than a second reference number, it is determined that the user identifier is authenticated.
[0171] The second reference number represents the maximum number of sub-resource packages that a user identifier can obtain through a resource link. The second reference number is an arbitrary value, such as 1 or 3.
[0172] In order to prevent a user ID from obtaining too many resources through a resource link, the maximum number of sub-resource packages that a user ID can obtain from a resource link is limited based on a second reference number. If the number of sub-resource packages obtained by a user ID through a resource link is less than the second reference number, it means that the user ID can still obtain sub-resource packages through the resource link, and the user ID is determined to have been verified successfully, so that the user ID can subsequently obtain sub-resource packages through the resource link. If the number of sub-resource packages obtained by a user ID through a resource link is not less than the second reference number, it means that the number of resource packages obtained by the user ID through the resource link has reached the upper limit, and the user ID can no longer obtain sub-resource packages through the resource link, and the user ID is determined to have failed verification.
[0173] Optionally, the database in the server stores the correspondence between the user identifier, the resource link and the number of sub-resource packages obtained through the resource link. Then, based on the user identifier and the resource link, the database is queried to determine the number of sub-resource packages obtained by the user identifier through the resource link.
[0174] Optionally, the database stores the correspondence between the user ID, the resource link, and the number of sub-resource packages obtained through the resource link in the form of a list. This correspondence is shown in Table 2. For example, user ID 1 obtains 1 sub-resource package through resource link A, user ID 2 obtains 2 sub-resource packages through resource link A, and user ID 3 obtains 1 sub-resource package through resource link A.
[0175] Table 2
[0176] User ID Resource Links Number of sub-resource packages User ID 1 Resource Link A 1 User ID 2 Resource Link A 2 User ID 3 Resource Link A 1
[0177] A third manner: in response to not finding the user identifier in the database, determining that the user identifier is authenticated.
[0178] The database is used to record user identifiers that have obtained resources through resource links. The database is queried to determine whether the user identifier has obtained resources through the resource link. If the user identifier does not exist in the database, it means that the user identifier has not yet obtained resources through the resource link, and the user identifier is determined to have been authenticated so that the user identifier can subsequently obtain resources through the resource link. If the user identifier exists in the database, it means that the user identifier has obtained resources through the resource link, and the user identifier will no longer be able to obtain resources through the resource link, and the user identifier is determined to have failed authentication.
[0179] Optionally, the database includes a correspondence between the user identifier and the resource link. After the user identifier obtains the resource through the resource link, the correspondence between the user identifier and the resource link is generated and stored in the database. In response to the fact that the correspondence between the user identifier and the resource link is not found in the database, it is determined that the user identifier is verified.
[0180] A fourth manner: in response to not finding the user identifier in the blacklist, determining that the user identifier is authenticated.
[0181] Optionally, in response to finding the user identifier in the blacklist, it is determined that the verification of the user identifier has failed.
[0182] In a possible implementation, step 305 includes allocating a resource package in an unlocked state to at least one user identifier from a plurality of resource packages corresponding to the resource link.
[0183] In an embodiment of the present application, since the target resource parameters of each resource package include the number of sub-resource packages, when a resource package generates sub-resource packages for multiple user identifiers at the same time, it is easy for the number of sub-resource packages generated by the resource package to exceed the number of sub-resource packages corresponding to the resource package, thereby causing inaccurate resources to be issued. Therefore, after the resource package is allocated to any user identifier, the status of the resource package is set to a locked state, so that the resource package can only generate a sub-resource package for one user identifier at the same time, avoiding over-issuance of resources and thus improving the accuracy of resource issuance.
[0184] For any resource package, the resource package is in an unlocked state, which means that the resource package is not currently assigned to a user ID. Therefore, a resource package in an unlocked state is assigned to the user ID, and a sub-resource package is subsequently generated for the user ID from the assigned resource package to ensure the accuracy of subsequent resource issuance.
[0185] In a possible implementation, step 305 includes: after allocating a resource bundle to at least one user identifier from a plurality of resource bundles corresponding to the resource link, setting the state of the allocated resource bundle to a locked state.
[0186] By setting the status of the allocated resource package to a locked state, the allocated resource package cannot be reallocated to other user IDs, thereby avoiding over-issuance of resources and improving the accuracy of resource issuance.
[0187] In addition, after the server receives multiple resource acquisition requests, it allocates a resource package to the user identifier carried in the resource acquisition request in the order in which the multiple resource acquisition requests are received. When allocating a resource package to a user, it is necessary to determine whether the multiple resource packages corresponding to the resource link have been issued. If, when allocating a resource package to the current user identifier, it is determined that the multiple resource packages corresponding to the resource link have been issued, no resource package will be allocated to the current user identifier.
[0188] In one possible implementation, when allocating a resource package for the current user ID, if it is determined that multiple resource packages corresponding to the resource link have been issued, the server sends a notification of completion to the terminal logged in by the user ID to prompt that the sub-resource package corresponding to the resource link has been obtained by other users.
[0189] 306. The server generates a sub-resource package for the user identifier corresponding to the resource package according to the remaining resource quantity in the target resource parameter of the allocated resource package, so that the resource quantity corresponding to the sub-resource package is not greater than the remaining resource quantity.
[0190] The target resource parameters include the remaining resource quantity, which is the number of resources remaining in the resource package. By ensuring that the resource quantity corresponding to the generated sub-resource packages is no greater than the remaining resource quantity, the sum of the resource quantities corresponding to the resource packages generated by the resource package does not exceed the resource quantity corresponding to the resource package, thereby ensuring the accuracy of resource distribution.
[0191] In one possible implementation, the target resource parameter also includes the number of remaining sub-resource packages; then step 306 includes the following steps 3061-3062:
[0192] 3061. In response to the number of remaining sub-resource packages being greater than 1, a sub-resource package is generated for the user identifier according to the number of remaining resources, and the number of resources corresponding to the sub-resource package is less than the number of remaining resources.
[0193] Among them, the number of remaining sub-resource packages is a positive integer. When the number of remaining sub-resource packages is greater than 1, it means that the resource package can still generate two or more sub-resource packages. Therefore, the number of resources corresponding to the sub-resource package currently generated for the user identifier is less than the number of remaining resources, so that the resource package can subsequently generate sub-resource packages for other user identifiers.
[0194] Optionally, if the number of unit resources corresponding to each sub-resource package is the same, then in response to the number of remaining resource packages being greater than 1, the ratio between the remaining resource quantity and the remaining sub-resource package number is determined as the resource quantity corresponding to the sub-resource package.
[0195] Optionally, the number of unit resources corresponding to each sub-resource package may be the same or different, and the number of resources corresponding to each sub-resource package belongs to a first reference quantity range. In response to the number of remaining sub-resource packages being greater than 1, a random number is obtained from the first reference quantity range and determined as the number of resources corresponding to the sub-resource package, and the random number is less than the number of remaining resources.
[0196] 3062. In response to the number of remaining sub-resource packages being equal to 1, generate a sub-resource package for the user identifier according to the number of remaining resources, and the number of resources corresponding to the sub-resource package is equal to the number of remaining resources.
[0197] When the number of remaining sub-resource packages corresponding to the resource package is 1, it means that the remaining resource quantity can still generate a sub-resource package. Therefore, the remaining resource quantity of the resource package is used as the resource quantity corresponding to the generated sub-resource package to complete the distribution of the resource package. Therefore, the resource quantity corresponding to the sub-resource package is equal to the remaining resource quantity.
[0198] It should be noted that the embodiment of the present application is explained by allocating a sub-resource package to the user identifier through the remaining number of resources in the target resource parameters of the resource package, while in another embodiment, there is no need to execute step 306, and a sub-resource package is generated for the user identifier corresponding to the resource package based on other information in the target resource parameters of the allocated resource package.
[0199] In one possible implementation, after step 306, the method further includes setting the resource bundle's status to an unlocked state. After generating a sub-resource bundle for a user identifier, setting the resource bundle's status to an unlocked state enables subsequent generation of sub-resource bundles for other user identifiers using the resource bundle.
[0200] In one possible implementation, after step 306, the target reference of the allocated resource package needs to be updated. The updating process includes the following two methods:
[0201] In the first method, the target resource parameters include the number of remaining sub-resource packages and the remaining resource quantity: the number of remaining sub-resource packages corresponding to the resource package is reduced by 1, and the remaining resource quantity corresponding to the resource package is reduced by the resource quantity corresponding to the sub-resource package.
[0202] After generating a sub-resource package for a user through the allocated resource package, the number of remaining sub-resource packages and the remaining resource quantity corresponding to the resource package are updated to ensure the accuracy of the target resource parameters of the resource package, so that sub-resource packages can continue to be generated for other user IDs based on the updated number of remaining sub-resource packages and the remaining resource quantity, thereby ensuring the accuracy of resource distribution.
[0203] The second method is that the target resource parameter includes the number of remaining sub-resource packages and the unit resource quantity. The unit resource quantity is used to indicate the number of resources corresponding to each sub-resource package in the resource package: the number of remaining sub-resource packages in the target resource parameter of the resource package is reduced by 1.
[0204] Since the number of unit resources corresponding to each sub-resource package is the same, after a sub-resource package is generated for a user ID using the allocated resource package, the number of remaining sub-resource packages corresponding to the resource package is updated to ensure the accuracy of the target resource parameters of the resource package, so that sub-resource packages can be generated for other user IDs based on the updated number of remaining sub-resource packages, thereby ensuring the accuracy of resource distribution.
[0205] It should be noted that the embodiment of the present application is explained by taking the case where the number of remaining resources corresponding to the allocated resource package is greater than 0 and a sub-resource package is successfully generated as an example. In another embodiment, if the number of remaining resources corresponding to the allocated resource package is 0, then the allocated resource package will no longer be able to generate a sub-resource package for the corresponding user identifier. Therefore, it is necessary to reallocate another resource package for the user identifier corresponding to the resource package from the multiple resource packages corresponding to the resource link.
[0206] In one possible implementation, the target resource parameter includes the number of remaining sub-resource packages; after step 305, the method further includes: in response to the number of remaining sub-resource packages in the target resource parameter being 0, reallocating another resource package to the user identifier corresponding to the resource package from the multiple resource packages corresponding to the resource link.
[0207] In addition, after another resource bundle is reallocated for the user identifier, in response to the remaining resource quantity corresponding to the other resource bundle being greater than 0, the above step 306 is executed to generate a sub-resource bundle for the user identifier.
[0208] 307. The server issues a sub-resource package to the user ID corresponding to the resource package.
[0209] After the server generates a sub-resource package for the user ID, it issues the sub-resource package to the corresponding user ID, so that the user can obtain the resources in the sub-resource package.
[0210] In one possible implementation, step 307 includes the following steps 3071-3073:
[0211] 3071. Generate a distribution ID corresponding to the user ID based on the user ID and the resource link.
[0212] In an embodiment of the present application, when issuing a sub-resource package for a user identifier, a issuance identifier is generated for the user identifier and the resource link to record that the sub-resource package has been issued to the user identifier through the resource link. This issuance identifier is used to avoid repeated issuance of resource packages to a user identifier, thereby ensuring the accuracy of resource issuance.
[0213] The issuing identifier is a unique identifier for issuing resources to the user identifier through the resource link. Optionally, the issuing identifier is composed of the user identifier and the resource link.
[0214] 3072. In response to not finding the issuance identifier corresponding to the user identifier in the database, issue a sub-resource package to the user identifier corresponding to the resource package.
[0215] The database is used to store the issuance identifier corresponding to the user identifier of the resource in the issued resource link.
[0216] Optionally, the database includes a correspondence between the issuance identifier, the user identifier, and the resource link. By querying the correspondence in the database, it is possible to determine whether the issuance identifier corresponding to the user identifier exists in the database.
[0217] The database is queried using the user ID to determine whether the user ID exists in the database, thereby determining whether a sub-resource bundle has been issued for the user ID via the resource link. If the user ID is not found, it indicates that a sub-resource bundle has not been issued for the user ID via the resource link. Therefore, the generated sub-resource bundle is issued to the user ID via the resource bundle.
[0218] 3073. In response to finding the issuance identifier corresponding to the user identifier in the database, sending an issuance completion notification to the user identifier.
[0219] The issuance completion notification is used to prompt the user to identify that the resource in the resource link has been obtained.
[0220] Before issuing a sub-resource package to a user, the issuance identifier corresponding to the user is recorded in the database to avoid repeated issuance of sub-resource packages to the same user identifier, thereby ensuring the accuracy of resource issuance.
[0221] In one possible implementation, each resource acquisition request carries a resource link published in the live broadcast room and a viewer user ID requesting to obtain the resource corresponding to the resource link; step 307 includes: the server sends a resource issuance instruction to the terminal logged in by the viewer user ID, and the resource issuance instruction carries the sub-resource package corresponding to the viewer user ID, and the terminal then displays the sub-resource package in the live broadcast interface of the live broadcast room.
[0222] In an embodiment of the present application, the server is a live broadcast server. In each live broadcast room, the live broadcast terminal sends a resource creation request to the live broadcast server. The live broadcast server creates a resource link and corresponding multiple resource packages based on the resource creation request, and publishes the resource link in the live broadcast room, so that the terminal logged in by the audience user ID in the live broadcast room displays the resource link in the live broadcast interface of the live broadcast room. In response to the audience user's triggering operation on the resource link, the audience terminal sends a resource acquisition request to the live broadcast server, so that the live broadcast server generates a sub-resource package for the audience user ID according to the above steps 304-306, and then sends a resource distribution instruction to the terminal logged in by the audience user ID to distribute the sub-resource package to the audience user, thereby realizing the solution of distributing sub-resource packages in the live broadcast room.
[0223] In one possible implementation, the resource link is an item link; step 307 includes: the server sends an item distribution instruction to the terminal logged in by the user identifier, the item distribution instruction carries a sub-item package corresponding to the user identifier, the sub-item package includes the item, and the terminal receives the sub-item package.
[0224] For example, the resource link is an item link, which is the URL of an item display page. Items to be snapped up are displayed on the item display page. When a snap-up operation for the items on the item display page is detected on the terminal, an item acquisition request is sent to the server. The server generates a sub-item package for the user who logs into the terminal according to steps 304-306, and then sends an item distribution instruction to the terminal to distribute the sub-item package to the user who logs into the terminal, thereby enabling the user to snap up the items on the item display page.
[0225] Furthermore, when the server distributes the generated sub-resource package to the corresponding user ID, it uses an asynchronous payment method. In one possible implementation, the server sends a resource acquisition notification to the terminal logged in by the user ID, notifying the user of the number of resources acquired, and then distributes that amount of resources to the user ID's account.
[0226] When distributing resources to a user, a resource acquisition notification is first sent to the user, notifying them of the number of resources already acquired. Then, the resources included in the sub-resource package are distributed to the user's account. By adopting an asynchronous accounting method, the performance of resource distribution is improved and the accuracy of resource distribution is guaranteed.
[0227] Optionally, the server adds a resource transfer message to the resource transfer queue, where the resource transfer message carries a user ID and a corresponding resource quantity. The server processes each resource transfer message in turn according to the multiple resource transfer messages in the resource transfer queue, and distributes a corresponding amount of resources to the account of the user ID in the resource transfer message.
[0228] In addition, after the server issues the sub-resource package to the user ID, the sub-resource package is displayed on the terminal logged in by the user ID, so that the user can view the number of resources corresponding to the sub-resource package and the number of resources obtained by other user IDs through the resource link.
[0229] In the embodiments of the present application, by generating multiple resource packages for a resource link, resources can be simultaneously distributed to multiple users, enhancing the parallel scalability of the resource distribution system. Furthermore, upon receiving a resource acquisition request, the resource link or user identifier is verified to filter the resource acquisition request, thereby eliminating those that do not meet the distribution conditions. Subsequently, only the filtered resource acquisition requests are processed, thereby improving resource distribution efficiency.
[0230] In the method provided in the embodiments of this application, a resource link corresponds to multiple resource packages. During the resource distribution process via the resource link, each resource package is assigned to a user ID, and then a sub-resource package is generated from the assigned resource package, thereby distributing the sub-resource package for the user ID. Because different resource packages do not interfere with each other, resources can be distributed in parallel, breaking the limitation of related technologies that only distribute resource packages to different user IDs in a sequential order, thereby improving resource distribution efficiency.
[0231] In addition, before allocating resource packages to user identifiers, resource links and user identifiers are verified to filter out resource acquisition requests that fail verification, thereby reducing the number of resource acquisition requests. Subsequent processing is performed according to the filtered resource acquisition requests, thereby improving resource issuance efficiency.
[0232] Furthermore, in the process of generating sub-resource packages for user identifiers through resource packages, the resource package status is set to a locked state to avoid the situation where one resource package generates sub-resource packages for multiple users at the same time, resulting in over-issuance of resources, thereby improving the accuracy of resource issuance.
[0233] Figure 5A process for users to grab red envelopes is shown. When the user grabs the red envelope, the server performs interactive service verification and blacklist verification on the user ID to ensure the security of the user ID. A sub-red envelope is generated for the user ID, and a red envelope order number is generated for the user through the number release service. The red envelope order number is the issuance identification. The red envelope order number consists of the red envelope identification and the user identification, and a query is made in the memory area to see whether the red envelope order number is included to avoid repeated allocation of sub-red envelopes to the user. When the memory area does not include the red envelope order number, the red envelope order number, user identification and sub-red envelope are stored in the memory area accordingly to record the process of the user ID grabbing the red envelope. According to the red envelope amount corresponding to the sub-red envelope issued to the user ID, the resources of the red envelope amount are issued to the virtual account corresponding to the user ID, and an account-side order number is generated to record the resources corresponding to the sub-red envelope issued to the user ID. Subsequently, the user can withdraw the resources in the virtual account and withdraw the resources to the real account of the user ID.
[0234] Figure 5 A red envelope withdrawal process is also shown, in which resources in the virtual account of the user identification are withdrawn. Through the number release service, a withdrawal order number is generated for the red envelope withdrawal process, and a query is made in the memory area to see whether the withdrawal order number is included to avoid repeated withdrawals. If the withdrawal order number is not included in the memory area, the corresponding resources are transferred to the real account of the user identification, and the withdrawal order number is stored in the memory area to record the red envelope withdrawal process of the user identification.
[0235] Taking the live broadcast scenario as an example, the resource distribution method provided in the above embodiment is described. Figure 6 The following figure shows a process for creating a red envelope in a live broadcast room. The interacting entities are the live broadcast terminal, the live broadcast server, and the storage server. The red envelope creation process includes:
[0236] 1. The live broadcast terminal obtains the total number and total amount of red envelopes based on the live broadcast interface of the live broadcast room, and in response to the confirmation operation, sends a red envelope creation request to the live broadcast server. The red envelope creation request carries the total number and total amount of red envelopes.
[0237] 2. The live broadcast server receives the red envelope creation request sent by the live broadcast terminal.
[0238] 3. The live broadcast server verifies the total number of red envelopes and the total amount of the red envelopes carried in the red envelope creation request. In response to the verification being successful, step 4 is executed. In response to the verification being unsuccessful, a creation failure notification is generated and sent to the live broadcast terminal to indicate that the red envelope creation has failed.
[0239] 4. The live broadcast server generates a red envelope link based on the red envelope creation request, determines the number of red envelopes corresponding to the red envelope link based on the total number of red envelopes, and generates red envelope identifiers equal to the number of red envelopes.
[0240] 5. The live broadcast server reads the red envelope cluster configuration table in MySQL (disk storage area). In response to a successful read, it determines that the red envelope cluster configuration table includes multiple memory areas that do not store red envelopes, and executes step 6. In response to a read failure, a creation failure notification is sent to the live broadcast terminal to prompt that the red envelope creation failed.
[0241] 6. The live broadcast server allocates a memory area for each red envelope identifier from multiple memory areas that do not store red envelopes. In response to a successful allocation, step 7 is executed; in response to an unsuccessful allocation, a creation failure notification is sent to the live broadcast terminal to prompt that the red envelope creation failed.
[0242] 7. The live broadcast server generates multiple red envelopes based on the total number of red envelopes, the total amount of the red envelopes and the number of sub-red envelopes, and stores each red envelope and the corresponding red envelope identifier in the allocated memory area. In response to successful storage, the multiple red envelopes are uploaded to the storage server, and then step 8 is executed; in response to failed storage, a creation failure notification is sent to the live broadcast terminal to prompt that the red envelope creation failed.
[0243] 8. The live broadcast server stores each red envelope and the corresponding red envelope identifier in the red envelope configuration information table in the disk storage area. In response to successful storage, the red envelope link is split into multiple red envelopes, and the red envelope creation process ends. In response to failed storage, a creation failure notification is sent to the live broadcast terminal to prompt that the red envelope creation failed.
[0244] 9. After the red envelope is successfully created, the live broadcast server publishes the red envelope link in the live broadcast room so that the audience users in the live broadcast room can trigger the red envelope link.
[0245] Taking the live broadcast scenario as an example, the resource distribution method provided in the above embodiment is described. Figure 7 The following figure shows a process for grabbing red envelopes in a live broadcast room. The interacting entities are the viewer terminal, the live broadcast server, and the storage server. The viewer terminal has a live broadcast application installed, and the live broadcast server is the server corresponding to the live broadcast application. The red envelope grabbing process includes:
[0246] 1. The audience terminal uses the live broadcast application to display the red envelopes issued by the anchor in the live broadcast room on the live broadcast interface of the live broadcast room, and in response to the triggering operation of the red envelope, sends a red envelope acquisition request to the live broadcast server.
[0247] 2. The live broadcast server receives a red envelope acquisition request sent by the viewer terminal through a gateway between the viewer terminal and the live broadcast server. The red envelope acquisition request carries the viewer user ID and the red envelope link for logging into the viewer terminal.
[0248] 3. The live broadcast server performs login verification on the viewer user ID to determine whether the viewer user ID has logged into the live broadcast application. In response to successful verification, step 4 is executed. In response to unsuccessful verification, a login notification is sent to the viewer terminal to prompt the viewer to log into the live broadcast application.
[0249] 4. The live broadcast server verifies the validity period of the red envelope link to determine whether the current time point falls within the valid time period corresponding to the red envelope link. In response to the verification being successful, step 5 is executed. In response to the verification being unsuccessful, a failure notification is sent to the viewer terminal to prompt the user that the red envelope corresponding to the red envelope link has expired.
[0250] 5. The live broadcast server determines whether there are any undistributed red envelopes in the red envelope link through the red envelope parameters of multiple red envelopes corresponding to the red envelope link stored locally. In response to the existence of undistributed red envelopes, step 6 is executed; in response to the absence of undistributed red envelopes, a grab-all notification is sent to the audience terminal to remind the user that the red envelopes corresponding to the red envelope link have been grabbed.
[0251] Among them, the live broadcast server obtains the red envelope parameters of multiple red envelopes corresponding to the red envelope link from the memory area corresponding to the red envelope link in the storage server through the red envelope grabbing logic layer, and stores them locally, so that the subsequent live broadcast server can directly make judgments based on the locally stored red envelope parameters.
[0252] 6. The live broadcast server queries the database based on the user ID to determine whether the viewer user ID exists in the database. In response to the absence of the viewer user ID, step 7 is executed. In response to the presence of the viewer user ID, a waiting notification is sent to the viewer terminal to remind the viewer user that the red envelope is currently being grabbed. Please wait patiently to prevent the viewer user ID from repeatedly grabbing the red envelope.
[0253] 7. The live broadcast server queries the number of sub-red envelopes and the amount of red envelopes that the viewer user ID has obtained through the red envelope link. In response to the number of sub-red envelopes being less than the second reference number and the amount of the sub-red envelopes being less than the reference amount, step 8 is executed. In response to the number of sub-red envelopes being not less than the second reference number or the amount of the sub-red envelopes being not less than the reference amount, an acquisition notification is sent to the viewer terminal to prompt the viewer user that the sub-red envelope corresponding to the red envelope link can no longer be obtained.
[0254] 8. The live broadcast server determines whether the viewer user ID has followed the host user ID of the live broadcast room. In response to having followed the host user ID, step 9 is executed. In response to not following the host ID, the viewer user ID is set to follow the host ID, and then step 9 is executed.
[0255] 9. The live broadcast server queries the blacklist according to the viewer user ID. In response to the viewer user ID not being included in the blacklist, step 10 is executed. In response to the viewer user ID being included in the blacklist, a busy notification is sent to the viewer terminal to remind the viewer user that the system is busy.
[0256] 10. The live broadcast server allocates a red envelope with remaining sub-red envelopes to the viewer user ID based on multiple red envelopes corresponding to the red envelope link stored locally, and sends a network request to the storage server. The network request carries the viewer user ID and the red envelope ID.
[0257] 11. The storage server receives the network request and sets the status of the red envelope to a locked state, for example, locking the memory area of the red envelope, generating a sub-red envelope for the viewer user ID based on the remaining amount and the remaining number of sub-red envelopes in the red envelope parameters of the red envelope, calculating the remaining amount and the remaining number of sub-red envelopes in the red envelope parameters of the red envelope, updating the red envelope parameters of the red envelope in the memory area, and then setting the status of the red envelope to an unlocked state, for example, unlocking the memory area of the red envelope.
[0258] 12. The storage server generates a distribution identifier based on the viewer user ID and the red envelope link. It uses the SetNx (SETif Not eXists) command to determine whether the distribution identifier exists in the storage server. If no distribution identifier corresponding to the viewer user ID is found in the database, a resource transfer message is added to the resource transfer queue. The resource transfer message carries the viewer user ID and the corresponding red envelope. The resource transfer queue is a Kafka message queue.
[0259] 13. The storage server processes the resource transfer messages in sequence through the red envelope processing program according to the arrangement order of multiple resource transfer messages in the resource transfer queue, and distributes the sub-red envelope to the account of the audience user ID according to the audience user ID and the corresponding sub-red envelope in the resource transfer message, and generates an order ID. The order ID, the resource quantity corresponding to the sub-red envelope, and the audience user ID are stored in the memory area, and the sub-red envelope preempted by the audience user ID is written into the red envelope preemption list corresponding to the red envelope link, so that the red envelope preemption list can be subsequently sent to the audience user, and the audience user can check the preemption status of the red envelope link.
[0260] In the embodiment of the present application, the storage server stores the red envelope corresponding to the red envelope link, and in the process of the audience user grabbing the red envelope link, the red envelope parameters of the red envelope in the storage server are updated in real time. The live broadcast server pulls the red envelope parameters of the red envelope corresponding to the red envelope link from the storage server and stores them locally, so that after the live broadcast server receives the red envelope acquisition request, Figure 8 As shown, a traffic funnel filtering method is adopted to screen multiple red envelope acquisition requests received layer by layer according to the locally stored information to screen out red envelope acquisition requests that do not meet the requirements, and send a network request to the storage server through the screened red envelope acquisition requests, so that the storage server can issue red envelopes to the audience users, reducing the number of red envelope acquisition requests processed by the storage server, thereby improving the efficiency of resource issuance.
[0261] like Figure 9 As shown, a red envelope link is displayed in the live broadcast interface displayed on the audience terminal. In response to the triggering operation of the open option in the red envelope link, the red envelope amount obtained by the audience user is displayed in the live broadcast interface. In response to the triggering operation of the details option, the red envelope amount obtained by other audience users in the live broadcast room is displayed in the live broadcast interface.
[0262] Figure 10 This is a schematic diagram of the structure of a resource distribution device provided in an embodiment of the present application. Figure 10 As shown, the device includes:
[0263] The receiving module 1001 is configured to receive at least one resource acquisition request, each resource acquisition request carrying a resource link and a user identifier requesting to acquire a resource corresponding to the resource link;
[0264] A first allocation module 1002 is configured to allocate a resource package to at least one user identifier from a plurality of resource packages corresponding to a resource link;
[0265] The issuing module 1003 is configured to generate a sub-resource package for the user identifier corresponding to the resource package according to the target resource parameters of the allocated resource package, and issue the sub-resource package to the user identifier corresponding to the resource package.
[0266] In one possible implementation, the target resource parameter includes the amount of remaining resources, such as Figure 11 As shown, the issuing module 1003 includes:
[0267] The generating unit 1031 is configured to generate a sub-resource package for the user identifier corresponding to the resource package according to the number of remaining resources, so that the number of resources corresponding to the sub-resource package is not greater than the number of remaining resources.
[0268] In another possible implementation, the target resource parameter also includes the number of remaining sub-resource packages; the generation unit 1031 is configured to, in response to the number of remaining sub-resource packages being greater than 1, generate a sub-resource package for the user identifier based on the number of remaining resources, where the number of resources corresponding to the sub-resource package is less than the number of remaining resources; and in response to the number of remaining sub-resource packages being equal to 1, generate a sub-resource package for the user identifier based on the number of remaining resources, where the number of resources corresponding to the sub-resource package is equal to the number of remaining resources.
[0269] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages; Figure 11 As shown, the device also includes:
[0270] The second allocation module 1004 is configured to reallocate another resource package to the user identifier corresponding to the resource package from the multiple resource packages corresponding to the resource link in response to the number of remaining sub-resource packages in the target resource parameter being 0.
[0271] In another possible implementation, the target resource parameters include the number of remaining sub-resource packages and the amount of remaining resources; Figure 11 As shown, the device also includes:
[0272] The updating module 1005 is configured to reduce the number of remaining sub-resource packages corresponding to the resource package by 1, and reduce the number of remaining resources corresponding to the resource package by the number of resources corresponding to the sub-resource package.
[0273] In another possible implementation, the target resource parameter includes the number of remaining sub-resource packages and the unit resource quantity, where the unit resource quantity is used to indicate the resource quantity corresponding to each sub-resource package in the resource package;
[0274] like Figure 11 As shown, the device also includes:
[0275] The updating module 1005 is configured to reduce the number of remaining sub-resource packages in the target resource parameter of the resource package by 1.
[0276] In another possible implementation, Figure 11 As shown, the issuing module 1003 includes:
[0277] The sending unit 1032 is configured to send a resource issuing instruction to the terminal logged in by the user identifier, where the resource issuing instruction carries a sub-resource package corresponding to the user identifier.
[0278] In another possible implementation, Figure 11 As shown, the issuing module 1003 includes:
[0279] A generating unit 1031 is configured to generate a distribution identifier corresponding to the user identifier according to the user identifier and the resource link;
[0280] The issuing unit 1033 is configured to issue a sub-resource package to the user ID corresponding to the resource package in response to not finding an issuing identifier corresponding to the user ID in the database. The database is configured to store issuing identifiers corresponding to user IDs of resources in issued resource links.
[0281] In another possible implementation, Figure 11 As shown, the device also includes:
[0282] The sending module 1006 is configured to send an issuance completion notification to the user ID in response to finding the issuance ID corresponding to the user ID in the database. The issuance completion notification is used to prompt the user ID that the resource in the resource link has been obtained.
[0283] In another possible implementation, Figure 11 As shown, the device includes:
[0284] The receiving module 1001 is further configured to receive a resource creation request, which carries the total number of sub-resource packages and the total number of resources;
[0285] A generating module 1007 is used to generate a resource link according to a resource creation request;
[0286] Generation module 1007 is also used to generate multiple resource packages based on the total number of sub-resource packages and the total number of resources. The target resource parameters of each resource package include the number of sub-resource packages and the number of resources. The sum of the number of sub-resource packages corresponding to multiple resource packages is equal to the total number of sub-resource packages, and the sum of the number of resources corresponding to multiple resource packages is equal to the total number of resources.
[0287] In another possible implementation, Figure 11 As shown, the device also includes:
[0288] The first setting module 1008 is configured to set the state of the allocated resource package to a locked state.
[0289] In another possible implementation, Figure 11 As shown, the device also includes:
[0290] The second setting module 1009 is used to set the state of the resource package to an unlocked state.
[0291] In another possible implementation, Figure 11 As shown, the first allocation module 1002 includes:
[0292] The allocating unit 1021 is configured to allocate a resource package in an unlocked state to at least one user identifier from among the multiple resource packages corresponding to the resource link.
[0293] In another possible implementation, Figure 11As shown, the first allocation module 1002 includes:
[0294] The allocating unit 1021 is configured to allocate a resource package to at least one user identifier from a plurality of resource packages corresponding to the resource link in response to the resource link being verified successfully.
[0295] In another possible implementation, Figure 11 As shown, the device also includes:
[0296] The determination module 1010 is configured to determine that the resource link verification is successful in response to the current time point belonging to the valid time period corresponding to the resource link; or
[0297] The determining module 1010 is further configured to determine that the resource link verification is successful in response to the resource link corresponding to an unreleased resource package.
[0298] In another possible implementation, Figure 11 As shown, the first allocation module 1002 includes:
[0299] The allocating unit 1021 is configured to allocate a resource package to the user identifier from multiple resource packages corresponding to the resource link in response to successful verification of the user identifier carried in any resource acquisition request.
[0300] In another possible implementation, Figure 11 As shown, the device also includes:
[0301] The determination module 1010 is configured to determine that the user identification is authenticated in response to the number of resources acquired by the user identification through the resource link being less than a first reference number; or
[0302] The determination module 1010 is further configured to determine that the user identification is successfully verified in response to the number of sub-resource packages obtained by the user identification through the resource link being less than a second reference number; or
[0303] The determination module 1010 is further configured to determine that the user identifier is successfully verified in response to the user identifier not being found in the database, and the database is configured to record the user identifier that has obtained the resource through the resource link.
[0304] In another possible implementation, each resource acquisition request carries the resource link published in the live broadcast room and the viewer user identifier requesting to acquire the resource corresponding to the resource link;
[0305] like Figure 11 As shown, the issuing module 1003 includes:
[0306] The sending unit 1032 is used to send a resource distribution instruction to the terminal logged in by the viewer user ID. The resource distribution instruction carries the sub-resource package corresponding to the viewer user ID. The terminal is used to display the sub-resource package in the live broadcast interface of the live broadcast room.
[0307] In another possible implementation, the resource link is an item link;
[0308] like Figure 11 As shown, the issuing module 1003 includes:
[0309] The sending unit 1032 is configured to send an item distribution instruction to the terminal logged in by the user identifier. The item distribution instruction carries a sub-item package corresponding to the user identifier, and the sub-item package includes items.
[0310] It should be noted that the resource dispensing apparatus provided in the above embodiment is merely an example of the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be distributed among different functional modules as needed, i.e., the internal structure of the server can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the resource dispensing apparatus provided in the above embodiment and the resource dispensing method embodiment are conceptually identical. The specific implementation process is detailed in the method embodiment and will not be further elaborated here.
[0311] An embodiment of the present application further provides a computer device, which includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the resource issuance method of the above embodiment.
[0312] Optionally, the computer device is provided as a terminal. Figure 12 A structural block diagram of a terminal 1200 provided by an exemplary embodiment of the present application is shown.
[0313] The terminal 1200 includes a processor 1201 and a memory 1202 .
[0314] The processor 1201 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1201 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0315] Memory 1202 may include one or more computer-readable storage media, which may be non-transitory. Memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in memory 1202 is used to store at least one program code, which is executed by processor 1201 to implement the resource allocation method provided in the method embodiment of the present application.
[0316] In some embodiments, terminal 1200 may optionally include a peripheral device interface 1203 and at least one peripheral device. Processor 1201, memory 1202, and peripheral device interface 1203 may be connected via a bus or signal lines. Each peripheral device may be connected to peripheral device interface 1203 via a bus, signal lines, or circuit boards. Specifically, the peripheral device may include at least one of a radio frequency circuit 1204, a display screen 1205, a camera assembly 1206, an audio circuit 1207, and a power supply 1209.
[0317] The peripheral device interface 1203 can be used to connect at least one I / O (Input / Output)-related peripheral device to the processor 1201 and the memory 1202. In some embodiments, the processor 1201, the memory 1202, and the peripheral device interface 1203 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1201, the memory 1202, and the peripheral device interface 1203 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0318] The RF circuit 1204 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1204 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1204 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the RF circuit 1204 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The RF circuit 1204 can communicate with other terminals via at least one wireless communication protocol. Such wireless communication protocols include, but are not limited to, the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1204 may also include circuitry related to Near Field Communication (NFC), although this application does not limit this.
[0319] The display screen 1205 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1205 is a touch screen display, the display screen 1205 also has the ability to collect touch signals on the surface or above the surface of the display screen 1205. The touch signal can be input as a control signal to the processor 1201 for processing. At this time, the display screen 1205 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, there can be one display screen 1205, which is set on the front panel of the terminal 1200; in other embodiments, there can be at least two display screens 1205, which are respectively set on different surfaces of the terminal 1200 or in a folding design; in other embodiments, the display screen 1205 can be a flexible display screen, which is set on the curved surface or folding surface of the terminal 1200. Even more, the display screen 1205 can be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 1205 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0320] The camera assembly 1206 is used to capture images or videos. Optionally, the camera assembly 1206 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 1206 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. The dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0321] The audio circuit 1207 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals that are input into the processor 1201 for processing, or input into the RF circuit 1204 to achieve voice communication. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, each located in different parts of the terminal 1200. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert electrical signals from the processor 1201 or the RF circuit 1204 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for purposes such as distance measurement. In some embodiments, the audio circuit 1207 may also include a headphone jack.
[0322] Power supply 1209 is used to power various components in terminal 1200. Power supply 1209 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1209 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0323] In some embodiments, the terminal 1200 further includes one or more sensors 1210 , including but not limited to: an acceleration sensor 1211 , a gyroscope sensor 1212 , a pressure sensor 1213 , an optical sensor 1215 , and a proximity sensor 1216 .
[0324] The accelerometer 1211 can detect the magnitude of acceleration along the three coordinate axes of the coordinate system established by the terminal 1200. For example, the accelerometer 1211 can be used to detect the components of gravity acceleration along the three coordinate axes. The processor 1201 can control the display screen 1205 to display the user interface in a landscape or portrait view based on the gravity acceleration signal collected by the accelerometer 1211. The accelerometer 1211 can also be used to collect game or user motion data.
[0325] The gyroscope sensor 1212 can detect the orientation and rotation angle of the terminal 1200. It can work with the accelerometer 1211 to collect the user's 3D movements on the terminal 1200. Based on the data collected by the gyroscope sensor 1212, the processor 1201 can implement the following functions: motion sensing (for example, changing the UI based on the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0326] The pressure sensor 1213 can be located on the side frame of the terminal 1200 and / or below the display screen 1205. When the pressure sensor 1213 is located on the side frame of the terminal 1200, it can detect the user's grip signal on the terminal 1200. The processor 1201 then performs left-hand or right-hand recognition or shortcut operations based on the grip signal collected by the pressure sensor 1213. When the pressure sensor 1213 is located below the display screen 1205, the processor 1201 controls the operable controls on the UI interface based on the user's pressure operation on the display screen 1205. Operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0327] Optical sensor 1215 is used to detect ambient light intensity. In one embodiment, processor 1201 can control the display brightness of display screen 1205 based on the ambient light intensity detected by optical sensor 1215. Specifically, when the ambient light intensity is high, the display brightness of display screen 1205 is increased; when the ambient light intensity is low, the display brightness of display screen 1205 is decreased. In another embodiment, processor 1201 can also dynamically adjust the shooting parameters of camera assembly 1206 based on the ambient light intensity detected by optical sensor 1215.
[0328] Proximity sensor 1216, also known as a distance sensor, is provided on the front panel of terminal 1200. Proximity sensor 1216 is used to detect the distance between the user and the front of terminal 1200. In one embodiment, when proximity sensor 1216 detects that the distance between the user and the front of terminal 1200 is gradually decreasing, processor 1201 controls display screen 1205 to switch from the screen-on state to the screen-off state. When proximity sensor 1216 detects that the distance between the user and the front of terminal 1200 is gradually increasing, processor 1201 controls display screen 1205 to switch from the screen-off state to the screen-on state.
[0329] Those skilled in the art will understand that Figure 12 The structure shown in the figure does not constitute a limitation on the terminal 1200, and the terminal 1200 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0330] Optionally, the computer device is provided as a server. Figure 131 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 1300 may vary significantly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 1301 and one or more memories 1302. The memories 1302 store at least one program code, which is loaded and executed by the processor 1301 to implement the methods provided in the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be described in detail here.
[0331] The server 1300 may be used to execute the steps executed by the server in the above-mentioned resource distribution method.
[0332] An embodiment of the present application further provides a computer-readable storage medium, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to implement the operations performed in the resource distribution method of the above embodiment.
[0333] The present application also provides a computer program product or computer program, which includes computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to implement the operations performed in the resource provisioning method of the above embodiment.
[0334] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0335] The above description is only an optional embodiment of the embodiment of the present application and is not intended to limit the embodiment of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the embodiment of the present application should be included in the scope of protection of the present application.
Claims
1. A resource distribution method, characterized in that: The method comprises: Receive a resource creation request, the resource creation request carrying the total number of sub-resource packages and the total number of resources; Generate a resource link according to the resource creation request; generating, based on the total number of sub-resource packages and the total number of resources, multiple resource packages corresponding to the resource link, wherein the target resource parameters of each resource package include the number of sub-resource packages and the number of resources, the sum of the number of sub-resource packages corresponding to the multiple resource packages equals the total number of sub-resource packages, and the sum of the number of resources corresponding to the multiple resource packages equals the total number of resources; Receive at least one resource acquisition request, each resource acquisition request carrying the resource link and a user identifier requesting to acquire the resource corresponding to the resource link; Allocating a resource bundle in an unlocked state to at least one user identifier from a plurality of resource bundles corresponding to the resource link, setting the state of the allocated resource bundle to a locked state, wherein the resource bundle in the locked state is used to generate a sub-resource bundle for only one user identifier at a time; According to the target resource parameters of the allocated resource package, a sub-resource package is generated for the user identifier corresponding to the allocated resource package, the state of the allocated resource package is set to the unlocked state, and the sub-resource package is issued to the user identifier corresponding to the allocated resource package.
2. The method according to claim 1, characterized in that The target resource parameter includes the amount of remaining resources, and generating a sub-resource package for a user identifier corresponding to the allocated resource package according to the target resource parameter of the allocated resource package includes: According to the remaining resource quantity, a sub-resource package is generated for the user identifier corresponding to the allocated resource package, so that the resource quantity corresponding to the sub-resource package is not greater than the remaining resource quantity.
3. The method according to claim 2, characterized in that The target resource parameter also includes the number of remaining sub-resource packages; generating a sub-resource package for the user identifier corresponding to the allocated resource package based on the number of remaining resources includes: In response to the number of remaining sub-resource packages being greater than 1, generating a sub-resource package for the user identifier according to the number of remaining resources, the number of resources corresponding to the sub-resource package being less than the number of remaining resources; In response to the number of remaining sub-resource packages being equal to 1, a sub-resource package is generated for the user identifier according to the number of remaining resources, and the number of resources corresponding to the sub-resource package is equal to the number of remaining resources.
4. The method according to any one of claims 1 to 3, characterized in that The issuing of the sub-resource package to the user identifier corresponding to the allocated resource package includes: Generate a distribution identifier corresponding to the user identifier according to the user identifier and the resource link; In response to not finding the issuance identifier corresponding to the user identifier in the database, the sub-resource package is issued to the user identifier corresponding to the allocated resource package, and the database is used to store the issuance identifier corresponding to the user identifier that has issued the resource in the resource link.
5. The method according to claim 4, characterized in that After generating a distribution identifier corresponding to the user identifier based on the user identifier and the resource link, the method further includes: In response to finding the issuance identifier corresponding to the user identifier in the database, an issuance completion notification is sent to the user identifier, where the issuance completion notification is used to prompt the user identifier that the resource in the resource link has been obtained.
6. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In response to the resource link being verified successfully, a resource bundle is allocated to the at least one user identifier from a plurality of resource bundles corresponding to the resource link.
7. The method according to claim 6, characterized in that Before allocating a resource bundle to the at least one user identifier from a plurality of resource bundles corresponding to the resource link in response to the resource link being verified, the method further includes: In response to the current time point belonging to the valid time period corresponding to the resource link, determining that the resource link verification is passed; or, In response to the resource link corresponding to an unreleased resource package, it is determined that the resource link has passed verification.
8. The method according to any one of claims 1 to 3, characterized in that The method further comprises: For any resource acquisition request, in response to successful verification of the user identifier carried in the resource acquisition request, a resource package is allocated to the user identifier from a plurality of resource packages corresponding to the resource link.
9. The method according to claim 8, characterized in that Before allocating a resource bundle to the user identifier from a plurality of resource bundles corresponding to the resource link in response to the successful verification of the user identifier carried in the resource acquisition request, the method further includes: In response to the number of resources acquired by the user identifier through the resource link being less than a first reference number, determining that the user identifier is authenticated; or, In response to the number of sub-resource packages acquired by the user identifier through the resource link being less than a second reference number, determining that the user identifier is authenticated; or In response to not finding the user identifier in the database, it is determined that the user identifier is authenticated, and the database is used to record the user identifier that has obtained the resource through the resource link.
10. The method according to any one of claims 1 to 3, characterized in that Each resource acquisition request carries the resource link published in the live broadcast room and the viewer user ID requesting to obtain the resource corresponding to the resource link; The issuing of the sub-resource package to the user identifier corresponding to the allocated resource package includes: A resource distribution instruction is sent to the terminal logged in by the viewer user ID, where the resource distribution instruction carries the sub-resource package corresponding to the viewer user ID, and the terminal is used to display the sub-resource package in the live broadcast interface of the live broadcast room.
11. The method according to any one of claims 1 to 3, characterized in that The resource link is an item link; The issuing of the sub-resource package to the user identifier corresponding to the allocated resource package includes: An item distribution instruction is sent to the terminal logged in by the user identifier, wherein the item distribution instruction carries a sub-item package corresponding to the user identifier, and the sub-item package includes items.
12. The method according to claim 1, characterized in that The target resource parameter includes the number of remaining sub-resource packages; after allocating a resource package in an unlocked state to at least one user identifier from the multiple resource packages corresponding to the resource link, the method further includes: In response to the number of remaining sub-resource packages in the target resource parameter of the allocated resource package being 0, another resource package is reallocated to the user identifier corresponding to the allocated resource package from the multiple resource packages corresponding to the resource link.
13. The method according to claim 1, wherein The target resource parameters include the number of remaining sub-resource packages and the amount of remaining resources; after generating a sub-resource package for the user identifier corresponding to the allocated resource package based on the target resource parameters of the allocated resource package, the method further includes: The number of remaining sub-resource packages corresponding to the allocated resource package is reduced by 1, and the number of remaining resources corresponding to the allocated resource package is reduced by the number of resources corresponding to the sub-resource package.
14. The method according to claim 1, wherein The target resource parameters include the number of remaining sub-resource packages and the unit resource quantity, where the unit resource quantity indicates the resource quantity corresponding to each sub-resource package in the resource package. After generating a sub-resource package for the user identifier corresponding to the allocated resource package based on the target resource parameters of the allocated resource package, the method further includes: The number of remaining sub-resource packages in the target resource parameter of the allocated resource package is reduced by 1.
15. The method according to claim 1, wherein The issuing of the sub-resource package to the user identifier corresponding to the allocated resource package includes: A resource distribution instruction is sent to the terminal logged in by the user identifier, where the resource distribution instruction carries the sub-resource package corresponding to the user identifier.
16. A resource distribution system, characterized in that: The system includes at least one terminal and a server; The server is configured to receive a resource creation request, the resource creation request carrying the total number of sub-resource packages and the total number of resources; generate a resource link based on the resource creation request; and generate multiple resource packages corresponding to the resource link based on the total number of sub-resource packages and the total number of resources, wherein the target resource parameters of each resource package include the number of sub-resource packages and the number of resources, the sum of the number of sub-resource packages corresponding to the multiple resource packages equals the total number of sub-resource packages, and the sum of the number of resources corresponding to the multiple resource packages equals the total number of resources; The terminal is configured to display the resource link and, in response to a triggering operation on the resource link, send a resource acquisition request to the server, wherein the resource acquisition request carries the resource link and a logged-in user identifier; The server is further configured to receive at least one resource acquisition request, allocate a resource package in an unlocked state to at least one user identifier from a plurality of resource packages corresponding to the resource link, set the state of the allocated resource package to a locked state, use the resource package in the locked state to generate a sub-resource package for only one user identifier at a time, generate a sub-resource package for the user identifier corresponding to the allocated resource package based on a target resource parameter of the allocated resource package, set the state of the allocated resource package to the unlocked state, and issue the sub-resource package to the user identifier corresponding to the allocated resource package.
17. A resource distribution device, characterized in that: The device comprises: A receiving module, configured to receive a resource creation request, wherein the resource creation request carries the total number of sub-resource packages and the total number of resources; A generating module, configured to generate a resource link according to the resource creation request; The generation module is further configured to generate multiple resource packages corresponding to the resource link based on the total number of sub-resource packages and the total number of resources, wherein the target resource parameters of each resource package include the number of sub-resource packages and the number of resources, the sum of the number of sub-resource packages corresponding to the multiple resource packages equals the total number of sub-resource packages, and the sum of the number of resources corresponding to the multiple resource packages equals the total number of resources; The receiving module is further configured to receive at least one resource acquisition request, each resource acquisition request carrying the resource link and a user identifier requesting to acquire the resource corresponding to the resource link; The first distribution module includes a distribution unit; The allocating unit is configured to allocate a resource package in an unlocked state to at least one user identifier from the multiple resource packages corresponding to the resource link; A first setting module, configured to set the state of the allocated resource package to a locked state; a distribution module, configured to generate a sub-resource package for a user identifier corresponding to the allocated resource package according to target resource parameters of the allocated resource package; A second setting module, configured to set the state of the allocated resource package to the unlocked state; The issuing module is further configured to issue the sub-resource package to the user identifier corresponding to the allocated resource package.
18. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the operations performed in the resource distribution method according to any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed in the resource distribution method according to any one of claims 1 to 15.
20. A computer program product, characterized in that The computer program product includes computer program code, which is stored in a computer-readable storage medium. The processor of a computer device reads the computer program code from the computer-readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the resource issuance method according to any one of claims 1 to 15.
Citation Information
Patent Citations
Resource transfer method and device, red packet sending method and device
CN107833029A
Resource allocation method and device
CN111093281A