CN108920278B - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN108920278B
CN108920278B CN201810709625.3A CN201810709625A CN108920278B CN 108920278 B CN108920278 B CN 108920278B CN 201810709625 A CN201810709625 A CN 201810709625A CN 108920278 B CN108920278 B CN 108920278B
Authority
CN
China
Prior art keywords
resource
request
amount
total
contention
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
CN201810709625.3A
Other languages
Chinese (zh)
Other versions
CN108920278A (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN201810709625.3A priority Critical patent/CN108920278B/en
Publication of CN108920278A publication Critical patent/CN108920278A/en
Application granted granted Critical
Publication of CN108920278B publication Critical patent/CN108920278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Information Transfer Between Computers (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention relates to the technical field of data processing, in particular to a resource allocation method and a resource allocation device, which are applied to a server, wherein the method comprises the following steps: the method comprises the steps of obtaining resource contention requests sent by terminal devices aiming at hot spot resources in a set time period, wherein the resource contention requests comprise resource request quantity and resource request numbers, classifying and storing the resource contention requests according to the resource request numbers, obtaining the sum of the hot spot resources and the resource request quantity corresponding to each type of resource request numbers, obtaining the total demand quantity and the target hot spot resource numbers corresponding to the target hot spot resources when the transaction right of the target hot spot resources is obtained, and performing transaction on the resource contention requests corresponding to the request resource numbers matched with the target hot spot resource numbers according to the sum of the request quantity and the total demand quantity corresponding to the request resource numbers to obtain transaction results, wherein the transaction results are transaction success or transaction failure. By the method, the resource contention request is quickly processed.

Description

Resource allocation method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a resource allocation method and apparatus.
Background
Currently, in a banking system, there are application scenarios where a large amount of data needs to access and modify a certain record or records concurrently to implement a transaction. The inventors have found that in the case of large transaction volumes, these data tend to form hot spots, which in turn affect the overall throughput of the system. Therefore, it is an urgent technical problem to provide a method for rapidly processing a resource contention request.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a resource allocation method and device, which can effectively improve the efficiency of processing the resource contention request.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
a resource allocation method is applied to a server associated with a plurality of terminal devices, and comprises the following steps:
acquiring a resource contention request sent by each terminal device for a hotspot resource in a set time period, wherein the resource contention request comprises a resource request amount and a resource request number;
classifying and storing the resource contention requests according to the resource request numbers, and obtaining the sum of the hot spot resources corresponding to the resource request numbers of each type and the resource request amount;
when the transaction right of the target hot spot resource is obtained, obtaining the total quantity of the demand corresponding to the target hot spot resource and the number of the target hot spot resource;
and trading each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount to obtain a trading result, wherein the trading result is a trading success or a trading failure.
Optionally, in the resource allocation method, the resource contention request further includes a request time, and the step of performing a transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to a corresponding resource request amount, a sum of the request amounts, and the total demand amount to obtain a transaction result includes:
taking the sum of the request quantities of all resource contention requests corresponding to the request resource numbers matched with the target hotspot resource numbers as a request total quantity, and comparing the request total quantity with the demand total quantity;
when the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
and when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number.
Optionally, in the resource allocation method, the resource contention request further includes a device number, and the device number corresponds to a terminal device, and after the step of performing a transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to a corresponding resource request amount, a sum of the request amounts, and the total demand amount to obtain a transaction result is performed, the method further includes:
and respectively sending the transaction results of the transaction request resources to the terminal equipment corresponding to the equipment numbers in the transaction request resources.
Optionally, in the resource allocation method, after performing a step of performing a transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to a sum of request amounts corresponding to the request resource number and the total demand amount to obtain a transaction result, the method further includes:
receiving result query information sent by terminal equipment based on user operation, wherein the query information comprises a query number and an equipment number corresponding to the terminal equipment;
and acquiring a transaction result corresponding to the request resource number matched with the inquiry number, and feeding back the transaction result to the terminal equipment corresponding to the equipment number.
Optionally, in the resource allocation method, before the step of obtaining the resource contention request sent by each terminal device for the hot spot resource within a set time period is executed, the method further includes:
receiving resource contention requests sent by the terminal equipment aiming at hot spot resources and storing the resource contention requests into a database associated with the server according to a time sequence;
the step of obtaining the resource contention request sent by each terminal device for the hot spot resource in a set time period includes:
and acquiring a resource contention request sent by each terminal device for the hot spot resource in a set time period from the database.
The present invention also provides a resource allocation apparatus applied to a server associated with a plurality of terminal devices, the apparatus including:
a first obtaining module, configured to obtain a resource contention request sent by each terminal device for a hotspot resource in a set time period, where the resource contention request includes a resource request amount and a resource request number;
the classification module is used for classifying and storing the resource contention requests according to the resource request numbers and obtaining the sum of the hot spot resources corresponding to the resource request numbers of each type and the resource request amount;
the second acquisition module is used for acquiring the total demand and the target hotspot resource number corresponding to the target hotspot resource when the transaction right of the target hotspot resource is acquired;
and the allocation module is used for trading each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount and obtaining a trading result, wherein the trading result is a trading success or a trading failure.
Optionally, in the resource allocation apparatus, the resource contention request further includes a request time, and the allocation module is further configured to take a sum of request amounts of the resource contention requests corresponding to the request resource number matched with the target hotspot resource number as a total request amount, and compare the total request amount with the total demand amount;
when the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
and when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number.
Optionally, in the resource allocating apparatus, the resource contention request further includes a device number, and the device number corresponds to a terminal device, and the apparatus further includes:
and the sending module is used for sending the transaction results of the request resources for transaction to the terminal equipment corresponding to the equipment numbers in the request resources for transaction.
Optionally, in the resource allocation apparatus, the apparatus further includes:
the terminal equipment comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving result query information sent by the terminal equipment based on user operation, and the query information comprises a query number and an equipment number corresponding to the terminal equipment;
and the feedback module is used for acquiring a transaction result corresponding to the request resource number matched with the inquiry number and feeding back the transaction result to the terminal equipment corresponding to the equipment number.
Optionally, in the resource allocation apparatus, the apparatus further includes:
the storage module is used for receiving resource contention requests sent by each terminal device aiming at hot spot resources and storing the resource contention requests into a database associated with the server according to a time sequence;
the first obtaining module is further configured to obtain, from the database, resource contention requests sent by each terminal device for the hot spot resource in a set time period.
The invention provides a task execution method and a task execution device, which are applied to a server, and are used for performing transaction when the transaction right of a target hotspot resource is achieved by acquiring and classifying and storing resource contention requests sent by terminal equipment, so that the resource contention requests are rapidly processed.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
Fig. 1 is a connection block diagram of a resource allocation system according to an embodiment of the present invention.
Fig. 2 is a block diagram of a server according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a resource allocation method according to an embodiment of the present invention.
Fig. 4 is another flowchart of a resource allocation method according to an embodiment of the present invention.
Fig. 5 is a connection block diagram of a resource allocation apparatus according to an embodiment of the present invention.
Fig. 6 is another connection block diagram of a resource allocation apparatus according to an embodiment of the present invention.
Icon: 10-a server; 12-a memory; 14-a processor; 20-a terminal device; 100-a resource allocation means; 110-a first acquisition module; 120-a classification module; 130-a second acquisition module; 140-a distribution module; 150-a sending module; 160-a receiving module; 170-feedback module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Fig. 1 is a schematic diagram of a resource allocation system according to a preferred embodiment of the present invention, and schematically illustrates an application scenario of an embodiment of the present application. The resource allocation system includes a server 10 and a plurality of terminal devices 20 associated with the server 10, and the server 10 may include a processor, a hard disk, a memory, a system bus, and the like, and is not particularly limited in kind.
Referring to fig. 2, fig. 2 is a connection block diagram of a server 10 provided by the present invention, which includes a processor 14 and a memory 12, where the memory 12 and the processor 14 are electrically connected to each other directly or indirectly to implement data transmission or interaction. The memory 12 stores software functional modules stored in the memory 12 in the form of software or Firmware (Firmware), and the processor 14 executes various functional applications and data processing by running software programs and modules stored in the memory 12, such as the resource allocation apparatus 100 in the embodiment of the present invention, so as to implement the resource allocation method in the embodiment of the present invention.
Referring to fig. 3, the present invention provides a resource allocation method applicable to the resource allocation system, which includes four steps S110 to S140.
Step S110: acquiring a resource contention request sent by each terminal device 20 for the hot spot resource within a set time period.
Wherein, the resource contention request comprises a resource request amount and a resource request number.
The hotspot resource may be, but not limited to, a national debt, a fund, a financing or loan product resource, and the hotspot resource may be one or more, and is not limited specifically herein. The set time period may be half an hour, one hour or two hours, and is not particularly limited herein, and may be set according to actual requirements. The hot spot resource may be one or multiple, and is not specifically limited herein, and may be set according to actual requirements.
Step S120: and classifying and storing the resource contention requests according to the resource request numbers, and obtaining the sum of the hot spot resources corresponding to the resource request numbers of each type and the resource request amount.
The method for storing each resource contention request in a classified manner according to the resource request number may be: the resource contention request corresponding to each type of resource request number obtained after the classification is stored in a thread pool manner, or the resource contention request corresponding to each type of resource request number obtained after the classification may be sent to a database or a storage device associated with the server 10 for storage.
In this embodiment, the manner of storing each resource contention request in a sorted manner according to the resource request number is: the resource contention requests are classified and stored in the bucket processing thread pool of the server 10 according to the resource request numbers, and the resource contention request corresponding to each type of resource request number is cached by using one bucket in the bucket processing thread pool.
Step S130: and when the transaction right of the target hotspot resource is obtained, obtaining the total quantity of the demands corresponding to the target hotspot resource and the number of the target hotspot resource.
The method for obtaining the transaction right of the target hotspot resource may be to receive a target hotspot resource transaction control instruction sent by an external device to the server 10, so as to generate the transaction right of the target hotspot resource when the target hotspot resource transaction control instruction is received, or may be to generate the transaction right of the target hotspot resource when the server 10 reaches a set time point in a timed manner, which is not specifically limited herein, and is set according to actual requirements.
Step S140: and trading each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount to obtain a trading result, wherein the trading result is a trading success or a trading failure.
When the sum of the request amounts is greater than the total demand amount, the transaction can be performed in a manner of allocating the resource request amount and the request amount in each resource contention request corresponding to the request resource number matched with the target hotspot resource number; or the request time included in each resource contention request corresponding to the request resource number matched with the target hotspot resource number may be allocated in a first-come-first-obtained principle, which is not specifically limited herein, and may be set according to actual requirements.
Optionally, in this embodiment, the resource contention request further includes a request time, and the step of performing a transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to a sum of request amounts corresponding to the request resource number and the total demand amount to obtain a transaction result includes:
and taking the sum of the request quantity of each resource contention request corresponding to the request resource number matched with the target hotspot resource number as the total request quantity, and comparing the total request quantity with the total demand quantity.
When the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
and when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number.
In order to facilitate uniform management of the resource contention request, optionally, in this embodiment, before the step of obtaining the resource contention request sent by each terminal device 20 for the hot spot resource within a set period, the method further includes:
receiving resource contention requests sent by the terminal device 20 for hot spot resources and saving the resource contention requests in a database associated with the server 10 according to a time sequence.
The step of acquiring the resource contention request sent by each terminal device 20 for the hot spot resource within a set time period includes:
and obtaining a resource contention request sent by each terminal device 20 for the hot spot resource in a set time period from the database.
Referring to fig. 4, optionally, in order to facilitate feeding back the transaction result to the user, in this embodiment, the resource contention request further includes a device number, and the device number corresponds to the terminal device 20, and after the step of performing transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the sum of the request amounts corresponding to the request resource numbers and the total demand amount to obtain the transaction result is performed, the method further includes:
step S160: and receiving result query information sent by the terminal device 20 based on user operation, wherein the query information includes a query number and a device number corresponding to the terminal device 20.
Step S170: and acquiring a transaction result corresponding to the request resource number matched with the inquiry number, and feeding back the transaction result to the terminal equipment 20 corresponding to the equipment number.
Referring to fig. 5, the present invention further provides a resource allocation apparatus 100 applicable to the resource allocation system, where the resource allocation apparatus 100 includes: a first acquisition module 110, a classification module 120, a second acquisition module 130, and an assignment module 140.
The first obtaining module 110 is configured to obtain a resource contention request sent by each terminal device 20 for a hot spot resource within a set time period, where the resource contention request includes a resource request amount and a resource request number. In this embodiment, the first obtaining module 110 may be configured to execute step S110 shown in fig. 3, and the foregoing description of step S110 may be referred to for the detailed description of the first obtaining module 110.
The classification module 120 is configured to classify and store the resource contention requests according to the resource request numbers, and obtain a sum of the hot spot resources and the resource request amount corresponding to each type of resource request number. In this embodiment, the classifying module 120 may be configured to perform step S120 shown in fig. 3, and the foregoing description of step S120 may be referred to for specific description of the classifying module 120.
The second obtaining module 130 is configured to, when obtaining the transaction right of the target hotspot resource, obtain a total amount of demand and a number of the target hotspot resource corresponding to the target hotspot resource. In this embodiment, the second obtaining module 130 may be configured to execute the step S130 shown in fig. 3, and the detailed description of the second obtaining module 130 may refer to the step S130 described above.
The allocation module 140 is configured to trade each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts, and the total demand amount, and obtain a trade result, where the trade result is a trade success or a trade failure. The allocating module 140 may be configured to execute step S140 shown in fig. 3, and the detailed description about the allocating module 140 may also refer to the foregoing description about step S140.
Optionally, in this embodiment, the resource contention request further includes a request time, and the allocation module 140 is further configured to use a sum of request amounts of the resource contention requests corresponding to the request resource number matched with the target hotspot resource number as a total request amount, and compare the total request amount with the total demand amount. When the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number; and when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number.
Optionally, in this embodiment, the resource contention request further includes a device number, and the device number corresponds to the terminal device 20, and the resource allocation apparatus 100 further includes a sending module 150.
The sending module 150 is configured to send the transaction results of the request resources for performing the transaction to the terminal device 20 corresponding to the device number in the request resources for performing the transaction. For the detailed description of the sending module 150, refer to the foregoing detailed description of the resource allocation method.
Optionally, in this embodiment, the resource allocation apparatus 100 further includes a saving module.
The storing module is configured to receive resource contention requests sent by each terminal device 20 for hot spot resources and store the resource contention requests into a database associated with the server 10 according to a time sequence.
The first obtaining module 110 is further configured to obtain, from the database, a resource contention request sent by each terminal device 20 for a hot spot resource within a set time period.
Referring to fig. 6, optionally, in the present embodiment, the resource allocation apparatus 100 further includes a receiving module 160 and a feedback module 170.
The receiving module 160 is configured to receive result query information sent by the terminal device 20 based on a user operation, where the query information includes a query number and a device number corresponding to the terminal device 20. The receiving module 160 may be configured to perform step S160 shown in fig. 4, and for the specific description of the receiving module 160, reference may be made to the foregoing description of step S160.
The feedback module 170 is configured to obtain a transaction result corresponding to the request resource number matched with the inquiry number, and feed back the transaction result to the terminal device 20 corresponding to the device number. The feedback module 170 may be configured to perform step S170 shown in fig. 4, and the detailed description about the feedback module 170 may refer to the description about step S170.
In summary, according to the resource allocation method and device provided by the present invention, the resource contention requests are sorted and stored, and the sum of the hot resource and the resource request amount corresponding to each type of resource request number is obtained, so that when the target resource transaction right is obtained, each resource contention request corresponding to the request resource number matched with the target hot resource number is transacted according to the sum of the request amounts corresponding to the request resource numbers and the total demand amount according to the total demand amount corresponding to the target hot resource number and the target hot resource number, so as to implement unified and rapid processing on the resource solicitation requests, thereby effectively improving the processing efficiency and effectively reducing the usage rate of the CPU of the server 10.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A resource allocation method applied to a server associated with a plurality of terminal devices, the method comprising:
acquiring a resource contention request sent by each terminal device for a hotspot resource in a set time period, wherein the resource contention request comprises a resource request amount and a resource request number;
classifying and storing the resource contention requests according to the resource request numbers, and obtaining the sum of the hot spot resources corresponding to the resource request numbers of each type and the resource request amount;
when the transaction right of the target hot spot resource is obtained, obtaining the total quantity of the demand corresponding to the target hot spot resource and the number of the target hot spot resource;
trading each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount to obtain a trading result, wherein the trading result is successful or failed;
the resource contention request further includes a request time, and the step of performing a transaction on each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount to obtain a transaction result includes:
taking the sum of the resource request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number as a request total amount, and comparing the request total amount with the demand total amount;
when the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
wherein the method further comprises:
and when the total request amount is larger than the total demand amount, distributing the total demand amount according to the ratio of the resource request amount contained in each resource contention request corresponding to the request resource number matched with the target hotspot resource number to the total request amount.
2. The method according to claim 1, wherein the resource contention request further includes a device number corresponding to the terminal device, and after performing the step of trading each resource contention request corresponding to the request resource number matching the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts, and the total demand amount, and obtaining the trading result, the method further comprises:
and respectively sending the transaction results of the transaction request resources to the terminal equipment corresponding to the equipment numbers in the transaction request resources.
3. The method according to claim 1, wherein after performing the step of trading each resource contention request corresponding to the request resource number matching the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts, and the total demand amount, and obtaining a trading result, the method further comprises:
receiving result query information sent by terminal equipment based on user operation, wherein the query information comprises a query number and an equipment number corresponding to the terminal equipment;
and acquiring a transaction result corresponding to the request resource number matched with the inquiry number, and feeding back the transaction result to the terminal equipment corresponding to the equipment number.
4. The method according to claim 1, wherein before the step of obtaining the resource contention request sent by each of the terminal devices for the hot spot resource within a set period of time, the method further comprises:
receiving resource contention requests sent by the terminal equipment aiming at hot spot resources and storing the resource contention requests into a database associated with the server according to a time sequence;
the step of obtaining the resource contention request sent by each terminal device for the hot spot resource in a set time period includes:
and acquiring a resource contention request sent by each terminal device for the hot spot resource in a set time period from the database.
5. A resource allocation apparatus applied to a server to which a plurality of terminal devices are associated, the apparatus comprising:
a first obtaining module, configured to obtain a resource contention request sent by each terminal device for a hotspot resource in a set time period, where the resource contention request includes a resource request amount and a resource request number;
the classification module is used for classifying and storing the resource contention requests according to the resource request numbers and obtaining the sum of the hot spot resources corresponding to the resource request numbers of each type and the resource request amount;
the second acquisition module is used for acquiring the total demand and the target hotspot resource number corresponding to the target hotspot resource when the transaction right of the target hotspot resource is acquired;
the allocation module is used for trading each resource contention request corresponding to the request resource number matched with the target hotspot resource number according to the corresponding resource request amount, the sum of the request amounts and the total demand amount and obtaining a trading result, wherein the trading result is a trading success or a trading failure;
the resource contention request further includes a request time, and the allocation module is further configured to use a sum of request amounts of the resource contention requests corresponding to the request resource number matched with the target hotspot resource number as a total request amount, and compare the total request amount with the total demand amount;
when the total amount of the requests is less than or equal to the total amount of the requests, distributing the total amount of the requests according to the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
when the total request amount is larger than the total demand amount, distributing the total demand amount according to the request time sequence and the request amount of each resource contention request corresponding to the request resource number matched with the target hotspot resource number;
the allocation module is further configured to, when the total request amount is greater than the total demand amount, allocate the total demand amount according to a ratio of a resource request amount included in each resource contention request corresponding to the request resource number matched with the target hotspot resource number to the total request amount.
6. The apparatus according to claim 5, wherein the resource contention request further includes a device number, and the device number corresponds to the terminal device, the apparatus further comprising:
and the sending module is used for sending the transaction results of the request resources for transaction to the terminal equipment corresponding to the equipment numbers in the request resources for transaction.
7. The apparatus for resource allocation according to claim 5, wherein said apparatus further comprises:
the terminal equipment comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving result query information sent by the terminal equipment based on user operation, and the query information comprises a query number and an equipment number corresponding to the terminal equipment;
and the feedback module is used for acquiring a transaction result corresponding to the request resource number matched with the inquiry number and feeding back the transaction result to the terminal equipment corresponding to the equipment number.
8. The apparatus for resource allocation according to claim 5, wherein said apparatus further comprises:
the storage module is used for receiving resource contention requests sent by each terminal device aiming at hot spot resources and storing the resource contention requests into a database associated with the server according to a time sequence;
the first obtaining module is further configured to obtain, from the database, resource contention requests sent by each terminal device for the hot spot resource in a set time period.
CN201810709625.3A 2018-07-02 2018-07-02 Resource allocation method and device Active CN108920278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810709625.3A CN108920278B (en) 2018-07-02 2018-07-02 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810709625.3A CN108920278B (en) 2018-07-02 2018-07-02 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN108920278A CN108920278A (en) 2018-11-30
CN108920278B true CN108920278B (en) 2021-12-24

Family

ID=64424874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810709625.3A Active CN108920278B (en) 2018-07-02 2018-07-02 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN108920278B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347513B (en) * 2019-07-15 2022-05-20 中国工商银行股份有限公司 Hot data batch scheduling method and device
CN110781000B (en) * 2019-10-17 2022-07-05 中国建设银行股份有限公司 Multi-application resource allocation method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150012071A (en) * 2013-07-24 2015-02-03 한국과학기술정보연구원 Apparatus and method for allocating computing resource to multiple users
CN106897144A (en) * 2017-01-05 2017-06-27 阿里巴巴集团控股有限公司 A kind of resource allocation methods and device
CN107632887A (en) * 2016-07-18 2018-01-26 阿里巴巴集团控股有限公司 Resource allocation methods and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101178671A (en) * 2007-12-11 2008-05-14 北大方正集团有限公司 Method and system for dynamically configuring service treatment progress on server terminal
CN104219167B (en) * 2013-05-31 2017-09-15 中国电信股份有限公司 Network resource scheduling method and server
CN105378667B (en) * 2013-12-10 2018-09-28 华为技术有限公司 A kind of dispatching method and device of resources of virtual machine
CN104408065A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Trade information on-line inquiry method and device
CN106209953B (en) * 2015-05-08 2020-06-26 阿里巴巴集团控股有限公司 Order information processing method, device and system
CN104966198A (en) * 2015-07-10 2015-10-07 苏州海博智能系统有限公司 Authorized consumption method and system
CN106254528B (en) * 2016-09-14 2019-12-06 北京佰才邦技术有限公司 Resource downloading method and caching device
CN107886328B (en) * 2017-11-23 2021-01-26 深圳壹账通智能科技有限公司 Transaction processing method and device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150012071A (en) * 2013-07-24 2015-02-03 한국과학기술정보연구원 Apparatus and method for allocating computing resource to multiple users
CN107632887A (en) * 2016-07-18 2018-01-26 阿里巴巴集团控股有限公司 Resource allocation methods and device
CN106897144A (en) * 2017-01-05 2017-06-27 阿里巴巴集团控股有限公司 A kind of resource allocation methods and device

Also Published As

Publication number Publication date
CN108920278A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN107295110B (en) Processing method of computing task, edge node, service server and system
US7680848B2 (en) Reliable and scalable multi-tenant asynchronous processing
CN109684065B (en) Resource scheduling method, device and system
CN111737300A (en) Service processing method, device, equipment and computer readable storage medium
CN108920278B (en) Resource allocation method and device
CN110222046B (en) List data processing method, device, server and storage medium
CN109033184B (en) Data processing method and device
CN114036031A (en) Scheduling system and method for resource service application in enterprise digital middleboxes
CN109829678B (en) Rollback processing method and device and electronic equipment
CN109324877A (en) The method and server of data access
CN113095936A (en) Entrusted order processing method, entrusted order processing device, computer equipment and storage medium
CN106156185B (en) Method, device and system for inquiring service request execution state
CN106648874B (en) Processing method and device for batch tasks
CN113111078B (en) Resource data processing method and device, computer equipment and storage medium
US7546308B1 (en) Model and method of an n-tier quality-of-service (QoS)
CN109214884B (en) Demand matching method and device and electronic equipment
CN113608847A (en) Task processing method, device, equipment and storage medium
CN109614386B (en) Data processing method, device, server and computer readable storage medium
CN110673931A (en) Distributed calculation method for document synthesis, document synthesis system and control device thereof
CN107967549B (en) Multi-process task processing device and method
CN110727400A (en) Flow control method, apparatus, device and medium for distributed storage system
CN109766169B (en) Method, control assembly, device and computer storage medium for scheduling data access volume
CN110308996B (en) Matching method for user URL request
CN113127548B (en) File merging method, device, equipment and storage medium
CN110166429B (en) Data packet processing method and device, computer readable storage medium and server

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