CN109600414B - Resource allocation method, device, equipment and storage medium - Google Patents

Resource allocation method, device, equipment and storage medium Download PDF

Info

Publication number
CN109600414B
CN109600414B CN201810918119.5A CN201810918119A CN109600414B CN 109600414 B CN109600414 B CN 109600414B CN 201810918119 A CN201810918119 A CN 201810918119A CN 109600414 B CN109600414 B CN 109600414B
Authority
CN
China
Prior art keywords
resources
resource
allocated
type
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810918119.5A
Other languages
Chinese (zh)
Other versions
CN109600414A (en
Inventor
马红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Beijing Volcano Engine Technology Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201810918119.5A priority Critical patent/CN109600414B/en
Publication of CN109600414A publication Critical patent/CN109600414A/en
Application granted granted Critical
Publication of CN109600414B publication Critical patent/CN109600414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Signal Processing (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure discloses a resource allocation method, a device, equipment and a storage medium. Wherein, the method comprises the following steps: acquiring a resource acquisition request of a user; determining resources to be allocated matched with the resource acquisition request according to allocated resources corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; and if so, providing the resources to be allocated to the user. The embodiment of the disclosure solves the problems of low fairness and universality of the prior art in the allocation of the competitive resources, and can allocate the competitive resources to the users according to the allocated resources of the users and the allocation parameters in the request time of the resource acquisition request, thereby increasing the reference factors in the allocation of the competitive resources, optimizing the allocation mode of the prior competitive resources, and improving the fairness in the allocation of the competitive resources.

Description

Resource allocation method, device, equipment and storage medium
Technical Field
The present disclosure relates to resource management technologies, and in particular, to a method, an apparatus, a device, and a storage medium for resource allocation.
Background
With the continuous development of computer technology, various application programs (APP) are emerging to meet the service requirements of people in different fields. Many applications may allocate or provide various network resources to users, such as network storage space or various virtual items (e.g., game items or virtual currency, etc.).
Generally, network resources are mainly classified into two types, network resources that need to be acquired by contention (also referred to as contention resources), and network resources that can be acquired only by request without contention (also referred to as non-contention resources). The prior art is mainly based on the actual allocable amount of the contention resource when allocating the contention resource.
In the process of implementing the invention, the inventor finds that the prior art has the following defects: the existing method for allocating the competitive resources according to the actual allocable amount of the competitive resources only considers the allocable amount of the resources and does not refer to other factors to allocate the competitive resources, so that the fairness and the universality of the allocation of the competitive resources are low, and the user experience is poor.
Disclosure of Invention
The present disclosure provides a resource allocation method, device, apparatus and storage medium, so as to optimize the existing allocation manner of contention resources and improve the fairness of contention resource allocation.
In a first aspect, an embodiment of the present disclosure provides a resource allocation method, including:
acquiring a resource acquisition request of a user;
determining resources to be allocated matched with the resource acquisition request according to allocated resources corresponding to the user;
if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; the allocation parameters include: the number and/or proportion of allocations;
and if so, providing the resources to be allocated to the user.
In the foregoing scheme, optionally, the contention resource includes: a first type of resource, the first type of resource having a predetermined total amount of allocation;
if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, wherein the judging comprises the following steps:
if the resources to be allocated are first-class resources, determining the available allocation quantity of the first-class resources in the request time according to the request time of the resource acquisition request;
if the available allocation quantity is smaller than the actual allocated quantity of the first type of resource, it is determined that the first type of resource is allocated to the user, and the actual allocated quantity of the first type of resource is updated.
In the foregoing scheme, optionally, determining, according to the request time of the resource obtaining request, the available allocation number of the first type of resource in the request time includes:
inquiring a user traffic distribution map corresponding to the observation time length, acquiring user traffic from a starting point of the observation time length to the request time as real-time accumulated traffic, and acquiring total user traffic under the observation time length;
and determining the available allocation quantity of the first type of resources at the request time according to the preset available allocation total amount in the real-time interval associated with the request time, the real-time accumulated flow and the total user flow, wherein the interval length of the real-time interval is matched with the interval length of the observation time length.
In the foregoing solution, optionally, the determining the available allocation quantity of the first type of resource at the request time according to a preset available allocation total amount in a real-time interval associated with the request time, a real-time accumulated traffic and the total traffic of the users includes:
according to the formula: measure (t) ═ L (area (t)/Sum) determines the available allocation number measure (t) of the first type of resource at the requested time t;
wherein, L is the total available allocation amount in the preset real-time interval associated with the request time t, and area (t) is the real-time accumulated flow; sum is the total user traffic.
In the foregoing scheme, before querying a user traffic distribution map corresponding to the observation time, acquiring user traffic from a starting point of the observation time to the request time as a real-time accumulated traffic, and acquiring a total user traffic in the observation time, the method further includes:
and adjusting the value of the request time according to a set time unit, wherein the time unit is the minimum unit of the user traffic distribution diagram.
In the foregoing scheme, optionally, the contention resource includes: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value;
if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, wherein the judging comprises the following steps:
if the resources to be allocated are second-class resources, determining the expected class number of the second-class resources corresponding to the user according to the class number of the second-class resources included in the allocated resources of the user;
determining the number of expected users of the second type of resources with the expected type number at present according to the request time of the resource obtaining request, the expected type number and the proportion of the number of the users of the second type of resources with different type numbers in preset different time intervals to the total users;
and if the actual number of users of the second type of resources with the expected number of categories is smaller than the expected number of users, determining to allocate the second type of resources of the new category to the users.
In the foregoing solution, optionally, determining an expected number of categories of the second type of resources corresponding to the user according to the number of categories of the second type of resources included in the allocated resources of the user includes:
determining at least two expected category quantities of the second type of resources corresponding to the user according to the category quantities of the second type of resources included in the allocated resources of the user and the resource acquisition opportunity quantity of the user;
if the actual number of users currently having the expected number of categories of the second type of resources is smaller than the expected number of users, determining to assign the new category of the second type of resources to the users, including:
if the actual number of users of the second type of resources with at least two expected category quantities is smaller than the expected number of users corresponding to the at least two expected category quantities, selecting a target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy;
a second class of resources is determined that assigns the user a new class that matches the target number of expected classes.
In the foregoing solution, optionally, determining the number of expected users of the second type of resource currently expected to have the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and a ratio of the number of users of the second type of resource having different numbers of categories in preset different time intervals to the total users, includes:
according to the request time of the resource obtaining request, the expected category number and the proportion of the number of users of second type resources with different category numbers in different preset time intervals to the total users, obtaining the proportion of the number of users of the second type resources with the expected category number to the total users in a real-time interval in which the request time is positioned as a target reference proportion;
determining the proportion of the number of users of the expected category number of the second type resources in the request time to the total number of users as a real-time proportion according to the target reference proportion and the request time;
and determining the expected number of users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
In the foregoing scheme, optionally, determining, as a real-time ratio, a ratio of the number of users of the second type of resources of the expected number of categories to the total number of users at the request time according to the target reference ratio and the request time includes:
inquiring a user traffic distribution graph corresponding to the observation time length, acquiring user traffic from the starting point of the observation time length to the request time as real-time accumulated traffic, and acquiring total user traffic under the inquiry time length;
and according to the target reference proportion, accumulating the flow and the total flow of the users in real time, and determining the real-time proportion.
In the foregoing solution, optionally, determining the number of expected users of the second type of resource currently expected to have the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and a ratio of the number of users of the second type of resource having different numbers of categories in preset different time intervals to the total users, includes:
acquiring a real-time interval d corresponding to the request time t of the resource acquisition request;
according to the expected category number i, the real-time interval d and the proportion of the number of users of the second type resources with different category numbers in different preset time intervals to the total users, acquiring a CardsRate (d, i) proportion of the number of users of the second type resources with the expected category number i in the real-time interval d to the total users and a CardsRate (d-1, i) proportion of the number of users of the second type resources with the expected category number i in a previous historical time interval d-1 of the real-time interval d to the total users;
inquiring a user traffic distribution diagram corresponding to the observation time length, acquiring user traffic from a starting point of the observation time length to a request time t as a real-time accumulated traffic area (t), and acquiring total user traffic Sum under the observation time length;
determining the number A of expected users currently expected to have the expected number of the second type of resources in the expected type according to the following formula;
A=UserCount(d)*CardsRate(d,i)-userCount(d-1)*[CardsRate(d,i)-CardsRate(d-1,i)]*[1-Area(t)/Sum];
wherein, UserCount (d) is the number of users corresponding to the real-time interval d, and UserCount (d-1) is the number of users corresponding to the previous historical time interval d-1 of the real-time interval d.
In the foregoing solution, optionally, after determining, according to the allocated resource corresponding to the user, the resource to be allocated that matches the resource acquisition request, the method further includes:
and if the resource to be allocated is non-competitive resource, directly providing the resource to be allocated for the user.
In the foregoing scheme, optionally, the non-contention resource includes: a third type of resource or a fourth type of resource;
the third type of resources are resources which can be acquired only after the user acquires the first type of resources; the fourth type of resource is an allocated resource for the user.
In the foregoing scheme, optionally, determining, according to the allocated resource corresponding to the user, a resource to be allocated that is matched with the resource acquisition request, includes at least one of the following:
if the distributed resources corresponding to the user do not comprise the first type of resources, determining the resources to be distributed matched with the resource acquisition request as the first type of resources, wherein the first type of resources have a preset total distribution amount;
if the allocated resources corresponding to the user comprise the first type of resources and do not comprise the third type of resources, determining that the resources to be allocated matched with the resource acquisition request are the third type of resources, wherein the third type of resources are resources which can be acquired only after the first type of resources are acquired by the user;
if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is smaller than the category total number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are the second type of resources, wherein the second type of resources comprise at least two categories, and the proportion of the number of the users of the second type of resources with the set category number in the set time interval to the total users has an upper limit value;
and if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is equal to the total category number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are fourth type of resources, and the fourth type of resources are the allocated resources of the user.
In the foregoing solution, optionally, after determining whether to allocate the resource to be allocated to the user according to the resource allocation policy corresponding to the resource to be allocated, the method further includes:
if not, re-determining new resources to be allocated according to the resources to be allocated which are not successfully allocated at this time;
and returning to execute the operation of judging whether to allocate the resources to the user or not according to the available allocation parameters of the resources to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameters at the request time if the resources to be allocated are competitive resources, or directly providing the resources to be allocated for the user if the resources to be allocated are non-competitive resources until one resource is successfully allocated to the user.
In the foregoing scheme, optionally, the re-determining a new resource to be allocated according to the resource to be allocated that is not successfully allocated this time includes:
if the resources to be allocated which are not allocated successfully at this time are first-class resources and the class number of second-class resources included in the allocated resources corresponding to the user is smaller than the total class number corresponding to the second-class resources, re-determining the new resources to be allocated as the second-class resources;
if the resources to be allocated which are not allocated successfully at this time are the first type of resources and the category number of the second type of resources included in the allocated resources corresponding to the user is equal to the category total number corresponding to the second type of resources, re-determining the new resources to be allocated as fourth type of resources;
and if the resources to be allocated which are not successfully allocated at this time are the second type of resources, re-determining the new resources to be allocated as the fourth type of resources.
In a second aspect, an embodiment of the present disclosure further provides a resource allocation apparatus, including:
the request acquisition module is used for acquiring a resource acquisition request of a user;
the resource determining module is used for determining resources to be allocated matched with the resource acquiring request according to the allocated resources corresponding to the user;
the first resource judging module is used for judging whether to allocate the resources to be allocated to the user according to the available allocation parameters of the resources to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameters at the request time if the resources to be allocated are competitive resources; the allocation parameters include: the number and/or proportion of allocations;
and the first resource providing module is used for providing the resources to be allocated to the user if the resources to be allocated are available.
In the foregoing scheme, optionally, the contention resource includes: a first type of resource, the first type of resource having a predetermined total amount of allocation;
the first resource judgment module comprises:
the quantity determining submodule is used for determining the available distribution quantity of the first type of resources at the request time according to the request time of the resource acquisition request if the resources to be distributed are the first type of resources;
and the first allocation sub-module is used for determining to allocate the first type of resources to the users and updating the actual allocated quantity of the first type of resources if the available allocation quantity is smaller than the actual allocated quantity of the first type of resources.
In the foregoing solution, optionally, the number determining sub-module includes:
the flow chart query unit is used for querying a user flow distribution diagram corresponding to the observation time length, acquiring user flow from the starting point of the observation time length to the request time as real-time accumulated flow, and acquiring total user flow under the observation time length;
and the quantity determining unit is used for accumulating the flow and the total flow of the users in real time according to the preset available distribution total quantity in the real-time interval associated with the request time, and determining the available distribution quantity of the first type of resources in the request time, wherein the interval length of the real-time interval is matched with the interval length of the observation time length.
In the foregoing solution, optionally, the quantity determining unit includes:
a quantity determination subunit to: measure (t) ═ L (area (t)/Sum) determines the available allocation number measure (t) of the first type of resource at the requested time t;
wherein, L is the total available allocation amount in the preset real-time interval associated with the request time t, and area (t) is the real-time accumulated flow; sum is the total user traffic.
In the foregoing scheme, optionally, the method further includes:
and the numerical value adjusting unit is used for adjusting the numerical value of the request time according to a set time unit, wherein the time unit is the minimum unit of the user flow distribution diagram.
In the foregoing scheme, optionally, the contention resource includes: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value;
the first resource judgment module comprises:
the quantity determining submodule is used for determining the expected category quantity of the second type of resources corresponding to the user according to the category quantity of the second type of resources included in the allocated resources of the user if the resources to be allocated are the second type of resources;
the number-of-users determining submodule is used for determining the number of expected users of the second type of resources with the expected category number at present according to the request time of the resource obtaining request, the expected category number and the proportion of the number of the users of the second type of resources with different category numbers in preset different time intervals to the total users;
and the second distribution sub-module is used for determining to distribute the second type of resources of the new category to the user if the actual number of the users currently having the second type of resources of the expected category number is smaller than the expected number of the users.
In the foregoing solution, optionally, the number determining sub-module includes:
the quantity determining unit is used for determining at least two expected category quantities of the second type of resources corresponding to the user according to the category quantities of the second type of resources included in the allocated resources of the user and the resource obtaining opportunity quantity of the user;
the second allocation sub-module includes:
the category number selecting unit is used for selecting a target expected category number from the at least two expected category numbers meeting the conditions according to a set selecting strategy if the actual user number of the second type resources with the at least two expected category numbers is smaller than the expected user number corresponding to the at least two expected category numbers;
and the resource determining unit is used for determining to allocate the second type of resources of the new category matched with the target expected category number to the user.
In the foregoing solution, optionally, the number-of-people determination submodule includes:
a reference proportion obtaining unit, configured to obtain, according to the request time of the resource obtaining request, the expected category number, and a proportion of the number of users with the second type of resources of different category numbers in preset different time intervals to the total users, a proportion of the number of users with the second type of resources of the expected category number to the total users in a real-time interval in which the request time is located as a target reference proportion;
the real-time proportion obtaining unit is used for determining the proportion of the number of users of the second type resources of the expected type number in the request time to the total number of users as a real-time proportion according to the target reference proportion and the request time;
and the expected number determining unit is used for determining the number of the expected users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
In the foregoing scheme, optionally, the real-time proportion obtaining unit includes:
the flow chart query subunit is used for querying a user flow distribution graph corresponding to the observation time length, acquiring user flow from the starting point of the observation time length to the request time as real-time accumulated flow, and acquiring total user flow in the query time length;
and the proportion determining subunit is used for accumulating the flow and the total user flow in real time according to the target reference proportion and determining the real-time proportion.
In the foregoing solution, optionally, the number-of-people determination submodule includes:
a time interval obtaining unit, configured to obtain a real-time interval d corresponding to a request time t of the resource obtaining request;
a proportion obtaining unit, configured to obtain, according to the expected category number i, the real-time interval d, and a proportion of the number of users of the second type of resources with different category numbers in preset different time intervals to the total users, a proportion cardscan (d, i) of the number of users of the second type of resources with the expected category number i in the real-time interval d to the total users, and a proportion cardscan (d-1, i) of the number of users of the second type of resources with the expected category number i in a previous history time interval d-1 of the real-time interval d to the total users;
the traffic acquiring unit is used for inquiring a user traffic distribution map corresponding to the observation time length, acquiring user traffic from the starting point of the observation time length to the request time t as real-time accumulated traffic area (t), and acquiring total user traffic Sum under the observation time length;
the user number determining unit is used for determining the expected user number A of the second type of resources with the expected category number currently expected according to the following formula;
A=UserCount(d)*CardsRate(d,i)-userCount(d-1)*[CardsRate(d,i)-CardsRate(d-1,i)]*[1-Area(t)/Sum];
wherein, UserCount (d) is the number of users corresponding to the real-time interval d, and UserCount (d-1) is the number of users corresponding to the previous historical time interval d-1 of the real-time interval d.
In the foregoing scheme, optionally, the method further includes:
and the second resource providing module is used for directly providing the resource to be allocated to the user if the resource to be allocated is a non-competitive resource.
In the foregoing scheme, optionally, the non-contention resource includes: a third type of resource or a fourth type of resource;
the third type of resources are resources which can be acquired only after the user acquires the first type of resources; the fourth type of resource is an allocated resource for the user.
In the foregoing solution, optionally, the resource determining module includes at least one of:
the first-class determining submodule is used for determining that the resources to be allocated matched with the resource obtaining request are first-class resources if the allocated resources corresponding to the user do not comprise the first-class resources, and the first-class resources have a preset allocation total amount;
a third type determining sub-module, configured to determine, if it is determined that the allocated resources corresponding to the user include the first type of resources and do not include the third type of resources, that the resources to be allocated that are matched with the resource acquisition request are the third type of resources, where the third type of resources are resources that can be acquired only after the user acquires the first type of resources;
a second type determining submodule, configured to determine, if it is determined that the allocated resources corresponding to the user include a first type of resource and a third type of resource, and the category number of the second type of resource included in the allocated resources is smaller than the category total number corresponding to the second type of resource, that the resource to be allocated matched with the resource acquisition request is the second type of resource, where the second type of resource includes at least two categories, and a proportion of the number of users having the second type of resource with the set category number in a set time interval to the total users has an upper limit value;
and the fourth-class determining submodule is used for determining that the resource to be allocated matched with the resource acquiring request is a fourth-class resource and the fourth-class resource is the allocated resource of the user if the allocated resource corresponding to the user comprises the first-class resource and the third-class resource and the category number of the second-class resource included in the allocated resource is equal to the total category number corresponding to the second-class resource.
In the foregoing scheme, optionally, the method further includes:
a resource re-determination module, configured to re-determine a new resource to be allocated according to the resource to be allocated that is not successfully allocated this time if the resource to be allocated is not successfully allocated;
and the second resource judging module is used for returning and executing the operation of judging whether to allocate the resource to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time if the resource to be allocated is the competitive resource, or directly providing the resource to be allocated for the user if the resource to be allocated is the non-competitive resource until the resource is successfully allocated to the user.
In the foregoing solution, optionally, the resource re-determining module includes:
the first determining submodule is used for re-determining new resources to be allocated as the second type of resources if the resources to be allocated which are not successfully allocated at this time are the first type of resources and the category number of the second type of resources included in the allocated resources corresponding to the user is smaller than the category total number corresponding to the second type of resources;
a second determining submodule, configured to re-determine that a new resource to be allocated is a fourth resource if the resource to be allocated that is not successfully allocated this time is the first resource and the category number of the second resource included in the allocated resource corresponding to the user is equal to the total category number corresponding to the second resource;
and the third determining submodule is used for re-determining that the new resource to be allocated is the fourth type of resource if the resource to be allocated which is not successfully allocated at this time is the second type of resource.
In a third aspect, an embodiment of the present disclosure further provides an apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the resource allocation method according to the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource allocation method according to the disclosed embodiments.
The resource to be allocated matched with the resource acquisition request is determined according to the allocated resource corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user or not according to the available allocation parameter at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; if so, the resources to be allocated are provided for the users, the problems of low fairness and universality of competitive resource allocation and poor user experience in the prior art are solved, the competitive resources can be allocated to the users according to the allocated resources of the users and the allocation parameters in the request time of the resource acquisition request, the reference factors in the process of allocating the competitive resources are increased, the existing allocation mode of the competitive resources is optimized, the fairness of the competitive resource allocation is improved, and the user experience is improved.
Drawings
Fig. 1 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 3 is a user traffic distribution diagram corresponding to an observation duration according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating a variation rule of a ratio of the number of users of the second type of resource to the total users according to the embodiment of the present disclosure;
fig. 6 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 7 is a flowchart of a resource allocation method according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an apparatus provided in an embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the disclosure and are not limiting of the disclosure. It should be further noted that, for the convenience of description, only some of the structures relevant to the present disclosure are shown in the drawings, not all of them.
Fig. 1 is a flowchart of a resource allocation method according to an embodiment of the present disclosure, where the present embodiment is applicable to a case of resource allocation, the method may be executed by a resource allocation apparatus, the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be configured in a computer device, for example, a server, and used in cooperation with client software installed in a user terminal. As shown in fig. 1, the method may include the steps of:
step 101, acquiring a resource acquisition request of a user.
The resource obtaining request is information or an instruction which is input by a user and used for requesting to obtain the resource. Alternatively, the resource may be network storage space, electronic cards, virtual currency, or virtual gaming equipment, etc.
In one specific example, the acquisition right of the network storage space with a set size (for example, 100G) can be fixedly provided for the registered user. The user may request the server to acquire the corresponding network storage space (for example, 10G of network storage space may be acquired by one resource acquisition request) by sending a corresponding resource acquisition request, so as to store the user file online. Further, when the user has applied for a network storage space of a fixed size from the server, the user may further continue to send a resource acquisition request to the server, and at this time, the user needs to compete with other users to acquire a new network storage space, for example, the server adds 50 competing storage spaces of 10G each day, and the competing storage spaces are acquired by multi-user competition.
In another specific example, an online activity may be held, and a user may request a resource from a server by entering a resource acquisition request. When the activity is over, the user is awarded a prize based on the user's acquisition of the electronic card or virtual gaming apparatus. For example, a total of 14 different categories of electronic cards are provided, and during an activity, a user may obtain an electronic card by entering a resource acquisition request. At the end of the campaign, the user who has collected 14 electronic cards is awarded a prize.
In another specific example, a limited version of virtual gaming equipment or a set total amount of virtual currency may be issued. The virtual game equipment or the virtual currency requires a user to perform certain operations (e.g., completing an online issued task, etc.) before triggering transmission of a resource acquisition request contention acquisition.
And 102, determining resources to be allocated matched with the resource acquisition request according to the allocated resources corresponding to the user.
And inquiring the allocated resources corresponding to the user based on the resource acquisition request of the user. And determining the resources to be allocated matched with the resource acquisition request according to the allocated resources corresponding to the user. For example, the electronic cards that the user has collected are queried, and the electronic cards that need to be dealt to the user are determined based on the electronic cards that the user has collected.
103, if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time; the allocation parameters include: the number of dispenses and/or the proportion of dispenses.
The contention resource may be a resource for controlling the resource acquisition progress in the whole resource acquisition period (for example, one month or 2 months, etc.), for example, in an online activity of a set duration, the contention resource is allocated outwards only in a set time period, and then the activity progress of the whole online activity may be controlled by the contention resource.
Or, the contention resource may be a resource that the user cannot guarantee to be acquired in one resource acquisition request.
After determining that the resource to be allocated matched with the resource acquisition request is a contention resource according to the allocated resource corresponding to the user, it is necessary to determine whether to allocate the contention resource to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time.
The available allocation parameter may be an available allocation amount of the resource to be allocated set according to the traffic distribution of the user. The actually allocated allocation parameter is an actually allocated quantity corresponding to the resource to be allocated in the request time. And if the available allocation quantity corresponding to the resources to be allocated in the request time is smaller than the actual allocated quantity, determining to allocate the resources to be allocated to the user, and updating the actual allocated quantity of the resources to be allocated.
The available allocation parameter may be a ratio of the number of users with different types of number of resources to be allocated to the total users in different preset time intervals. The actual allocated allocation parameter is the actual number of users currently having the expected number of categories of resources to be allocated. And determining the number of the expected users currently expecting the resources to be distributed with expected category number according to the proportion of the number of the users with the resources to be distributed with different category numbers in different preset time intervals to the total users. And if the actual number of the users who currently have the expected number of the categories of the resources to be allocated is smaller than the expected number of the users, determining to allocate the new category of the resources to be allocated to the users.
Alternatively, by predetermining the number of competing resources, the total number of users who can acquire the competing resources may be controlled, for example, the number of users who acquire rewards in an activity. Optionally, by limiting the number of the competitive resources that can be acquired by the user in the current time interval, the resource acquisition progress, for example, the activity process, may be controlled in the whole resource acquisition period.
The non-contention resource is a resource other than the contention resource among the resources actively provided. After determining that the resource to be allocated matched with the resource acquisition request is a non-competitive resource according to the allocated resource corresponding to the user, the unconditional acquisition resource can be directly allocated to the user.
And 104, if so, providing the resources to be allocated to the user.
After judging that the resources to be allocated can be allocated to the user according to the available allocation parameters of the resources to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameters at the request time, providing the resources to be allocated to the user, and correspondingly updating the allocated resources corresponding to the user.
In an optional implementation manner of this embodiment, if it is determined that the resource to be allocated may not be allocated to the user, the new resource to be allocated is determined again according to the resource to be allocated that is not successfully allocated this time, and then the operation of determining whether to allocate the resource to be allocated to the user according to a resource allocation policy corresponding to the resource to be allocated is performed in a return manner if the resource to be allocated is a contention resource until a resource is successfully allocated to the user.
In an optional implementation manner of this embodiment, if it is determined that the resource to be allocated may not be allocated to the user, response information of resource allocation failure may be fed back to the user, and no resource is allocated to the user.
In a specific example, if the resource obtaining request of the user is a request for obtaining a network storage space, it may first be determined, according to the size of the network storage space already allocated to the user, whether the network storage space currently allocated to the user is a contention resource (i.e., a contention storage space with a set capacity) that needs to compete with other users, if so, it is determined whether to allocate the contention storage space with the set capacity to the user according to an available allocation number of the contention storage space in a request time of the resource obtaining request (e.g., 50 contention storage spaces with 10G) and an actually allocated allocation number in the request time, and if so, the contention storage space is directly provided to the user.
In a specific example, if the resource acquisition request of the user is an acquisition request of virtual money, it may be first determined whether the virtual money currently allocated to the user is a competitive resource (that is, a set amount of competitive virtual money) that needs to compete with other users according to the amount of virtual money already allocated to the user, if so, it may be determined whether to allocate the set amount of competitive virtual money to the user according to an available allocation amount (for example, 10000 virtual money) of the competitive virtual money at the request time of the resource acquisition request and an actually allocated allocation amount at the request time, and if so, the set amount of competitive virtual money is directly provided to the user.
According to the technical scheme of the embodiment, the resources to be allocated, which are matched with the resource acquisition request, are determined according to the allocated resources corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; if so, the resources to be allocated are provided for the users, the problems of low fairness and universality of competitive resource allocation and poor user experience in the prior art are solved, the competitive resources can be allocated to the users according to the allocated resources of the users and the allocation parameters in the request time of the resource acquisition request, the reference factors in the process of allocating the competitive resources are increased, the existing allocation mode of the competitive resources is optimized, the fairness of the competitive resource allocation is improved, and the user experience is improved.
Fig. 2 is a flowchart of a resource allocation method provided in an embodiment of the present disclosure, where this embodiment may be combined with various alternatives in one or more of the foregoing embodiments, and in this embodiment, the contention resource may be: a first type of resource, the first type of resource having a predetermined total amount of allocation;
and if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, wherein the available allocation parameter may be:
if the resources to be allocated are first-class resources, determining the available allocation quantity of the first-class resources in the request time according to the request time of the resource acquisition request; if the available allocation quantity is smaller than the actual allocated quantity of the first type of resource, it is determined that the first type of resource is allocated to the user, and the actual allocated quantity of the first type of resource is updated.
As shown in fig. 2, the method may include the steps of:
step 201, acquiring a resource acquisition request of a user.
Step 202, determining the resource to be allocated matched with the resource acquisition request according to the allocated resource corresponding to the user.
Step 203, if the resource to be allocated is the first type of resource, determining the available allocation quantity of the first type of resource in the request time according to the request time of the resource acquisition request.
Wherein, the contention resource may include: a first type of resource, the first type of resource having a predetermined total amount of allocation. The user wants to obtain the campaign reward and must obtain the first type of resource. Alternatively, each user may only obtain the first type of resource once. The total number of users in the campaign who receive the reward is controlled by predetermining the number of resources of the first type. In one specific example, in a card-collecting activity in which the first type of resource must be held at one time, the total amount of allocation of the first type of resource is set to 100 ten thousand, which corresponds to the total number of users who can finally collect the cards.
Optionally, determining the available allocation quantity of the first type of resources in the request time according to the request time of the resource obtaining request may include: according to the total allocation amount of the first type of resources and the allocation validity period (for example, 7 days) corresponding to the first type of resources, the available allocation amount of the first type of resources in a time unit (for example, seconds, minutes or hours) within the allocation validity period is determined on average.
In a simple example, if the total allocation amount of the first type resources is 24 and the allocation period is 1 day, it may be determined that one more first type resource is released every hour, and the available allocation amount corresponding to the first type resource may be determined according to the request time of the resource acquisition request.
Optionally, determining the available allocation quantity of the first type of resources in the request time according to the request time of the resource obtaining request may include: inquiring a user traffic distribution map corresponding to the observation time length, acquiring user traffic from a starting point of the observation time length to the request time as real-time accumulated traffic, and acquiring total user traffic under the observation time length; and determining the available allocation quantity of the first type of resources at the request time according to the preset available allocation total amount in the real-time interval associated with the request time, the real-time accumulated flow and the total user flow, wherein the interval length of the real-time interval is matched with the interval length of the observation time length.
The user flow distribution map is drawn according to the number of the users participating in the activity detected by the service interface. The observation duration is a preset duration (for example, one day), and can be set according to the service requirement. Fig. 3 is a user traffic distribution diagram corresponding to an observation duration according to an embodiment of the present disclosure. As shown in fig. 3, the observation period is 86400 seconds from 0 to 24 points. The start point of the observation period is the 1 st second. The horizontal axis of the user traffic profile is time. The vertical axis of the user traffic profile is the number of users participating in the activity. And acquiring the user traffic from the starting point of the observation time to the request time, namely adding the number of the users participating in the activity corresponding to the 1 st second to the request time to obtain the real-time accumulated traffic. And acquiring the total user flow under the observation time, namely adding the number of the users participating in the activity from the 1 st second to the 86400 th second to obtain the total user flow.
Optionally, the determining the available allocation quantity of the first type of resource at the request time according to the preset available allocation total amount at the real-time interval associated with the request time, the real-time accumulated traffic and the total traffic of the users includes: according to the formula: measure (t) ═ L (area (t)/Sum) determines the available allocation number measure (t) of the first type of resource at the requested time t; wherein, L is the total available allocation amount in the preset real-time interval associated with the request time t, and area (t) is the real-time accumulated flow; sum is the total user traffic.
Wherein the total amount of available allocations of the first type of resource at each real-time interval during the activity is predetermined before the activity starts. The interval length of the real-time interval is matched with the interval length of the observation duration. For example, the activity is 3 days. The observation period was 86400 seconds from 0 to 24. Dividing the activity time into 3 real-time intervals according to the observation duration: day 1, day 2 and day 3. The total amount of available allocation for the first type of resource on day 1 is 50. The total amount of available allocation corresponding to the first type of resource on day 2 is 100. The total amount of available allocation for the first type of resource on day 3 is 150. And acquiring the available distribution total amount in a preset real-time interval associated with the request time according to the request time of the resource acquisition request. For example, the request time is 28800 seconds of the active 2 nd day, and the total available allocation amount L in the real-time interval associated with the request time is 100 corresponding to the first type of resource on the 2 nd day.
Optionally, before querying a user traffic distribution map corresponding to the observation duration, acquiring user traffic from a starting point of the observation duration to the request time as a real-time accumulated traffic, and acquiring a total user traffic under the observation duration, the method further includes: and adjusting the value of the request time according to a set time unit, wherein the time unit is the minimum unit of the user traffic distribution diagram.
Wherein the value of the acquired request time may not be an order of magnitude greater than the minimum unit of the user traffic profile. For example, the request time is obtained as a value in milliseconds, and the minimum unit of the user traffic profile is seconds. The numerical unit of the request time is adjusted to the time unit of the user flow distribution diagram, so that the determination is facilitated.
Step 204, if the available allocation quantity is smaller than the actual allocated quantity of the first type of resource, determining to allocate the first type of resource to the user, and updating the actual allocated quantity of the first type of resource.
The actual allocated amount of the first type resource is the amount of the first type resource currently allocated to the user, and is updated each time the first type resource is allocated, for example, the actual allocated amount of the first type resource is increased by 1 each time the first type resource is allocated.
After the available allocation quantity of the first type of resources at the request time is determined, the actual allocated quantity of the first type of resources at the request time is obtained, and the available allocation quantity is compared with the actual allocated quantity of the first type of resources. If the available allocation quantity of the first type of resources at the request time is smaller than the actual allocated quantity of the first type of resources, determining to allocate the first type of resources to the user, and updating the actual allocated quantity of the first type of resources; determining not to allocate the first type of resource to the user if the available allocation amount of the first type of resource at the requested time is equal to the actual allocated amount of the first type of resource.
And step 205, if yes, providing the resources to be allocated to the user.
According to the technical scheme of the embodiment, when the contention resources may include the first type of resources with the predetermined total allocation amount, the available allocation amount of the first type of resources in the request time is determined according to the request time of the resource acquisition request; if the available allocation quantity is smaller than the actual allocated quantity of the first type of resources, the first type of resources are determined to be allocated to the user, the actual allocated quantity of the first type of resources is updated, the resource allocation quantity can be dynamically adjusted based on the user flow, the user can be guaranteed to compete fairly, and the user experience is improved.
Fig. 4 is a flowchart of a resource allocation method provided in an embodiment of the present disclosure, where this embodiment may be combined with various alternatives in one or more of the foregoing embodiments, and in this embodiment, the contention resource may be: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value;
and if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, wherein the judging can be that:
if the resources to be allocated are second-class resources, determining the expected class number of the second-class resources corresponding to the user according to the class number of the second-class resources included in the allocated resources of the user; determining the number of expected users of the second type of resources with the expected type number at present according to the request time of the resource obtaining request, the expected type number and the proportion of the number of the users of the second type of resources with different type numbers in preset different time intervals to the total users; and if the actual number of users of the second type of resources with the expected number of categories is smaller than the expected number of users, determining to allocate the second type of resources of the new category to the users.
As shown in fig. 4, the method may include the steps of:
step 401, obtaining a resource obtaining request of a user.
Step 402, determining the resource to be allocated matched with the resource acquisition request according to the allocated resource corresponding to the user.
Step 403, if the resource to be allocated is a second type of resource, determining an expected number of types of the second type of resource corresponding to the user according to the number of types of the second type of resource included in the allocated resource of the user.
Wherein, the contention resource may include: and a second type of resource. The second type of resources comprises at least two categories, wherein the proportion of the number of the users of the second type of resources with the set category number in the set time interval to the total users has an upper limit value. The upper limit value is a value preset according to the activity progress. For example, there may be 12 different categories of electronic cards in the second category of resources. The proportion of the number of the users of the electronic cards with the set category number in the set time interval to the total number of the users has an upper limit value. For example, on day 1 of the campaign, 40% of the participating users are allowed to hold 5 different categories of electronic cards, and 10% of the users are allowed to hold 10 different categories of electronic cards.
And if the resources to be allocated are second-class resources, determining the expected class number of the second-class resources corresponding to the user according to the class number of the second-class resources included in the allocated resources of the user. For example, if the number of categories of the second type of resources included in the allocated resources of the user is 5, it is determined that the expected number of categories of the second type of resources corresponding to the user is 6.
Step 404, determining the expected number of users of the second type of resources with the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and the ratio of the number of users of the second type of resources with different numbers of categories in different preset time intervals to the total number of users.
And presetting the proportion of the number of the users with the second type resources with different types of numbers in different time intervals to the total users. According to the request time of the resource obtaining request, the expected category number, and the proportion of the number of the users of the second type resources with different category numbers in different preset time intervals to the total users, the proportion of the number of the users of the second type resources with the expected category number to the total users in the real-time interval corresponding to the request time and the current total user number are obtained, and the expected user number of the second type resources with the expected category number at present is determined. For example, if the proportion of the number of users of the second type of resource with the expected number of categories 6 on the 2 nd day corresponding to the request time to the total users is 50%, and the current total number of users is 100000, it is determined that the number of expected users of the second type of resource with the expected number of categories 6 currently expected is 50000.
Fig. 5 is a schematic diagram of a change rule of a ratio of the number of users of the second type of resource to the total users according to an embodiment of the present disclosure. Taking days as a unit, the x axis represents the proportion CardsRate (d, i) of the number of the users of the second type of resources corresponding to each day to the total users, the y axis represents the number of the people participating in the activity UserCount (d) corresponding to each day, and the area formula at any time is UserCount (d) × CardsRate (d, i). Assuming that d is 1 and i is 6, area 1 indicates the number of users with 6 valid cards on day 1, and area 1+ area 2+ area 3 indicates the number of users with 6 valid cards on day 2. The transition from day 1 to day 2 increased area 2+ area 3. The area 3 is gradually increased along with the increase of the number of people, so the change is smooth. The area 2 is changed at the moment of the change of the proportion along with the adjustment of the proportion.
Optionally, determining the number of the expected users of the second type of resources currently expected to have the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and the ratio of the number of the users of the second type of resources having different numbers of categories in different preset time intervals to the total users, includes:
acquiring a real-time interval d corresponding to the request time t of the resource acquisition request; according to the expected category number i, the real-time interval d and the proportion of the number of users of the second type resources with different category numbers in different preset time intervals to the total users, acquiring a CardsRate (d, i) proportion of the number of users of the second type resources with the expected category number i in the real-time interval d to the total users and a CardsRate (d-1, i) proportion of the number of users of the second type resources with the expected category number i in a previous historical time interval d-1 of the real-time interval d to the total users; inquiring a user traffic distribution diagram corresponding to the observation time length, acquiring user traffic from a starting point of the observation time length to a request time t as a real-time accumulated traffic area (t), and acquiring total user traffic Sum under the observation time length; determining the number A of expected users currently expected to have the second type of resources with the expected type number according to the following formula;
A=UserCount(d)*CardsRate(d,i)-userCount(d-1)*[CardsRate(d,i)-CardsRate(d-1,i)]*[1-Area(t)/Sum];
wherein, UserCount (d) is the number of users corresponding to the real-time interval d, and UserCount (d-1) is the number of users corresponding to the previous historical time interval d-1 of the real-time interval d.
UserCount (d) is the number of users from the beginning of the real-time interval d to the requested time t. And the userCount (d-1) is the number of the users corresponding to the previous historical time interval d-1.
And 405, if the actual number of the users who currently have the second type of resources with the expected number of the categories is smaller than the expected number of the users, determining to allocate the second type of resources with the new category to the users.
After the expected number of the users currently expected to have the second type of resources with the expected type number is determined, the actual number of the users currently expected to have the second type of resources with the expected type number at the request time is obtained, and the actual number of the users currently expected to have the second type of resources with the expected type number is compared with the expected number of the users. If the actual number of users who currently have the second type of resources with the expected number of categories is smaller than the expected number of users, determining to allocate the second type of resources of the new category to the users; if the available allocation amount of the first type of resource at the requested time is equal to the actual allocated amount of the first type of resource, it is determined that the user is not allocated the new category of the second type of resource.
And step 406, if yes, providing the resource to be allocated to the user.
In the technical solution of this embodiment, when the contention resource may include the second type of resource, where a ratio of the number of users having the second type of resource with the set category number to the total users in the set time interval has an upper limit value, an expected category number of the second type of resource corresponding to the user is determined according to the category number of the second type of resource included in the allocated resource of the user; determining the number of expected users of the second type of resources with the expected number of categories currently expected; if the actual number of the users who currently have the second type of resources with the expected number of the types is smaller than the expected number of the users, the second type of resources of the new type are determined to be allocated to the users, the resource allocation number can be dynamically adjusted based on the preset user proportion and the real-time total number of the users, and the activity process can be effectively controlled.
Fig. 6 is a flowchart of a resource allocation method provided in an embodiment of the present disclosure, where this embodiment may be combined with various alternatives in one or more of the foregoing embodiments, and in this embodiment, determining an expected number of categories of a second type of resource corresponding to a user according to a number of categories of the second type of resource included in an allocated resource of the user may be: determining at least two expected category quantities of the second type of resources corresponding to the user according to the category quantities of the second type of resources included in the allocated resources of the user and the resource acquisition opportunity quantity of the user; if the actual number of users currently having the expected number of categories of the second type of resources is less than the expected number of users, determining to assign a new category of the second type of resources to the users, comprising: if the actual number of users of the second type of resources with at least two expected category quantities is smaller than the expected number of users corresponding to the at least two expected category quantities, selecting a target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy; a second class of resources is determined that assigns the user a new class that matches the target number of expected classes.
And determining the number of expected users of the second type of resources with the expected category number at present according to the request time of the resource acquisition request, the expected category number, and the ratio of the number of users of the second type of resources with different category numbers in preset different time intervals to the total users, wherein the expected number of users of the second type of resources with the expected category number may be: according to the request time of the resource obtaining request, the expected category number and the proportion of the number of users of second type resources with different category numbers in different preset time intervals to the total users, obtaining the proportion of the number of users of the second type resources with the expected category number to the total users in a real-time interval in which the request time is positioned as a target reference proportion; determining the proportion of the number of users of the expected category number of the second type resources in the request time to the total number of users as a real-time proportion according to the target reference proportion and the request time; and determining the expected number of users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
As shown in fig. 6, the method may include the steps of:
step 501, acquiring a resource acquisition request of a user.
Step 502, determining the resource to be allocated matched with the resource acquisition request according to the allocated resource corresponding to the user.
Step 503, if the resource to be allocated is the second type resource, determining at least two expected types of the second type resource corresponding to the user according to the type number of the second type resource included in the allocated resource of the user and the resource acquisition opportunity number of the user.
The resource acquisition opportunity number is the number of resource acquisition opportunities owned by a preset user in the current time interval. For example, it may be preset that the user has 2 resource acquisition opportunities per day during the activity. The resource acquisition opportunity number is encapsulated in a resource acquisition request sent by a user, so that the server determines at least two expected category numbers of the second type of resources corresponding to the user according to the resource acquisition request.
If the resources to be allocated are second-class resources, determining at least two expected class quantities of the second-class resources corresponding to the user according to the class quantities of the second-class resources included in the allocated resources of the user and the resource acquisition opportunity quantities of the user. For example, the number of categories of the second type of resources included in the allocated resources of the user is 5, the number of resource acquisition opportunities of the user is 2, and two expected categories of the second type of resources corresponding to the user are determined: 6 and 7.
Step 504, according to the request time of the resource obtaining request, the expected category number, and the ratio of the number of users with the second type of resources of different category numbers in different preset time intervals to the total users, the ratio of the number of users with the second type of resources of the expected category number to the total users in the real-time interval in which the request time is located is obtained as the target reference ratio.
According to the request time and the expected category number of the resource acquisition request, in the proportion of the number of users of the second type resources with different category numbers in the preset different time intervals to the total users, the proportion of the number of users of the second type resources with the expected category number in the total users in the real-time interval in which the request time is located is inquired and acquired and used as the target reference proportion. And respectively determining to obtain target reference proportions corresponding to at least two expected category quantities.
And 505, determining the proportion of the number of the users of the second type resources of the expected type number in the request time to the total users as a real-time proportion according to the target reference proportion and the request time.
Wherein, the corresponding relation between the target reference proportion and the time interval in the real-time interval is established in advance. For example, the target reference proportion is equally divided according to the time interval in the real-time interval, and the ratio of the target reference proportion to the real-time interval is used as the reference proportion increase value. The current scaling value is equal to the product of the reference scaling value and the requested time. And adding the target reference proportion corresponding to the previous historical time interval of the real-time interval corresponding to the request time and the current proportion increase value to obtain the proportion of the number of the second-class resources of the expected class number in the total users at the request time, wherein the proportion is used as the real-time proportion. And respectively determining to obtain real-time proportions corresponding to at least two expected category quantities.
For example, the real-time interval is 86400 seconds from 0 to 24 points, and the target reference proportion is 10%. The time interval is 1 second and the request time is 1000 seconds, then the current scaling value is equal to 1/864 which is the product of the reference scaling value 10%/86400 times the request time of 1000 seconds. The target reference proportion corresponding to the previous historical time interval is 5%, and the proportion of the number of users of the expected category number of the second type resources in the request time to the total users is equal to 5% + 1/864.
And step 506, determining the number of expected users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
And the product of the total number of the real-time users corresponding to the request time and the real-time proportion is the expected number of the users. And respectively determining to obtain expected user number corresponding to at least two expected categories.
And 507, if the actual number of the users of the second resource with at least two expected category quantities is smaller than the expected number of the users corresponding to the at least two expected category quantities, selecting the target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy.
And respectively comparing the expected user population corresponding to the at least two expected category quantities with the actual user population of the second type of resources with the at least two expected category quantities. And if the actual number of the users of the second type of resources with at least two expected category quantities is smaller than the expected number of the users corresponding to the at least two expected category quantities, selecting the target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy. The selection policy may be set to randomly select one of the at least two expected category numbers as the target expected category number. The selection policy may also be set to select a maximum value or a minimum value from the expected number of categories, which is not limited in this embodiment.
If only one of the actual user number of the second-class resources with at least two expected category numbers is smaller than the expected user number corresponding to the at least two expected category numbers, selecting the expected category number corresponding to the expected user number with the actual user number smaller than the expected user number as the target expected category number; and if the actual number of users of the second type of resources with at least two expected category quantities is larger than or equal to the expected number of users corresponding to the at least two expected category quantities, determining that the second type of resources of the new category matched with the target expected category quantity are not allocated to the users.
Step 508, determining to assign the second type of resource of the new category matching the target expected number of categories to the user.
Wherein the second type of resource is determined that is assigned to the user a new category that matches the target expected number of categories. For example, if the number of categories of the second type of resources included in the allocated resources of the user is 5, and the number of the selected target expected categories is 7, it is determined that 2 new categories of second type of resources are allocated to the user.
And 509, if so, providing the resources to be allocated to the user.
According to the technical scheme of the embodiment, at least two expected category quantities of the second type of resources corresponding to the user are determined according to the preset resource obtaining opportunity quantity of the user; determining the proportion of the number of the second type resources of the expected type number to the total users at the request time as a real-time proportion according to the request time of the resource acquisition request, the expected type number and the proportion of the number of the users of the second type resources with different type numbers in different preset time intervals to the total users; determining the number of expected users according to the real-time proportion and the total number of the real-time users corresponding to the request time; when the actual number of users of the second type of resources with at least two expected category quantities is smaller than the expected number of users corresponding to the at least two expected category quantities, selecting a target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy; the second type of resources of the new category matched with the target expected category number are determined to be allocated to the users, the resource allocation number can be dynamically adjusted based on the resource acquisition opportunity number of the users, the real-time user population number and the preset user proportion, and the activity process can be effectively controlled.
Fig. 7 is a flowchart of a resource allocation method provided in an embodiment of the present disclosure, and this embodiment may be combined with various alternatives in one or more embodiments described above. As shown in fig. 7, the method may include the steps of:
step 601, acquiring a resource acquisition request of a user.
Step 602, determining the resource to be allocated matched with the resource acquisition request according to the allocated resource corresponding to the user.
Step 603, judging the resource type of the resource to be allocated, and if the resource to be allocated is a competitive resource, executing S604; if the resource to be allocated is a non-contention resource, S605 is executed.
Step 604, judging whether to allocate the resource to be allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time, if so, executing step 606; otherwise, S607 is executed.
Step 605, directly providing the resource to be allocated to the user.
Step 606, the resource to be allocated is provided to the user.
Step 607, according to the resource to be allocated which is not allocated successfully this time, re-determining a new resource to be allocated, and returning to execute S603.
After determining the resource to be allocated matched with the resource acquisition request according to the allocated resource corresponding to the user, the method further comprises the following steps: and if the resource to be allocated is non-competitive resource, directly providing the resource to be allocated for the user.
Optionally, the non-contention resource includes: a third type of resource or a fourth type of resource; the third type of resources are resources which can be acquired only after the user acquires the first type of resources; the fourth type of resource is an allocated resource for the user.
If the user acquires the first type of resources, the third type of resources can be allocated to the user; and if the user does not acquire the first type of resources, refusing to allocate the third type of resources to the user. Optionally, the fourth type of resource is a resource other than the first type of resource in the allocated resources of the user.
Optionally, determining, according to the allocated resource corresponding to the user, a resource to be allocated that is matched with the resource acquisition request, where the resource to be allocated includes at least one of the following:
and if the distributed resources corresponding to the user do not comprise the first type of resources, determining the resources to be distributed matched with the resource acquisition request as the first type of resources, wherein the first type of resources have a preset total distribution amount.
And if the allocated resources corresponding to the user comprise the first type of resources and do not comprise the third type of resources, determining that the resources to be allocated matched with the resource acquisition request are the third type of resources, wherein the third type of resources are resources which can be acquired only after the first type of resources are acquired by the user.
And if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is smaller than the category total number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are the second type of resources, wherein the second type of resources comprise at least two categories, and the proportion of the number of the users of the second type of resources with the set category number in the set time interval to the total users has an upper limit value.
And if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is equal to the total category number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are fourth type of resources, and the fourth type of resources are the allocated resources of the user.
The first type of resource, the second type of resource, the third type of resource and the fourth type of resource are resources set according to activity requirements. For example, in a card-collecting activity, there are a total of 14 electronic cards of different categories, one of which is selected as a first type of resource, one of which is selected as a third type of resource, and the remaining 12 of which are selected as a second type of resource. The fourth type of resource is cards except the first type of resource in the electronic cards acquired by the user.
Optionally, re-determining a new resource to be allocated according to the resource to be allocated that is not successfully allocated this time includes: if the resources to be allocated which are not allocated successfully at this time are first-class resources and the class number of second-class resources included in the allocated resources corresponding to the user is smaller than the total class number corresponding to the second-class resources, re-determining the new resources to be allocated as the second-class resources; if the resources to be allocated which are not allocated successfully at this time are the first type of resources and the category number of the second type of resources included in the allocated resources corresponding to the user is equal to the category total number corresponding to the second type of resources, re-determining the new resources to be allocated as fourth type of resources; and if the resources to be allocated which are not successfully allocated at this time are the second type of resources, re-determining the new resources to be allocated as the fourth type of resources.
According to the technical scheme of the embodiment, the new resource to be allocated is determined again according to the resource to be allocated which is not successfully allocated at this time, and if the resource to be allocated is a competitive resource, the operation of judging whether the resource to be allocated is allocated to the user or not is carried out according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time, or if the resource to be allocated is a non-competitive resource, the resource to be allocated is directly provided for the user until the resource is successfully allocated to the user, and the resource allocation type and the resource allocation quantity can be dynamically adjusted according to the preset resource type and the resource allocation strategy.
Fig. 8 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present disclosure, which is applicable to resource allocation. The apparatus can be implemented in software and/or hardware, and the apparatus can be configured in a computer device. As shown in fig. 8, the apparatus may include:
a request obtaining module 701, a resource determining module 702, a first resource judging module 703 and a first resource providing module 704.
The request obtaining module 701 is configured to obtain a resource obtaining request of a user; a resource determining module 702, configured to determine, according to the allocated resource corresponding to the user, a resource to be allocated that matches the resource obtaining request; a first resource determining module 703, configured to determine, if the resource to be allocated is a contention resource, whether to allocate the resource to be allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time; the allocation parameters include: the number and/or proportion of allocations; a first resource providing module 704, configured to provide the resource to be allocated to the user if yes.
According to the technical scheme of the embodiment, the resources to be allocated, which are matched with the resource acquisition request, are determined according to the allocated resources corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; if so, the resources to be allocated are provided for the users, the problems of low fairness and universality of competitive resource allocation and poor user experience in the prior art are solved, the competitive resources can be allocated to the users according to the allocated resources of the users and the allocation parameters in the request time of the resource acquisition request, the reference factors in the process of allocating the competitive resources are increased, the existing allocation mode of the competitive resources is optimized, the fairness of the competitive resource allocation is improved, and the user experience is improved.
Optionally, on the basis of the above technical solution, the contention resource includes: a first type of resource, the first type of resource having a predetermined total amount of allocation;
the first resource judgment module 703 includes:
the quantity determining submodule is used for determining the available distribution quantity of the first type of resources at the request time according to the request time of the resource acquisition request if the resources to be distributed are the first type of resources;
and the first allocation sub-module is used for determining to allocate the first type of resources to the users and updating the actual allocated quantity of the first type of resources if the available allocation quantity is smaller than the actual allocated quantity of the first type of resources.
Optionally, on the basis of the above technical solution, the number determining sub-module includes:
the flow chart query unit is used for querying a user flow distribution diagram corresponding to the observation time length, acquiring user flow from the starting point of the observation time length to the request time as real-time accumulated flow, and acquiring total user flow under the observation time length;
and the quantity determining unit is used for accumulating the flow and the total flow of the users in real time according to the preset available distribution total quantity in the real-time interval associated with the request time, and determining the available distribution quantity of the first type of resources in the request time, wherein the interval length of the real-time interval is matched with the interval length of the observation time length.
Optionally, on the basis of the above technical solution, the quantity determining unit includes:
a quantity determination subunit to: measure (t) ═ L (area (t)/Sum) determines the available allocation number measure (t) of the first type of resource at the requested time t;
wherein, L is the total available allocation amount in the preset real-time interval associated with the request time t, and area (t) is the real-time accumulated flow; sum is the total user traffic.
Optionally, on the basis of the above technical solution, the method further includes:
and the numerical value adjusting unit is used for adjusting the numerical value of the request time according to a set time unit, wherein the time unit is the minimum unit of the user flow distribution diagram.
Optionally, on the basis of the above technical solution, the contention resource includes: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value;
the first resource judgment module 703 includes:
the quantity determining submodule is used for determining the expected category quantity of the second type of resources corresponding to the user according to the category quantity of the second type of resources included in the allocated resources of the user if the resources to be allocated are the second type of resources;
the number-of-users determining submodule is used for determining the number of expected users of the second type of resources with the expected category number at present according to the request time of the resource obtaining request, the expected category number and the proportion of the number of the users of the second type of resources with different category numbers in preset different time intervals to the total users;
and the second distribution sub-module is used for determining to distribute the second type of resources of the new category to the user if the actual number of the users currently having the second type of resources of the expected category number is smaller than the expected number of the users.
Optionally, on the basis of the above technical solution, the number determining sub-module includes:
the quantity determining unit is used for determining at least two expected category quantities of the second type of resources corresponding to the user according to the category quantities of the second type of resources included in the allocated resources of the user and the resource obtaining opportunity quantity of the user;
the second allocation sub-module includes:
the category number selecting unit is used for selecting a target expected category number from the at least two expected category numbers meeting the conditions according to a set selecting strategy if the actual user number of the second type resources with the at least two expected category numbers is smaller than the expected user number corresponding to the at least two expected category numbers;
and the resource determining unit is used for determining to allocate the second type of resources of the new category matched with the target expected category number to the user.
Optionally, on the basis of the above technical scheme, the number of people determining submodule includes:
a reference proportion obtaining unit, configured to obtain, according to the request time of the resource obtaining request, the expected category number, and a proportion of the number of users with the second type of resources of different category numbers in preset different time intervals to the total users, a proportion of the number of users with the second type of resources of the expected category number to the total users in a real-time interval in which the request time is located as a target reference proportion;
the real-time proportion obtaining unit is used for determining the proportion of the number of users of the second type resources of the expected type number in the request time to the total number of users as a real-time proportion according to the target reference proportion and the request time;
and the expected number determining unit is used for determining the number of the expected users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
Optionally, on the basis of the above technical solution, the real-time ratio obtaining unit includes:
the flow chart query subunit is used for querying a user flow distribution graph corresponding to the observation time length, acquiring user flow from the starting point of the observation time length to the request time as real-time accumulated flow, and acquiring total user flow in the query time length;
and the proportion determining subunit is used for accumulating the flow and the total user flow in real time according to the target reference proportion and determining the real-time proportion.
Optionally, on the basis of the above technical scheme, the number of people determining submodule includes:
a time interval obtaining unit, configured to obtain a real-time interval d corresponding to a request time t of the resource obtaining request;
a proportion obtaining unit, configured to obtain, according to the expected category number i, the real-time interval d, and a proportion of the number of users of the second type of resources with different category numbers in preset different time intervals to the total users, a proportion cardscan (d, i) of the number of users of the second type of resources with the expected category number i in the real-time interval d to the total users, and a proportion cardscan (d-1, i) of the number of users of the second type of resources with the expected category number i in a previous history time interval d-1 of the real-time interval d to the total users;
the traffic acquiring unit is used for inquiring a user traffic distribution map corresponding to the observation time length, acquiring user traffic from the starting point of the observation time length to the request time t as real-time accumulated traffic area (t), and acquiring total user traffic Sum under the observation time length;
the user number determining unit is used for determining the expected user number A of the second type of resources with the expected category number currently expected according to the following formula;
A=UserCount(d)*CardsRate(d,i)-userCount(d-1)*[CardsRate(d,i)-CardsRate(d-1,i)]*[1-Area(t)/Sum];
wherein, UserCount (d) is the number of users corresponding to the real-time interval d, and UserCount (d-1) is the number of users corresponding to the previous historical time interval d-1 of the real-time interval d.
Optionally, on the basis of the above technical solution, the method further includes:
and the second resource providing module is used for directly providing the resource to be allocated to the user if the resource to be allocated is a non-competitive resource.
Optionally, on the basis of the above technical solution, the non-contention resource includes: a third type of resource or a fourth type of resource;
the third type of resources are resources which can be acquired only after the user acquires the first type of resources; the fourth type of resource is an allocated resource for the user.
Optionally, on the basis of the above technical solution, the resource determining module includes at least one of:
the first-class determining submodule is used for determining that the resources to be allocated matched with the resource obtaining request are first-class resources if the allocated resources corresponding to the user do not comprise the first-class resources, and the first-class resources have a preset allocation total amount;
a third type determining sub-module, configured to determine, if it is determined that the allocated resources corresponding to the user include the first type of resources and do not include the third type of resources, that the resources to be allocated that are matched with the resource acquisition request are the third type of resources, where the third type of resources are resources that can be acquired only after the user acquires the first type of resources;
a second type determining submodule, configured to determine, if it is determined that the allocated resources corresponding to the user include a first type of resource and a third type of resource, and the category number of the second type of resource included in the allocated resources is smaller than the category total number corresponding to the second type of resource, that the resource to be allocated matched with the resource acquisition request is the second type of resource, where the second type of resource includes at least two categories, and a proportion of the number of users having the second type of resource with the set category number in a set time interval to the total users has an upper limit value;
and the fourth-class determining submodule is used for determining that the resource to be allocated matched with the resource acquiring request is a fourth-class resource and the fourth-class resource is the allocated resource of the user if the allocated resource corresponding to the user comprises the first-class resource and the third-class resource and the category number of the second-class resource included in the allocated resource is equal to the total category number corresponding to the second-class resource.
Optionally, on the basis of the above technical solution, the method further includes:
a resource re-determination module, configured to re-determine a new resource to be allocated according to the resource to be allocated that is not successfully allocated this time if the resource to be allocated is not successfully allocated;
and the second resource judging module is used for returning and executing the operation of judging whether to allocate the resource to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time if the resource to be allocated is the competitive resource, or directly providing the resource to be allocated for the user if the resource to be allocated is the non-competitive resource until the resource is successfully allocated to the user.
Optionally, on the basis of the above technical solution, the resource re-determining module includes:
the first determining submodule is used for re-determining new resources to be allocated as the second type of resources if the resources to be allocated which are not successfully allocated at this time are the first type of resources and the category number of the second type of resources included in the allocated resources corresponding to the user is smaller than the category total number corresponding to the second type of resources;
a second determining submodule, configured to re-determine that a new resource to be allocated is a fourth resource if the resource to be allocated that is not successfully allocated this time is the first resource and the category number of the second resource included in the allocated resource corresponding to the user is equal to the total category number corresponding to the second resource;
and the third determining submodule is used for re-determining that the new resource to be allocated is the fourth type of resource if the resource to be allocated which is not successfully allocated at this time is the second type of resource.
The resource allocation device provided by the embodiment of the disclosure can execute the resource allocation method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 9 is a schematic structural diagram of an apparatus provided in an embodiment of the present disclosure. FIG. 9 illustrates a block diagram of an exemplary device 812 suitable for use in implementing embodiments of the present disclosure. The device 812 shown in fig. 9 is only an example and should not bring any limitations to the functionality or scope of use of the embodiments of the present disclosure.
As shown in FIG. 9, device 812 may take the form of a general purpose computing device. Components of device 812 may include, but are not limited to: one or more processors or processing units 816, a system memory 828, and a bus 818 that couples various system components including the system memory 828 and the processing unit 816.
Bus 818 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 812 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by device 812 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 828 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)830 and/or cache memory 832. Device 812 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 834 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, often referred to as a "hard drive"). Although not shown in FIG. 9, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 818 by one or more data media interfaces. Memory 828 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the disclosure.
A program/utility 840 having a set (at least one) of program modules 842, which may be stored for example in memory 828, such program modules 842 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 842 generally perform the functions and/or methods of the embodiments described in this disclosure.
Device 812 may also communicate with one or more external devices 814 (e.g., keyboard, pointing device, display 824, etc.), with one or more devices that enable a user to interact with device 812, and/or with any devices (e.g., network card, modem, etc.) that enable device 812 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 822. Also, device 812 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet) through network adapter 820. As shown, the network adapter 820 communicates with the other modules of the device 812 over the bus 818. It should be appreciated that although not shown in FIG. 9, other hardware and/or software modules may be used in conjunction with device 812, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 816 executes various functional applications and data processing by executing programs stored in the system memory 828, for example, to implement the resource allocation method provided by the embodiments of the present disclosure. Namely, acquiring a resource acquisition request of a user; determining resources to be allocated matched with the resource acquisition request according to allocated resources corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; if so, providing the resources to be allocated to the user; the allocation parameters include: the number of dispenses and/or the proportion of dispenses.
The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource allocation method provided in the embodiment of the present disclosure, and the method specifically may include: acquiring a resource acquisition request of a user; determining resources to be allocated matched with the resource acquisition request according to allocated resources corresponding to the user; if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time; if so, providing the resources to be allocated to the user; the allocation parameters include: the number of dispenses and/or the proportion of dispenses.
The computer storage media of the disclosed embodiments may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, Ruby, Go, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present disclosure and the technical principles employed. Those skilled in the art will appreciate that the present disclosure is not limited to the particular embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the present disclosure. Therefore, although the present disclosure has been described in greater detail with reference to the above embodiments, the present disclosure is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present disclosure, the scope of which is determined by the scope of the appended claims.

