CN111598405A - Resource allocation method and server - Google Patents

Resource allocation method and server Download PDF

Info

Publication number
CN111598405A
CN111598405A CN202010316904.0A CN202010316904A CN111598405A CN 111598405 A CN111598405 A CN 111598405A CN 202010316904 A CN202010316904 A CN 202010316904A CN 111598405 A CN111598405 A CN 111598405A
Authority
CN
China
Prior art keywords
allocated
resource
time
amount
target
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.)
Granted
Application number
CN202010316904.0A
Other languages
Chinese (zh)
Other versions
CN111598405B (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.)
Wuba Co Ltd
Original Assignee
Wuba 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 Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202010316904.0A priority Critical patent/CN111598405B/en
Publication of CN111598405A publication Critical patent/CN111598405A/en
Application granted granted Critical
Publication of CN111598405B publication Critical patent/CN111598405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06314Calendaring for a resource
    • 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
    • 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
    • G06Q20/0652Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash with decreasing value according to a parameter, e.g. time

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Accounting & Taxation (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Finance (AREA)
  • Game Theory and Decision Science (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application provides a resource allocation method and a server, wherein the method comprises the following steps: receiving a target resource allocation request sent by a terminal; determining a first time interval S between the starting time and the first time of a target resource allocation period, a second time interval L between the first time and the ending time of the target resource allocation period, the number C of allocated resources before the first time in the target resource allocation period and the remaining resource amount M to be allocated at the first time in the target resource allocation period, wherein the first time is the time when a target resource allocation request is received; determining a first amount of allocated resources F corresponding to a first time instant; wherein the content of the first and second substances,
Figure DDA0002459738960000011
and allocating the first allocated resources with the resource amount being the first allocated resource amount F to the target account corresponding to the terminal. Thus, the allocation is performed upon receipt of the target resource allocation requestResources are allocated, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of pretreatment resources is reduced.

Description

Resource allocation method and server
Technical Field
The present application relates to the field of communications technologies, and in particular, to a resource allocation method and a server.
Background
In order to attract more users or improve the activity of the users, various e-commerce platforms usually provide a certain amount of resources for the users to pick up, thereby attracting the users. The resource may be a memory space resource, a data processing capability resource, a traffic resource, or a virtual red packet, etc. Because the resource distribution process requires the user to send a request through the terminal device and interact with the server, when the number of the users is large, in order to avoid the server congestion caused by the simultaneous interaction of a large number of terminals and the server, the e-commerce platform generally attracts the users through a multi-round resource distribution mode.
However, in most scenarios, the number of users who pick up resources may be uncertain, and the resource issuer may want each user who participates in picking up resources to pick up a certain amount of resources. Therefore, the server is required to predict the number of users who may request to receive resources in each round through complicated preprocessing so as to determine the amount of resources allocated to each user in advance.
However, when the resources are issued to the users, the total resource amount and the resource issuing rounds of the resources are usually determined, and actually, how many users will receive the resources in each round, which cannot be accurately estimated in advance, so that in order to avoid the situation that the resource amount of some resources is too small and the resource amount of some resources is too large among different rounds, a server needs to prepare a plurality of different allocation modes in advance, and consume a large amount of pre-processed resources.
Disclosure of Invention
The application provides a resource allocation method and a server, and aims to solve the problem that in the prior art, in order to avoid the situation that the resource amount of some resources is too small and the resource amount of some resources is too large and unbalanced, a plurality of different allocation modes need to be prepared in advance by the server, and a large amount of preprocessed resources are consumed.
In a first aspect, the present invention provides a resource allocation method, applied to a server, the method including:
receiving a target resource allocation request sent by a terminal;
determining a first time interval S between the starting time and the first time of a target resource allocation cycle, a second time interval L between the first time and the ending time of the target resource allocation cycle, the number C of allocated resources before the first time in the target resource allocation cycle, and the remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, wherein the first time is the time when the target resource allocation request is received;
determining a first amount of allocated resources F corresponding to the first time instant; wherein,
Figure BDA0002459738940000011
Figure BDA0002459738940000021
and allocating the first allocated resources with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal.
Further, the method further comprises:
determining a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, wherein the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
Further, before the step of allocating the first allocated resource with the resource amount being the first allocated resource amount F to the target account corresponding to the terminal, the method further includes:
judging whether the first allocated resource quantity F is less than or equal to the remaining resource quantity M to be allocated;
and under the condition that the first allocated resource quantity F is judged to be less than or equal to the remaining resource quantity M to be allocated, executing the step of allocating the first allocated resource with the resource quantity being the first allocated resource quantity F to the target account corresponding to the terminal.
Further, the method further comprises:
and under the condition that the first allocated resource quantity F is judged to be larger than the remaining resource quantity M to be allocated, allocating a third allocated resource with the resource quantity being the remaining resource quantity M to be allocated to a target account corresponding to the terminal.
In a second aspect, the present invention further provides a server, including:
the receiving module is used for receiving a target resource allocation request sent by a terminal;
a first determining module, configured to determine a first time interval S between a starting time and a first time of a target resource allocation cycle, a second time interval L between the first time and an ending time of the target resource allocation cycle, a number C of resources allocated before the first time in the target resource allocation cycle, and a remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, where the first time is a time when the target resource allocation request is received;
a second determining module, configured to determine a first allocated resource amount F corresponding to the first time; wherein,
Figure BDA0002459738940000022
Figure BDA0002459738940000023
and the first allocation module is used for allocating the first allocated resources with the resource quantity being the first allocated resource quantity F to the target account corresponding to the terminal.
Further, the server further includes:
a third determining module, configured to determine a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, where the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
Further, the server further includes:
a judging module, configured to judge whether the first allocated resource amount F is less than or equal to the remaining resource amount to be allocated M;
and the execution module is configured to execute the step of allocating the first allocation resource with the resource amount being the first allocation resource amount F to the target account corresponding to the terminal when it is determined that the first allocation resource amount F is less than or equal to the remaining resource amount M to be allocated.
Further, the server further includes:
and the second allocating module is configured to allocate, to the target account corresponding to the terminal, a third allocated resource whose resource amount is the remaining resource amount to be allocated M when it is determined that the first allocated resource amount F is greater than the remaining resource amount to be allocated M.
In a third aspect, the present invention further provides an electronic device, including:
a memory for storing program instructions;
a processor, configured to call and execute the program instructions in the memory to implement the resource allocation method according to the first aspect.
In a fourth aspect, the present invention further provides a readable storage medium, in which a computer program is stored, and when the computer program is executed by at least one processor of a server, the server executes the resource allocation method according to the first aspect.
As can be seen from the foregoing technical solutions, in the resource allocation method and the server provided in the embodiments of the present invention, a target resource allocation request sent by a terminal is received; determining a first time interval S between a starting time and a first time of a target resource allocation period, a second time interval L between the first time and an ending time of the target resource allocation period, and the allocated resources before the first time in the target resource allocation periodThe number C and the amount M of the remaining resources to be allocated at the first moment in the target resource allocation period, wherein the first moment is the moment when the target resource allocation request is received; determining a first amount of allocated resources F corresponding to the first time instant; wherein,
Figure BDA0002459738940000031
Figure BDA0002459738940000032
and allocating the first allocated resources with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal. In this way, when the target resource allocation request is received, the first allocated resource amount F is determined, and the first allocated resource with the resource amount of the first allocated resource amount F is allocated to the target account corresponding to the terminal. Namely, resources are allocated when a target resource allocation request is received, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of preprocessing resources is reduced.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a resource allocation method according to the present invention;
FIG. 2 is a flow chart of another resource allocation method provided by the present invention;
FIG. 3 is a block diagram of a server provided by the present invention;
FIG. 4 is a block diagram of another server provided by the present invention;
FIG. 5 is a block diagram of another server provided by the present invention;
FIG. 6 is a block diagram of another server provided by the present invention;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to the present invention.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following examples do not represent all embodiments consistent with the present application. But merely as exemplifications of systems and methods consistent with certain aspects of the application, as recited in the claims.
Referring to fig. 1, fig. 1 is a flowchart of a resource allocation method provided by the present invention, which is applied to a server. As shown in fig. 1, the method comprises the following steps:
step 101, receiving a target resource allocation request sent by a terminal.
In step 101, the server may receive a target resource allocation request sent by the terminal.
Step 102, determining a first time interval S between a starting time and a first time of a target resource allocation cycle, a second time interval L between the first time and an ending time of the target resource allocation cycle, a number C of allocated resources before the first time in the target resource allocation cycle, and a remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, wherein the first time is a time when the target resource allocation request is received.
In step 102, a plurality of resource allocation periods may be determined. It should be noted that the resource may be a memory resource, a data processing capability resource, a traffic resource, a virtual red packet, or the like. In this embodiment, a virtual red packet is taken as an example of a resource. Assuming that the total amount of resources corresponding to the plurality of resource allocation cycles is MT, for example, assuming that the total amount of virtual red packets corresponding to the plurality of resource allocation cycles is MT equal to 10 ten thousand; the total duration time corresponding to the resource allocation periods is T-24 hours; the resource allocation periods are 10 resource allocation periods, that is, the virtual red packet turn is P-10 turns.
For example, the 10 resource allocation periods may be P1 ═ 0: 00-5: 00; p2 ═ 5: 00-9: 00; p3 ═ 9: 00-11: 30, of a nitrogen-containing gas; p4 ═ 11: 30-13: 00; p5 ═ 13: 00-14: 00; p6 ═ 14: 00-17: 00; p7 ═ 17: 00-19: 00; p8 ═ 19: 00-20: 30, of a nitrogen-containing gas; p9 ═ 20: 30-22: 00; p10 ═ 22: 00-24: 00. the total duration T of the 10 virtual red packet rounds P1-P10 is 24 hours.
It should be noted that the user traffic is different in different time periods. For example, around 8 pm, i.e. 20: about 00 is the user flow peak; and 2 in the morning: about 00 is the user traffic trough. For a time period belonging to a user traffic peak, the duration of the corresponding resource allocation period may be shorter; for time periods belonging to a user traffic trough, the duration of the corresponding resource allocation period may be longer. For example, as previously described, 20: around 00 is the peak of user traffic, so the corresponding resource allocation period P8 is 19: 00-20: 30 is short, one and a half hours; and 2 in the morning: around 00 is the user traffic trough, so the corresponding resource allocation period P1 is 0: 00-5: the duration of 00 is longer, 5 hours. The virtual red packet amount corresponding to each resource allocation cycle in the plurality of resource allocation cycles may be the same, for example, the virtual red packet amount corresponding to each resource allocation cycle may be MT/P10 ten thousand/10 1 ten thousand. In this way, the amount of virtual red packets within each resource allocation cycle can be evenly distributed.
A first time interval S between the starting time and the first time of the target resource allocation period, a second time interval L between the first time and the ending time of the target resource allocation period, the number C of resources allocated before the first time in the target resource allocation period, and the remaining amount M of resources to be allocated at the first time in the target resource allocation period may be determined. The first time is the time when the target resource allocation request is received. The target resource allocation period may be any one of a plurality of resource allocation periods, that is, the target resource allocation period may be any one of 10 resource allocation periods.
Step 103, determining a first allocated resource quantity F corresponding to the first time; wherein,
Figure BDA0002459738940000051
Figure BDA0002459738940000052
in step 103, a first amount F of allocated resources corresponding to a first time instant may be determined; wherein,
Figure BDA0002459738940000053
Figure BDA0002459738940000054
and N is the number of resources to be allocated after the first time in the target resource allocation period.
And 104, allocating the first allocated resource with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal.
In step 104, the first allocated resource with the resource amount being the first allocated resource amount F may be allocated to the target account corresponding to the terminal. Namely, the first virtual red envelope with the amount of the first virtual red envelope amount F can be distributed to the target account corresponding to the terminal.
It should be noted that, in the prior art, in order to avoid the situation that the resource amount of some resources is too small and the resource amount of some resources is too large among different rounds, a server needs to prepare a plurality of different allocation modes in advance, and a large amount of preprocessing resources are consumed.
In the application, when the target resource allocation request is received, the first allocated resource amount F is determined, and the first allocated resource with the resource amount of the first allocated resource amount F is allocated to the target account corresponding to the terminal. Namely, resources are allocated when a target resource allocation request is received, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of preprocessing resources is reduced.
As can be seen from the foregoing technical solutions, the resource allocation method provided in the embodiments of the present invention is applied to a server, and receives a target resource allocation request sent by a terminal; determining a first time interval S between a starting time and a first time of a target resource allocation period, the first timeA second duration interval L between the moment and the end moment of the target resource allocation cycle, the number C of allocated resources before the first moment in the target resource allocation cycle, and the remaining amount M of resources to be allocated at the first moment in the target resource allocation cycle, where the first moment is the moment when the target resource allocation request is received; determining a first amount of allocated resources F corresponding to the first time instant; wherein,
Figure BDA0002459738940000061
and allocating the first allocated resources with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal. In this way, when the target resource allocation request is received, the first allocated resource amount F is determined, and the first allocated resource with the resource amount of the first allocated resource amount F is allocated to the target account corresponding to the terminal. Namely, resources are allocated when a target resource allocation request is received, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of preprocessing resources is reduced.
Referring to fig. 2, fig. 2 is a flowchart of another resource allocation method provided by the present invention, which is applied to a server. As shown in fig. 2, the method comprises the following steps:
step 201, receiving a target resource allocation request sent by a terminal.
In step 201, the server may receive a target resource allocation request sent by the terminal.
Step 202, determining a first time interval S between a starting time and a first time of a target resource allocation cycle, a second time interval L between the first time and an ending time of the target resource allocation cycle, a number C of allocated resources before the first time in the target resource allocation cycle, and a remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, wherein the first time is a time when the target resource allocation request is received.
In step 202, a plurality of resource allocation periods may be determined. It should be noted that the resource may be a memory resource, a data processing capability resource, a traffic resource, a virtual red packet, or the like. In this embodiment, a virtual red packet is taken as an example of a resource. Assuming that the total amount of resources corresponding to the plurality of resource allocation cycles is MT, for example, assuming that the total amount of virtual red packets corresponding to the plurality of resource allocation cycles is MT equal to 10 ten thousand; the total duration time corresponding to the resource allocation periods is T-24 hours; the resource allocation periods are 10 resource allocation periods, that is, the virtual red packet turn is P-10 turns.
For example, the 10 resource allocation periods may be P1 ═ 0: 00-5: 00; p2 ═ 5: 00-9: 00; p3 ═ 9: 00-11: 30, of a nitrogen-containing gas; p4 ═ 11: 30-13: 00; p5 ═ 13: 00-14: 00; p6 ═ 14: 00-17: 00; p7 ═ 17: 00-19: 00; p8 ═ 19: 00-20: 30, of a nitrogen-containing gas; p9 ═ 20: 30-22: 00; p10 ═ 22: 00-24: 00. the total duration T of the 10 virtual red packet rounds P1-P10 is 24 hours.
It should be noted that the user traffic is different in different time periods. For example, around 8 pm, i.e. 20: about 00 is the user flow peak; and 2 in the morning: about 00 is the user traffic trough. For a time period belonging to a user traffic peak, the duration of the corresponding resource allocation period may be shorter; for time periods belonging to a user traffic trough, the duration of the corresponding resource allocation period may be longer. For example, as previously described, 20: around 00 is the peak of user traffic, so the corresponding resource allocation period P8 is 19: 00-20: 30 is short, one and a half hours; and 2 in the morning: around 00 is the user traffic trough, so the corresponding resource allocation period P1 is 0: 00-5: the duration of 00 is longer, 5 hours. The virtual red packet amount corresponding to each resource allocation cycle in the plurality of resource allocation cycles may be the same, for example, the virtual red packet amount corresponding to each resource allocation cycle may be MT/P10 ten thousand/10 1 ten thousand. In this way, the amount of virtual red packets within each resource allocation cycle can be evenly distributed.
A first time interval S between the starting time and the first time of the target resource allocation period, a second time interval L between the first time and the ending time of the target resource allocation period, the number C of resources allocated before the first time in the target resource allocation period, and the remaining amount M of resources to be allocated at the first time in the target resource allocation period may be determined. The first time is the time when the target resource allocation request is received. The target resource allocation period may be any one of a plurality of resource allocation periods, that is, the target resource allocation period may be any one of 10 resource allocation periods.
Step 203, determining a first allocated resource quantity F corresponding to the first time; wherein,
Figure BDA0002459738940000071
Figure BDA0002459738940000072
in step 203, a first amount of allocated resources F corresponding to a first time instant may be determined; wherein,
Figure BDA0002459738940000073
Figure BDA0002459738940000074
and N is the number of resources to be allocated after the first time in the target resource allocation period.
Optionally, the method further includes:
determining a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, wherein the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
A resource amount range R of the second allocated resource to be allocated within the target resource allocation period may also be determined. Wherein the second allocated resource to be allocated is the next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
min is presetThe target resource allocation period of (2) is set to the minimum resource amount corresponding to the target resource allocation period of (3). It should be noted that min may also be determined according to the remaining amount M of resources to be allocated at the first time in the target resource allocation period and the number N of resources to be allocated after the first time in the target resource allocation period. For example,
Figure BDA0002459738940000081
and 204, judging whether the first allocated resource quantity F is less than or equal to the remaining resource quantity M to be allocated.
In step 204, it may be determined whether the first allocated resource amount F is less than or equal to the remaining resource amount to be allocated M.
Step 205, when it is determined that the first allocated resource amount F is less than or equal to the remaining resource amount M to be allocated, executing the step of allocating the first allocated resource with the resource amount of the first allocated resource amount F to the target account corresponding to the terminal.
In step 205, in the case that the first allocated resource amount F is determined to be less than or equal to the remaining resource amount M to be allocated, the first allocated resource with the resource amount being the first allocated resource amount F may be allocated to the target account corresponding to the terminal.
And step 206, under the condition that the first allocated resource amount F is judged to be larger than the remaining resource amount M to be allocated, allocating a third allocated resource with the resource amount being the remaining resource amount M to a target account corresponding to the terminal.
In step 206, when it is determined that the first allocated resource amount F is greater than the remaining resource amount M to be allocated, a third allocated resource whose resource amount is the remaining resource amount M to be allocated may be allocated to the target account corresponding to the terminal.
As can be seen from the foregoing technical solutions, the resource allocation method provided in the embodiments of the present invention is applied to a server, and when a target resource allocation request is received, a first allocated resource amount F is determined, so that a first allocated resource whose resource amount is the first allocated resource amount F is allocated to a target account corresponding to a terminal. Further, it may be determined whether the first allocated resource amount F is less than or equal to the remaining resource amount M to be allocated. Under the condition that the first allocated resource quantity F is judged to be less than or equal to the remaining resource quantity M to be allocated, allocating the first allocated resource with the resource quantity of the first allocated resource quantity F to a target account corresponding to the terminal; and under the condition that the first allocated resource quantity F is judged to be larger than the remaining resource quantity M to be allocated, allocating the third allocated resource with the resource quantity being the remaining resource quantity M to the target account corresponding to the terminal. And resources are allocated when the target resource allocation request is received, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of preprocessing resources is reduced.
Referring to fig. 3, fig. 3 is a structural diagram of a server provided in the present invention. As shown in fig. 3, the server 300 comprises a receiving module 301, a first determining module 302, a second determining module 303 and a first allocating module 304, wherein:
a receiving module 301, configured to receive a target resource allocation request sent by a terminal;
a first determining module 302, configured to determine a first time interval S between a starting time of a target resource allocation period and a first time, a second time interval L between the first time and an ending time of the target resource allocation period, a number C of resources allocated before the first time in the target resource allocation period, and a remaining amount M of resources to be allocated at the first time in the target resource allocation period, where the first time is a time when the target resource allocation request is received;
a second determining module 303, configured to determine a first allocated resource amount F corresponding to the first time; wherein,
Figure BDA0002459738940000091
Figure BDA0002459738940000092
a first allocating module 304, configured to allocate the first allocated resource with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal.
Optionally, as shown in fig. 4, the server further includes:
a third determining module 305, configured to determine a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, where the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
Optionally, as shown in fig. 5, the server further includes:
a determining module 306, configured to determine whether the first allocated resource amount F is less than or equal to the remaining resource amount M to be allocated;
an executing module 307, configured to execute the step of allocating the first allocation resource with the resource amount being the first allocation resource amount F to the target account corresponding to the terminal when it is determined that the first allocation resource amount F is less than or equal to the remaining resource amount M to be allocated.
Optionally, as shown in fig. 6, the server further includes:
the second allocating module 308 is configured to, when it is determined that the first allocated resource amount F is greater than the remaining resource amount to be allocated M, allocate a third allocated resource whose resource amount is the remaining resource amount to be allocated M to a target account corresponding to the terminal.
The server 300 can implement each process implemented by the server in the method embodiments of fig. 1-2, and is not described herein again to avoid repetition. And the server 300 may determine the first allocated resource amount F when receiving the target resource allocation request, and then allocate the first allocated resource with the resource amount being the first allocated resource amount F to the target account corresponding to the terminal. Further, it may be determined whether the first allocated resource amount F is less than or equal to the remaining resource amount M to be allocated. Under the condition that the first allocated resource quantity F is judged to be less than or equal to the remaining resource quantity M to be allocated, allocating the first allocated resource with the resource quantity of the first allocated resource quantity F to a target account corresponding to the terminal; and under the condition that the first allocated resource quantity F is judged to be larger than the remaining resource quantity M to be allocated, allocating the third allocated resource with the resource quantity being the remaining resource quantity M to the target account corresponding to the terminal. And resources are allocated when the target resource allocation request is received, a plurality of different allocation modes do not need to be prepared in advance, and the consumption of preprocessing resources is reduced.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 7, the electronic device includes:
a memory 701 for storing program instructions;
the processor 702 is configured to call and execute the program instructions in the memory to implement the resource allocation method in the foregoing embodiments. Reference may be made in particular to the description in relation to the preceding embodiments.
In this embodiment, the processor 702 and the memory 701 may be connected by a bus or other means. The processor may be a general-purpose processor, such as a central processing unit, a digital signal processor, an application specific integrated circuit, or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk.
An embodiment of the present invention further provides a readable storage medium, including: the readable storage medium has stored therein a computer program which, when executed by at least one processor of a server, the server performs the resource allocation method described in the above embodiments.
The readable storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiments of the server, the electronic device and the readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to the description in the embodiments of the method.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.

Claims (10)

1. A resource allocation method is applied to a server, and is characterized in that the method comprises the following steps:
receiving a target resource allocation request sent by a terminal;
determining a first time interval S between the starting time and the first time of a target resource allocation cycle, a second time interval L between the first time and the ending time of the target resource allocation cycle, the number C of allocated resources before the first time in the target resource allocation cycle, and the remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, wherein the first time is the time when the target resource allocation request is received;
determining a first amount of allocated resources F corresponding to the first time instant; wherein,
Figure FDA0002459738930000011
Figure FDA0002459738930000012
and allocating the first allocated resources with the resource amount being the first allocated resource amount F to a target account corresponding to the terminal.
2. The method of claim 1, wherein the method further comprises:
determining a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, wherein the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
3. The method of claim 1, wherein before the step of allocating the first allocated resource with the resource amount being the first allocated resource amount F to the target account corresponding to the terminal, the method further comprises:
judging whether the first allocated resource quantity F is less than or equal to the remaining resource quantity M to be allocated;
and under the condition that the first allocated resource quantity F is judged to be less than or equal to the remaining resource quantity M to be allocated, executing the step of allocating the first allocated resource with the resource quantity being the first allocated resource quantity F to the target account corresponding to the terminal.
4. The method of claim 3, wherein the method further comprises:
and under the condition that the first allocated resource quantity F is judged to be larger than the remaining resource quantity M to be allocated, allocating a third allocated resource with the resource quantity being the remaining resource quantity M to be allocated to a target account corresponding to the terminal.
5. A server, comprising:
the receiving module is used for receiving a target resource allocation request sent by a terminal;
a first determining module, configured to determine a first time interval S between a starting time and a first time of a target resource allocation cycle, a second time interval L between the first time and an ending time of the target resource allocation cycle, a number C of resources allocated before the first time in the target resource allocation cycle, and a remaining amount M of resources to be allocated at the first time in the target resource allocation cycle, where the first time is a time when the target resource allocation request is received;
a second determining module, configured to determine a first allocated resource amount F corresponding to the first time; wherein,
Figure FDA0002459738930000013
Figure FDA0002459738930000014
Figure FDA0002459738930000015
and the first allocation module is used for allocating the first allocated resources with the resource quantity being the first allocated resource quantity F to the target account corresponding to the terminal.
6. The server of claim 5, wherein the server further comprises:
a third determining module, configured to determine a resource amount range R of a second allocated resource to be allocated in the target resource allocation period, where the second allocated resource to be allocated is a next resource to be allocated after the first allocated resource;
R=[min,2M/(C×L/S)-min]
and min is the minimum resource amount corresponding to the preset target resource allocation period.
7. The server of claim 5, wherein the server further comprises:
a judging module, configured to judge whether the first allocated resource amount F is less than or equal to the remaining resource amount to be allocated M;
and the execution module is configured to execute the step of allocating the first allocation resource with the resource amount being the first allocation resource amount F to the target account corresponding to the terminal when it is determined that the first allocation resource amount F is less than or equal to the remaining resource amount M to be allocated.
8. The server of claim 7, wherein the server further comprises:
and the second allocating module is configured to allocate, to the target account corresponding to the terminal, a third allocated resource whose resource amount is the remaining resource amount to be allocated M when it is determined that the first allocated resource amount F is greater than the remaining resource amount to be allocated M.
9. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing program instructions in the memory to implement the resource allocation method of any one of claims 1 to 4.
10. A readable storage medium, in which a computer program is stored, and when the computer program is executed by at least one processor of a server, the server performs the resource allocation method according to any one of claims 1 to 4.
CN202010316904.0A 2020-04-21 2020-04-21 Resource allocation method and server Active CN111598405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010316904.0A CN111598405B (en) 2020-04-21 2020-04-21 Resource allocation method and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010316904.0A CN111598405B (en) 2020-04-21 2020-04-21 Resource allocation method and server

Publications (2)

Publication Number Publication Date
CN111598405A true CN111598405A (en) 2020-08-28
CN111598405B CN111598405B (en) 2021-09-07

Family

ID=72185179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010316904.0A Active CN111598405B (en) 2020-04-21 2020-04-21 Resource allocation method and server

Country Status (1)

Country Link
CN (1) CN111598405B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113191546A (en) * 2021-04-29 2021-07-30 远光软件股份有限公司 Resource allocation prediction method, resource management device and storage medium
CN113473448A (en) * 2021-06-16 2021-10-01 北京三快在线科技有限公司 Business resource processing method, device, storage medium and equipment
CN115328666A (en) * 2022-10-14 2022-11-11 浪潮电子信息产业股份有限公司 Device scheduling method, system, electronic device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170357531A1 (en) * 2016-06-13 2017-12-14 Alibaba Group Holding Limited Priority-based resource allocation
CN108462999A (en) * 2018-01-10 2018-08-28 海信集团有限公司 A kind of method and apparatus carrying out resource allocation
CN108629611A (en) * 2017-03-24 2018-10-09 北京京东尚科信息技术有限公司 Method and apparatus for distributing resource

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170357531A1 (en) * 2016-06-13 2017-12-14 Alibaba Group Holding Limited Priority-based resource allocation
CN108629611A (en) * 2017-03-24 2018-10-09 北京京东尚科信息技术有限公司 Method and apparatus for distributing resource
CN108462999A (en) * 2018-01-10 2018-08-28 海信集团有限公司 A kind of method and apparatus carrying out resource allocation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NIKHIL R等: "Near Optimal Online Algorithms and Fast Approximation Algorithms for Resource Allocation Problems", 《JOURNAL OF THE ACM》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113191546A (en) * 2021-04-29 2021-07-30 远光软件股份有限公司 Resource allocation prediction method, resource management device and storage medium
CN113473448A (en) * 2021-06-16 2021-10-01 北京三快在线科技有限公司 Business resource processing method, device, storage medium and equipment
CN115328666A (en) * 2022-10-14 2022-11-11 浪潮电子信息产业股份有限公司 Device scheduling method, system, electronic device and computer readable storage medium
CN115328666B (en) * 2022-10-14 2023-07-14 浪潮电子信息产业股份有限公司 Device scheduling method, system, electronic device and computer readable storage medium

Also Published As

Publication number Publication date
CN111598405B (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN111598405B (en) Resource allocation method and server
CN107302488B (en) Virtual article distribution method, system and server
CN109144700B (en) Method and device for determining timeout duration, server and data processing method
US20110107342A1 (en) Process scheduler employing ordering function to schedule threads running in multiple adaptive partitions
CN106897299B (en) Database access method and device
CN115379512B (en) Bandwidth adjustment method and device, electronic equipment and computer readable storage medium
CN114661433A (en) Event task scheduling method and device, storage medium and electronic equipment
CN111538572A (en) Task processing method, device, scheduling server and medium
CN109388501B (en) Communication matching method, device, equipment and medium based on face recognition request
CN109032812B (en) Mobile terminal, limiting method for interprocess communication of mobile terminal and storage medium
CN114629960A (en) Resource scheduling method, device, system, device, medium, and program product
CN110213213B (en) Timing task processing method and system for application
CN113687931A (en) Task processing method, system and device
CN115412500B (en) Asynchronous communication method, system, medium and equipment supporting load balancing strategy
CN114675908A (en) Service data processing system, method, computer device and storage medium
CN109413489B (en) Serial multi-thread bullet screen distribution method, device, equipment and storage medium
CN114338381A (en) Unitized processing method of message, message gateway and processing system of message
CN112463257B (en) Application mode determining method, computing device and computer storage medium
CN115277557B (en) Broadcast processing method, device, electronic equipment and storage medium
CN112671666B (en) IO processing method and device
CN109491948B (en) Data processing method and device for double ports of solid state disk
CN117376373B (en) Metadata operation request processing method, device, equipment and storage medium
CN111367676A (en) Distributed task processing method and device
CN113886040A (en) Task scheduling method and device
CN114390592A (en) Application access method, device, equipment and medium in double-WIFI network

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