Claims (16)

1. A method for resource allocation, comprising:
acquiring a resource acquisition request of a user;
determining resources to be allocated matched with the resource acquisition request according to allocated resources corresponding to the user;
if the resource to be allocated is a competitive resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time; the allocation parameters include: the number and/or proportion of allocations;
if so, providing the resources to be allocated to the user;
wherein the contention resources include: a first type of resource having a predetermined total amount of allocation; if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, including: if the resources to be allocated are first-class resources, determining the available allocation quantity of the first-class resources in the request time according to the request time of the resource acquisition request; if the available allocation quantity is smaller than the actual allocated quantity of the first type of resources, determining to allocate the first type of resources to the user, and updating the actual allocated quantity of the first type of resources;
or the contention resources include: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value; if the resource to be allocated is a contention resource, judging whether the resource to be allocated is allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time, including: if the resources to be allocated are second-class resources, determining the expected class number of the second-class resources corresponding to the user according to the class number of the second-class resources included in the allocated resources of the user; determining the number of the expected users of the second type of resources with the expected type number at present according to the request time of the resource obtaining request, the expected type number and the proportion of the number of the users of the second type of resources with different type numbers in preset different time intervals to the total users; determining to assign a new category of the second type of resource to the user if the actual population of users currently having the expected number of categories of the second type of resource is less than the expected population of users.
2. The method of claim 1, wherein determining the available allocation amount of the first type of resource at the request time according to the request time of the resource obtaining request comprises:
inquiring a user traffic distribution map corresponding to the observation time length, acquiring user traffic from the starting point of the observation time length to the request time as real-time accumulated traffic, and acquiring total user traffic under the observation time length;
and determining the available allocation quantity of the first type of resources in the request time according to the preset available allocation total quantity in a real-time interval associated with the request time, the real-time accumulated flow and the total user flow, wherein the interval length of the real-time interval is matched with the interval length of the observation time length.
3. The method according to claim 2, wherein determining the available allocation amount of the first type resource at the request time according to a preset available allocation total amount in a real-time interval associated with the request time, the real-time accumulated traffic and the total user traffic includes:
according to the formula: measure (t) ═ L (area (t)/Sum) determines the available allocation number measure (t) of the first type of resource at the requested time t;
wherein, L is a preset available allocation total amount in a real-time interval associated with the request time t, and area (t) is the real-time accumulated traffic; sum is the total flow of the users.
4. The method according to claim 2, wherein before querying the user traffic distribution map corresponding to the observation time duration, obtaining the user traffic from the start point of the observation time duration to the request time as the real-time accumulated traffic, and obtaining the total user traffic in the observation time duration, further comprising:
and adjusting the value of the request time according to a set time unit, wherein the time unit is the minimum unit of the user traffic distribution diagram.
5. The method of claim 1, wherein determining the expected number of classes of the second type of resources corresponding to the user according to the number of classes of the second type of resources included in the allocated resources of the user comprises:
determining at least two expected category quantities of the second type of resources corresponding to the user according to the category quantity of the second type of resources included in the allocated resources of the user and the resource acquisition opportunity quantity of the user;
determining to assign a new category of the second type of resource to the user if the actual population of users currently having the expected number of categories of the second type of resource is less than the expected population of users, comprising:
if the actual number of users currently having the second type of resources with the at least two expected category quantities is smaller than the expected number of users corresponding to the at least two expected category quantities, selecting a target expected category quantity from the at least two expected category quantities meeting the conditions according to a set selection strategy;
determining to assign the user the second class of resources of the new category that matches the target expected number of categories.
6. The method of claim 1, wherein determining the expected number of users currently expecting the second type of resource with the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and a ratio of the number of users with the second type of resource with different numbers of categories to the total number of users in different preset time intervals comprises:
according to the request time of the resource obtaining request, the expected category number and the proportion of the number of the users with the second type resources with different category numbers in different preset time intervals to the total users, obtaining the proportion of the number of the users with the second type resources with the expected category number to the total users in the real-time interval in which the request time is positioned as a target reference proportion;
determining the proportion of the number of the second type resources of the expected type number in the total users in the request time as a real-time proportion according to the target reference proportion and the request time;
and determining the number of the expected users according to the real-time proportion and the total number of the real-time users corresponding to the request time.
7. The method according to claim 6, wherein determining the proportion of the number of users of the expected category number of the second type resources to the total users at the request time as a real-time proportion according to the target reference proportion and the request time comprises:
inquiring a user traffic distribution diagram corresponding to the observation time length, acquiring user traffic from the starting point of the observation time length to the request time as real-time accumulated traffic, and acquiring total user traffic under the inquiry time length;
and determining the real-time ratio according to the target reference ratio, the real-time accumulated flow and the total user flow.
8. The method of claim 1, wherein determining the expected number of users currently expecting the second type of resource with the expected number of categories according to the request time of the resource obtaining request, the expected number of categories, and a ratio of the number of users with the second type of resource with different numbers of categories to the total number of users in different preset time intervals comprises:
acquiring a real-time interval d corresponding to the request time t of the resource acquisition request;
according to the expected category number i, the real-time interval d and the proportion of the number of users of the second type resources with different category numbers in different preset time intervals to the total users, acquiring a CardsRate (d, i) of the number of users of the second type resources with the expected category number i in the real-time interval d to the total users and a CardsRate (d-1, i) of the number of users of the second type resources with the expected category number i in a previous historical time interval d-1 of the real-time interval d to the total users;
inquiring a user traffic distribution diagram corresponding to the observation time length, acquiring user traffic from a starting point of the observation time length to the request time t as a real-time accumulated traffic area (t), and acquiring total user traffic Sum under the observation time length;
determining the number A of expected users currently expected to have the second type of resources with the expected type number according to the following formula;
A=UserCount(d)*CardsRate(d,i)-userCount(d-1)*[CardsRate(d,i)-CardsRate(d-1,i)]*[1-Area(t)/Sum];
wherein, UserCount (d) is the number of users corresponding to the real-time interval d, and UserCount (d-1) is the number of users corresponding to the previous historical time interval d-1 of the real-time interval d.
9. The method according to claim 1, after determining the resource to be allocated matching the resource acquisition request according to the allocated resource corresponding to the user, further comprising:
and if the resource to be allocated is a non-competitive resource, directly providing the resource to be allocated to the user.
10. The method of claim 9, wherein the non-contention resources comprise: a third type of resource or a fourth type of resource;
the third type of resource is a resource which can be acquired only after the user acquires the first type of resource; the fourth type of resource is an allocated resource of the user.
11. The method according to any one of claims 1-10, wherein determining the resource to be allocated that matches the resource acquisition request according to the allocated resource corresponding to the user comprises at least one of:
if the distributed resources corresponding to the user do not comprise the first type of resources, determining the resources to be distributed matched with the resource acquisition request as the first type of resources, wherein the first type of resources have a preset total distribution amount;
if the allocated resources corresponding to the user comprise the first type of resources and do not comprise the third type of resources, determining the resources to be allocated matched with the resource acquisition request as the third type of resources, wherein the third type of resources are resources which can be acquired only after the user acquires the first type of resources;
if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is smaller than the category total number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are the second type of resources, wherein the second type of resources comprise at least two categories, and the proportion of the number of users having the second type of resources with the set category number in a set time interval to the total users has an upper limit value;
and if the allocated resources corresponding to the user comprise the first type of resources and the third type of resources, and the category number of the second type of resources included in the allocated resources is equal to the total category number corresponding to the second type of resources, determining that the resources to be allocated matched with the resource acquisition request are fourth type of resources, and the fourth type of resources are the allocated resources of the user.
12. The method according to claim 11, after determining whether to allocate the resource to be allocated to the user according to a resource allocation policy corresponding to the resource to be allocated, further comprising:
if not, re-determining new resources to be allocated according to the resources to be allocated which are not successfully allocated at this time;
and returning to execute the operation of judging whether to allocate the resource to the user according to the available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and the actually allocated allocation parameter at the request time if the resource to be allocated is the competitive resource, or directly providing the resource to be allocated for the user if the resource to be allocated is the non-competitive resource until the resource is successfully allocated to the user.
13. The method of claim 12, wherein re-determining new resources to be allocated according to the resources to be allocated that are not successfully allocated this time comprises:
if the resources to be allocated which are not allocated successfully at this time are first-class resources and the class number of second-class resources included in the allocated resources corresponding to the user is less than the total class number corresponding to the second-class resources, re-determining new resources to be allocated as the second-class resources;
if the resources to be allocated which are not allocated successfully at this time are first-class resources and the class number of second-class resources included in the allocated resources corresponding to the user is equal to the total class number corresponding to the second-class resources, re-determining the new resources to be allocated as fourth-class resources;
and if the resources to be allocated which are not successfully allocated at this time are the second type of resources, re-determining the new resources to be allocated as the fourth type of resources.
14. A resource allocation apparatus, comprising:
the request acquisition module is used for acquiring a resource acquisition request of a user;
a resource determining module, configured to determine, according to the allocated resource corresponding to the user, a resource to be allocated that is matched with the resource obtaining request;
a first resource determining module, configured to determine, if the resource to be allocated is a contention resource, whether to allocate the resource to be allocated to the user according to an available allocation parameter of the resource to be allocated at the request time of the resource acquisition request and an actually allocated allocation parameter at the request time; the allocation parameters include: the number and/or proportion of allocations;
a first resource providing module, configured to provide the resource to be allocated to the user if the resource to be allocated is available;
wherein, competing the resource includes: a first type of resource, the first type of resource having a predetermined total amount of allocation; the first resource judgment module comprises: the quantity determining submodule is used for determining the available distribution quantity of the first type of resources at the request time according to the request time of the resource acquisition request if the resources to be distributed are the first type of resources; the first allocation sub-module is used for determining to allocate the first type of resources to the user and updating the actual allocated quantity of the first type of resources if the available allocation quantity is smaller than the actual allocated quantity of the first type of resources;
or the contention resources include: the second type of resources comprise at least two types, wherein the proportion of the number of users of the second type of resources with the set type number in a set time interval to the total users has an upper limit value; the first resource judgment module comprises: the quantity determining submodule is used for determining the expected category quantity of the second type of resources corresponding to the user according to the category quantity of the second type of resources included in the allocated resources of the user if the resources to be allocated are the second type of resources; the number-of-users determining submodule is used for determining the number of expected users of the second type of resources with the expected category number at present according to the request time of the resource obtaining request, the expected category number and the proportion of the number of the users of the second type of resources with different category numbers in preset different time intervals to the total users; and the second distribution sub-module is used for determining to distribute the second type of resources of the new category to the user if the actual number of the users currently having the second type of resources of the expected category number is smaller than the expected number of the users.
15. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the resource allocation method of any one of claims 1-13.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method for resource allocation according to any one of claims 1 to 13.
CN201810918119.5A 2018-08-13 2018-08-13 Resource allocation method, device, equipment and storage medium Active CN109600414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810918119.5A CN109600414B (en) 2018-08-13 2018-08-13 Resource allocation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810918119.5A CN109600414B (en) 2018-08-13 2018-08-13 Resource allocation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109600414A CN109600414A (en) 2019-04-09
CN109600414B true CN109600414B (en) 2020-04-10

Family

ID=65956518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810918119.5A Active CN109600414B (en) 2018-08-13 2018-08-13 Resource allocation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109600414B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113052514A (en) * 2021-05-21 2021-06-29 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112288206A (en) * 2020-02-18 2021-01-29 北京沃东天骏信息技术有限公司 Resource allocation method and device, computer storage medium and electronic equipment
CN112418654B (en) * 2020-11-19 2024-04-09 百度在线网络技术(北京)有限公司 Resource allocation method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729236A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Method for limiting resource using limit of cloud computing users
CN104079503A (en) * 2013-03-27 2014-10-01 华为技术有限公司 Method and device of distributing resources
CN107491351A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 A kind of resource allocation methods based on priority, device and equipment
CN108234581A (en) * 2016-12-22 2018-06-29 腾讯科技(深圳)有限公司 The dispatching method and server of a kind of resource

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9348648B2 (en) * 2012-09-12 2016-05-24 Salesforce.Com, Inc. Providing a routing framework for facilitating dynamic workload scheduling and routing of message queues for fair management of resources for application servers in an on-demand services environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104079503A (en) * 2013-03-27 2014-10-01 华为技术有限公司 Method and device of distributing resources
CN103729236A (en) * 2013-12-29 2014-04-16 国云科技股份有限公司 Method for limiting resource using limit of cloud computing users
CN107491351A (en) * 2016-06-13 2017-12-19 阿里巴巴集团控股有限公司 A kind of resource allocation methods based on priority, device and equipment
CN108234581A (en) * 2016-12-22 2018-06-29 腾讯科技(深圳)有限公司 The dispatching method and server of a kind of resource

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113052514A (en) * 2021-05-21 2021-06-29 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation
CN113052514B (en) * 2021-05-21 2021-10-29 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation

Also Published As

Publication number Publication date
CN109600414A (en) 2019-04-09

Similar Documents

Publication Publication Date Title
CN110727512B (en) Cluster resource scheduling method, device, equipment and storage medium
CN109600414B (en) Resource allocation method, device, equipment and storage medium
CN108604194B (en) Probabilistic adjustment
CN110673948B (en) Cloud game resource scheduling method, server and storage medium
CN110728429A (en) Case allocation method, case allocation device, case allocation medium and computer equipment
EP3561671A1 (en) Allocating workload
CN110636388A (en) Service request distribution method, system, electronic equipment and storage medium
CN114724694B (en) Medical resource processing method and device and readable storage medium
CN111681020A (en) Resource configuration method and device based on task event of relationship person and electronic equipment
CN114155026A (en) Resource allocation method, device, server and storage medium
CN111092814B (en) Service handling request message distribution method and equipment
CN110175830B (en) Transaction channel management method, device, server and storage medium
US20140156467A1 (en) Application/content bundling and monetization platform
US11552901B2 (en) Automated decision techniques for controlling resource access
CN109905333B (en) Media information processing method, device and storage medium
CN113765964A (en) Method and device for distributing services of distributed system
CN111343240A (en) Service request processing method and device, electronic equipment and storage medium
CN109842665B (en) Task processing method and device for task allocation server
CN111210256A (en) Resource allocation method and device, server and storage medium
CN110750350A (en) Large resource scheduling method, system, device and readable storage medium
CN112822306B (en) Proxy IP dynamic management method, device and computer readable storage medium
CN113129098A (en) Order allocation method and device
CN112785323A (en) Resource allocation method and device and electronic equipment
CN111427691A (en) Virtual resource allocation method, device, medium and electronic equipment
KR102486781B1 (en) Method and apparatus for providing counseling service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: Room B-0035, Floor 2, Building 3, Yard 30, Shixing Street, Shijingshan District, Shijingshan District, Beijing 100041

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230707

Address after: 1309, 13th Floor, Building 4, Zijin Digital Park, Haidian District, Beijing, 100080

Patentee after: Beijing volcano Engine Technology Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Douyin Vision Co.,Ltd.