CN107292741B - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN107292741B
CN107292741B CN201710606745.6A CN201710606745A CN107292741B CN 107292741 B CN107292741 B CN 107292741B CN 201710606745 A CN201710606745 A CN 201710606745A CN 107292741 B CN107292741 B CN 107292741B
Authority
CN
China
Prior art keywords
resources
transaction
target mechanism
type
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.)
Active
Application number
CN201710606745.6A
Other languages
Chinese (zh)
Other versions
CN107292741A (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 Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201710606745.6A priority Critical patent/CN107292741B/en
Publication of CN107292741A publication Critical patent/CN107292741A/en
Priority to PCT/CN2018/089864 priority patent/WO2019019807A1/en
Priority to TW107125302A priority patent/TWI688905B/en
Application granted granted Critical
Publication of CN107292741B publication Critical patent/CN107292741B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a resource allocation method and a resource allocation device, which are used for acquiring a transaction to be processed of a target mechanism and determining the current resource use condition of the target mechanism according to transaction data of the target mechanism; determining whether the current resource use condition of the target mechanism exceeds a preset resource use condition, wherein the preset resource use condition is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms; if the total resources are not the first type resources, the resources are allocated to the transaction to be processed from the second type resources, and the second type resources are resources except the first type resources in the total resources. In the embodiment of the invention, when the current resource use condition of the target mechanism exceeds the preset resource use condition of the target mechanism, the second type of resources are utilized to allocate resources for the to-be-processed transaction of the target mechanism, so that the to-be-processed transaction of the target mechanism cannot cause incapability of service due to insufficient resources pre-allocated to the target mechanism, thereby improving the stability of the transaction and realizing the multiplexing of the resources.

Description

Resource allocation method and device
Technical Field
The embodiment of the invention relates to the technical field of data scheduling, in particular to a resource allocation method and device.
Background
Currently, the Unionpay has business cooperation with more and more institutions, and the institutions have diversified properties, such as banks, third-party payment institutions, mobile phone manufacturers, operators, merchants and the like. The industries of the mechanisms are different, the technical capacities are different, and the operation and maintenance targets are different, so that the fluidic system which is in butt joint with the mechanisms can flexibly allocate the application resources of the system, and the service availability is guaranteed to the greatest extent. In the existing flow control system, the system allocates the bus process resources to each mechanism in advance according to the historical transaction amount, and each mechanism can only use the pre-allocated resources when carrying out transactions. When the transaction amount of an organization increases and the pre-allocated resources cannot meet the transaction requirement due to marketing or other reasons in a certain time period, the transaction of the organization cannot be performed, and the use amount of the resources of other organizations is far lower than the pre-allocated resources in the same time period, so that the multiplexing of thread resources cannot be realized in the existing flow control system, and the utilization rate of the thread resources is low.
Disclosure of Invention
The embodiment of the invention provides a resource allocation method and a resource allocation device, which are used for solving the problem that the utilization rate of thread resources is low because the reuse of the thread resources cannot be realized in the existing flow control system.
The embodiment of the invention provides a resource allocation method, which comprises the following steps:
acquiring a transaction to be processed and determining a target mechanism corresponding to the transaction to be processed;
determining the current resource use condition of the target institution according to the transaction data of the target institution in a set time period;
determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms;
if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources.
Optionally, the allocating resources from the second class of resources for the pending transaction includes:
determining whether the utilization rate of the second class of resources is greater than a first threshold;
if the utilization rate of the second type of resources is not greater than the first threshold, allocating resources for the transaction to be processed from the second type of resources; or alternatively, the first and second heat exchangers may be,
if the utilization rate of the second-class resources is greater than the first threshold value and the average transaction time of the target mechanism is less than the second threshold value, allocating resources for the transaction to be processed from the second-class resources; the average transaction time of the target institution is determined based on the transaction data of the target institution over a set period of time.
Optionally, the method further comprises: if the usage rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is less than the second threshold, after allocating resources for the transaction to be processed from the second type of resources, the method further includes:
determining the current occupied resources of the target mechanism according to the transaction data of the target mechanism in a set time period;
and when the current occupied resource of the target mechanism is determined to be larger than a third threshold value, increasing the preset resource of the target mechanism.
Optionally, the method further comprises:
and if the utilization rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is not less than the second threshold, stopping distributing resources for the transaction to be processed, and reducing preset resources of the target mechanism.
Optionally, after allocating the resources for the pending transaction from the second class of resources, the method further includes:
counting the transaction amount of the target mechanism for carrying out transactions by utilizing the second type of resources;
and when the transaction amount is determined to be larger than a fourth threshold value, increasing preset resources of the target institution.
Correspondingly, the embodiment of the invention also provides a resource allocation device, which comprises:
the acquisition module is used for acquiring the transaction to be processed and determining a target mechanism corresponding to the transaction to be processed;
the processing module is used for determining the current resource use condition of the target mechanism according to the transaction data of the target mechanism in a set time period; determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms; if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources.
Optionally, the processing module is specifically configured to:
determining whether the utilization rate of the second class of resources is greater than a first threshold;
if the utilization rate of the second type of resources is not greater than the first threshold, allocating resources for the transaction to be processed from the second type of resources; or alternatively, the first and second heat exchangers may be,
if the utilization rate of the second-class resources is greater than the first threshold value and the average transaction time of the target mechanism is less than the second threshold value, allocating resources for the transaction to be processed from the second-class resources; the average transaction time of the target institution is determined based on the transaction data of the target institution over a set period of time.
Optionally, the processing module is further configured to:
if the usage rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is less than the second threshold, after allocating resources for the transaction to be processed from the second type of resources, the method further includes:
determining the current occupied resources of the target mechanism according to the transaction data of the target mechanism in a set time period;
and when the current occupied resource of the target mechanism is determined to be larger than a third threshold value, increasing the preset resource of the target mechanism.
Optionally, the processing module is further configured to:
and if the utilization rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is not less than the second threshold, stopping distributing resources for the transaction to be processed, and reducing preset resources of the target mechanism.
Optionally, the processing module is further configured to:
after resources are allocated to the to-be-processed transaction from the second class of resources, counting the transaction amount of the target mechanism for carrying out the transaction by utilizing the second class of resources;
and when the transaction amount is determined to be larger than a fourth threshold value, increasing preset resources of the target institution.
The embodiment of the invention shows that the transaction to be processed is obtained and the target mechanism corresponding to the transaction to be processed is determined; then determining the current resource use condition of the target institution according to the transaction data of the target institution in a set time period; determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms; if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources. In the embodiment of the invention, the total resources are divided into the first type of resources and the second type of resources, the first type of resources are used for being pre-allocated to all institutions, the second type of resources are multiplexing resources, and when the current resource use condition of the target institution exceeds the preset resource use condition of the target institution, the second type of resources are utilized to allocate the resources for the transaction to be processed of the target institution, so that the transaction to be processed of the target institution cannot be performed due to insufficient resources pre-allocated to the target institution, the transaction stability is improved, and the multiplexing of the resources is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a resource allocation method according to an embodiment of the present invention;
FIG. 2 is a schematic view of an observation window according to an embodiment of the present invention;
fig. 3 is a flow chart of another resource allocation method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a resource allocation device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 illustrates a flow of a resource allocation method according to an embodiment of the present invention, where the flow may be executed by a resource allocation device.
As shown in fig. 1, the specific steps of the flow include:
step S101, obtaining a to-be-processed transaction and determining a target mechanism corresponding to the to-be-processed transaction.
Step S102, determining the current resource use condition of the target institution according to the transaction data of the target institution in the set time period.
Step S103, determining whether the current resource usage of the target institution exceeds the preset resource usage of the target institution.
Step S104, if yes, resources are allocated for the transaction to be processed from the second class of resources.
Specifically, in step S101, the transaction to be processed may be transfer, consumption, etc., the institution may be a bank, a third party payment institution, a mobile phone manufacturer, an operator, a merchant, etc., the transactions of each institution are distinguished by a specific identifier, and after the transaction to be processed is obtained, the target institution to which the transaction to be processed belongs may be determined according to the identifier of the transaction to be processed.
In step S102, the set period of time is a period of time before the transaction to be processed is acquired, and the duration may be determined according to specific situations, such as 10 seconds, 20 seconds, and the like. The set time period may be used as an observation window for observing and counting transaction data of each institution in the set time period, where the transaction data includes transaction amount, average transaction time, transaction start time, transaction end time, and the like. The observation window may be moved once every 1 second, as illustrated in fig. 2, for example, the current observation window is 0 to 20 seconds, and then the transaction data of each mechanism in 0 to 20 seconds is counted, after 1 second, the observation window is moved, and the next observation window is 1 to 21 seconds, and then the transaction data of each mechanism in 1 to 21 seconds is counted, where the current resource usage condition may be the current resource occupation ratio, that is, the ratio of the current occupied resource of the target mechanism to the first type of resource; the current resource usage may also be the current occupied resource of the target institution.
In step S103, a preset resource usage is determined based on the resources pre-allocated to the target institution and the first type of resources pre-allocated to all institutions. In a specific implementation, the preset resource usage condition may be a preset resource duty ratio, that is, a ratio of a resource pre-allocated to the target mechanism to a first type of resource. The preset resource use condition can also be a resource which is pre-allocated to the target mechanism, and the embodiment of the invention does not specifically limit the preset resource use condition. The first type of resources are the sum of the resources pre-allocated to all institutions, and also refer to the total transaction duration allowed in a set time period. The first type of resources can be pre-allocated to each mechanism according to weights, wherein the weights are determined according to historical transaction data of each mechanism, the first type of resources can also be directly and uniformly distributed to each mechanism, and the first type of resources specifically accords with a formula (1):
A=M*S………………………………………(1)
wherein A is a first type of resource, M is the number of bus threads pre-distributed to all institutions, and S is the duration of a set time period.
In step S104, when the current resource usage of the target institution does not exceed the preset resource usage of the target institution, it is indicated that the resources allocated to the target institution in advance remain, and the transaction to be processed can be completed by using the remaining resources. When the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, the fact that the resources pre-allocated to the target mechanism are used up is indicated, the resources can not be provided for the transaction to be processed any more, and the transaction to be processed needs to be completed by utilizing the second type of resources. The second type of resources are resources other than the first type of resources in the total resources.
In the embodiment of the invention, the total resources are divided into the first type of resources and the second type of resources, the first type of resources are used for being pre-allocated to all institutions, the second type of resources are multiplexing resources, and when the current resource use condition of the target institution exceeds the preset resource use condition of the target institution, the second type of resources are utilized to allocate the resources for the transaction to be processed of the target institution, so that the transaction to be processed of the target institution cannot be performed due to insufficient resources pre-allocated to the target institution, the transaction stability is improved, and the multiplexing of the resources is realized.
The process of determining the current resource usage of the target institution is described below,
when the current occupied resource of the target mechanism is used as the current resource use condition of the target mechanism, determining the current occupied resource of the target mechanism according to the transaction data of the target mechanism in a set time period, wherein the method specifically comprises the following two methods:
according to the method, firstly, the transaction amount and the average transaction time of a target mechanism in a set time period are counted through an observation window, the currently occupied resource of the target mechanism is determined through calculating the product of the transaction amount and the average transaction time of the target mechanism in the set time period, for example, the set time period is 20 seconds before the transaction to be processed is acquired, the transaction amount of the target mechanism in the 20 seconds is obtained through counting to be 1000 times, the average transaction time is 10 milliseconds, and the currently occupied resource of the target mechanism is 10000 thread seconds.
Counting the starting time and the ending time of all transactions of the target mechanism in a set time period through an observation window, determining the duration of each transaction according to the starting time and the ending time of each transaction, and finally adding the duration of all transactions to obtain the current occupied resource of the target mechanism.
When the current resource occupation ratio of the target mechanism is used as the current resource use condition of the target mechanism, after the current occupied resource of the target mechanism is determined according to the method, the current resource occupation ratio of the target mechanism is further determined by calculating the ratio of the current occupied resource of the target mechanism to the first type of resources. In the embodiment of the invention, the current occupied resources of the target mechanism are determined by counting the total transaction duration of the target mechanism within the set time period, the current resource proportion is determined according to the current occupied resources and the first type resources, instead of determining the current occupied resources of the target mechanism and the current resource proportion of the target mechanism according to the number of threads occupied by the target mechanism, the granularity of determining the current resource proportion is finer, and the accuracy of determining the current resource use condition of the target mechanism is further improved.
When the current resource use condition of the target mechanism exceeds the preset resource use condition of the target mechanism, resources are allocated for the transaction to be processed from the second class of resources, and the method specifically comprises the following four conditions:
and in the first case, when the utilization rate of the second type of resources is not greater than the first threshold value, the second type of resources are sufficient, and resources are allocated for the transaction to be processed from the second type of resources.
And secondly, when the utilization rate of the second-class resources is determined to be larger than a first threshold value, and the average transaction time of the target mechanism is smaller than the second threshold value, which means that the second-class resources are tense and the transaction processing speed of the target mechanism is normal, the resources are allocated for the transaction to be processed from the second-class resources. Wherein the average transaction time of the target institution is determined according to the transaction data of the target institution in a set time period, and the second threshold is determined according to specific situations.
And thirdly, determining that the utilization rate of the second class of resources is larger than a first threshold value, wherein the average transaction time of the target mechanism is not smaller than the second threshold value, and stopping distributing the resources for the transaction to be processed if the second class of resources are tense and the transaction processing speed of the target mechanism is abnormal.
And fourthly, determining that the utilization rate of the second class of resources is larger than a first threshold value, wherein the average transaction time of the target mechanism is not smaller than the second threshold value, and when the current occupied resources of the target mechanism are not smaller than a third threshold value, indicating that the second class of resources are tense, and stopping distributing the resources for the transaction to be processed if the transaction processing speed of the target mechanism is abnormal and a large amount of resources are occupied, wherein the current occupied resources of the target mechanism are determined according to the transaction data of the target mechanism in a set time period.
In the embodiment of the invention, the utilization rate of the second class resources is monitored in real time, when the second class resources are sufficient, the second class resources are directly distributed to the transaction to be processed, when the second class resources are insufficient, the state of the target mechanism is judged, and the resources are distributed to the transaction to be processed according to the state of the target mechanism, so that the second class resources are fully utilized on one hand, and the system congestion caused by the fact that the abnormal mechanism occupies a large amount of resources on the other hand is avoided.
Further, when the usage rate of the second type of resources is greater than the first threshold, in addition to allocating resources according to the state of the target mechanism in the above embodiment, the allocation situation of the first type of resources needs to be correspondingly adjusted to alleviate the usage pressure of the second type of resources, which specifically includes the following five situations:
if the utilization rate of the second class of resources is greater than the first threshold value, and the average transaction time of the target mechanism is smaller than the second threshold value, after resources are allocated for the transaction to be processed from the second class of resources, determining the resources currently occupied by the target mechanism according to the transaction data of the target mechanism in a set time period, when the resources currently occupied by the target mechanism are determined to be greater than the third threshold value, indicating that the target mechanism is in a marketing state, and a large number of resources are needed for transaction, and increasing preset resources of the target mechanism, wherein the preset resources are resources which are allocated to the target mechanism in advance in the first class of resources, and the preset resources of the target mechanism can be adjusted by a weight adjusting method, and the preset resources of the target mechanism can be adjusted by adjusting the total resources of the first class of resources.
And if the utilization rate of the second class of resources is larger than the first threshold value and the average transaction time of the target mechanism is smaller than the second threshold value, after resources are allocated for the transaction to be processed from the second class of resources, determining the resources currently occupied by the target mechanism according to the transaction data of the target mechanism in a set time period, and if the resources currently occupied by the target mechanism are not larger than the third threshold value, not adjusting the preset resources of the target mechanism.
And thirdly, if the utilization rate of the second class of resources is larger than the first threshold value, and the average transaction time of the target mechanism is not smaller than the second threshold value, indicating that the second class of resources are tense, and if the target mechanism is in an abnormal state at the moment, reducing the preset resources of the target mechanism.
And fourthly, if the utilization rate of the second class of resources is larger than the first threshold value, the average transaction time of the target mechanism is not smaller than the second threshold value, and when the current occupied resources of the target mechanism are not smaller than the third threshold value, the second class of resources are tense, and at the moment, the target mechanism is in an abnormal state and occupies a large amount of resources, and the preset resources of the target mechanism are reduced.
And fifthly, after resources are allocated for the to-be-processed transactions from the second class of resources, counting the transaction amount of the target mechanism for carrying out the transactions by using the second class of resources, and when the transaction amount is determined to be larger than a fourth threshold value, indicating that the resources which are pre-allocated to the target mechanism in the first class of resources can not meet the transaction requirements of the target mechanism, and increasing the preset resources of the target mechanism.
In the embodiment of the invention, the utilization rate of the second-class resources and the resources currently occupied by the target mechanism are monitored in real time, the times of the target mechanism for carrying out transactions by using the second-class resources are counted, and then the preset resources of the target mechanism are regulated in real time according to the utilization rate of the second-class resources, the resources currently occupied by the target mechanism and the times of carrying out transactions by using the second-class resources, so that the smooth progress of the transactions of the target mechanism is facilitated, and the use pressure of the second-class resources can be reduced.
In order to better explain the embodiment of the present invention, the following describes a flow of a resource allocation method provided by the embodiment of the present invention through a specific implementation scenario, as shown in fig. 3:
step S301, a pending transaction of a target institution is acquired.
Step S302, determining the resources currently occupied by the target organization.
Step S303, determining the current resource duty ratio of the target organization.
Step S304, judging whether the current resource duty ratio of the target mechanism is smaller than the preset resource duty ratio of the target mechanism, if yes, executing step S305, otherwise, executing step S306.
In step S305, the resources previously allocated to the target institution are allocated to the transaction to be processed.
Step S306, judging whether the utilization rate of the second type resource is larger than a first threshold, if yes, executing step S307, otherwise, executing step S312.
Step S307, judging whether the average transaction time of the target institution is smaller than the second threshold, if yes, executing step S308, otherwise executing step S311.
Step S308, judging whether the currently occupied resource of the target mechanism is larger than a third threshold, if so, executing step S309, otherwise, executing step S310.
Step S309, the second type of resources are allocated to the transaction to be processed and the preset resource duty ratio of the target institution is increased.
In step S310, the second type of resource is allocated to the pending transaction.
Step S311, stopping allocating the resources to the pending transaction and reducing the preset resource duty ratio of the target institution.
In step S312, the second type of resource is allocated to the pending transaction.
In addition to the resource allocation method described in the above embodiments, the present invention also provides another embodiment of a resource allocation method, that is, the average transaction time of the target institution and the currently occupied resources of the target institution are combined to determine the state of the target institution, and the resource allocation is performed according to the state of the target institution. In the following description, a specific example is described, where the number of bus threads in the thread pool is set to 150, the duration of the time period is set to 20 seconds, where 100×20=2000 thread seconds are the first type of resources, 50×20=1000 thread seconds are the second type of resources, the first threshold is set to 80%, and assuming that there are 5 mechanisms, the mechanism numbers are A1, A2, A3, A4, and A5, respectively, and the cases where the 5 mechanisms allocate resources in advance are shown in table 1:
TABLE 1
Organization number Pre-assigning weights for resources Preset resource duty cycle
A1 3 0.3
A2 2 0.2
A3 1 0.1
A4 1 0.1
A5 3 0.3
As shown in table 1, the weights of the resources pre-allocated to the respective institutions are determined according to the historical transaction data of the 5 institutions, and the preset resource duty ratios of the respective institutions are further calculated.
Then determining the current resource ratio of each mechanism, setting the mechanism A1 to have 10000 transactions in the set time period, wherein the average transaction time is 10 milliseconds, and the current resource occupied by the mechanism A1 is 10000×10/1000=100 thread seconds, and the current resource ratio of the mechanism A1 is 100/(20×100) =0.05.
Setting that the mechanism A2 has 20000 transactions in the set time period, and the average transaction time is 30 milliseconds, then the current occupied resource of the mechanism A2 is 20000×30/1000=600 thread seconds, and the current resource ratio of the mechanism A2 is 600/(20×100) =0.3.
Setting that the institution A3 has 20000 transactions in the set time period, and the average transaction time is 15 ms, then the current occupied resource of the institution A3 is 20000×15/1000=300 thread seconds, and the current resource ratio of the institution A3 is 300/(20×100) =0.15.
Setting that the institution A4 has total 80000 transactions in a set time period, and the average transaction time is 10 ms, then the current occupied resource of the institution A4 is 80000×10/1000=800 thread seconds, and the current resource ratio of the institution A4 is 800/(20×100) =0.4.
Setting that the institution A5 has 20000 transactions in the set time period, and the average transaction time is 10 ms, then the current occupied resource of the institution A5 is 20000×10/1000=200 thread seconds, and the current resource ratio of the institution A4 is 200/(20×100) =0.1. The resource allocation mode is determined according to the current resource ratio of the mechanism and the preset resource ratio of the mechanism, and is specifically shown in table 2:
TABLE 2
Organization number Current resource duty cycle Preset resource duty cycle Resource allocation method
A1 0.05 0.3 Resources of the first kind
A2 0.3 0.2 Resources of the second kind
A3 0.15 0.1 Resources of the second kind
A4 0.4 0.1 Resources of the second kind
A5 0.1 0.3 Resources of the first kind
As can be seen from Table 2, the current transactions of the institutions A1, A5 can directly use the pre-allocated resources, namely the first type of resources, the current transactions of the institutions A2, A3 and A4 all need to use the second type of resources, the allocation rule of the second type of resources is specifically introduced below, and if the utilization rate of the second type of resources is less than 80% when the institutions A2, A3 and A4 use the second type of resources to conduct transactions, the institutions A2, A3 and A4 directly use the second type of resources to process the transactions. If the utilization rate of the second type resources is greater than 80% when the institutions A2, A3 and A4 use the second type resources to process transactions, the resource allocation rule needs to be determined according to the transaction data of the institutions A2, A3 and A4 within the set time period, specifically:
setting the second threshold value to be 20 milliseconds, setting the third threshold value to be 500 thread seconds, and setting the average transaction time of the mechanism A2 in the set time period to be 30 milliseconds, so that the average transaction time of the mechanism A2 in the set time period is larger than the second threshold value, and setting the current occupied resource of the mechanism A2 to be 600 thread seconds, so that the current occupied resource of the mechanism A2 is larger than the third threshold value, judging that the mechanism A2 is in an abnormal state, stopping distributing the second type of resources to the transaction of the mechanism A2, and simultaneously reducing the preset resource duty ratio of the mechanism A2. Based on the same method, the mechanisms A3 and A4 are judged, and the judgment result is as follows: and if the currently occupied resource of the organization A3 is smaller than the third threshold value, allocating the second type of resource to the transaction of the organization A2. The average transaction time of the mechanism A4 in the set time period is smaller than the second threshold, and the resources currently occupied by the mechanism A4 are larger than the third threshold, so that the mechanism A4 is judged to be in a marketing state, the second type of resources are distributed to the transactions of the mechanism A4, and meanwhile the preset resource occupation ratio of the mechanism A4 is improved.
The embodiment of the invention shows that the transaction to be processed is obtained and the target mechanism corresponding to the transaction to be processed is determined; determining the current resource use condition of the target institution according to the transaction data of the target institution in a set time period; determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms; if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources. In the embodiment of the invention, the total resources are divided into the first type of resources and the second type of resources, the first type of resources are used for being pre-allocated to all institutions, the second type of resources are multiplexing resources, and when the current resource use condition of the target institution exceeds the preset resource use condition of the target institution, the second type of resources are utilized to allocate the resources for the transaction to be processed of the target institution, so that the transaction to be processed of the target institution cannot be performed due to insufficient resources pre-allocated to the target institution, the transaction stability is improved, and the multiplexing of the resources is realized.
Based on the same concept, fig. 4 illustrates an exemplary structure of a resource allocation apparatus provided in an embodiment of the present invention, which may perform a flow of a resource allocation method.
As shown in fig. 4, the apparatus includes:
an obtaining module 401, configured to obtain a transaction to be processed and determine a target mechanism corresponding to the transaction to be processed;
a processing module 402, configured to determine, according to transaction data of the target institution within a set period of time, a current resource usage situation of the target institution; determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the resources pre-allocated to the target mechanism and the first type of resources pre-allocated to all mechanisms; if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources.
Optionally, the processing module 402 is specifically configured to:
determining whether the utilization rate of the second class of resources is greater than a first threshold;
if the utilization rate of the second type of resources is not greater than the first threshold, allocating resources for the transaction to be processed from the second type of resources; or alternatively, the first and second heat exchangers may be,
if the utilization rate of the second-class resources is greater than the first threshold value and the average transaction time of the target mechanism is less than the second threshold value, allocating resources for the transaction to be processed from the second-class resources; the average transaction time of the target institution is determined based on the transaction data of the target institution over a set period of time.
Optionally, the processing module 402 is further configured to:
if the usage rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is less than the second threshold, after allocating resources for the transaction to be processed from the second type of resources, the method further includes:
determining the current occupied resources of the target mechanism according to the transaction data of the target mechanism in a set time period;
and when the current occupied resource of the target mechanism is determined to be larger than a third threshold value, increasing the preset resource of the target mechanism.
Optionally, the processing module 402 is further configured to:
and if the utilization rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is not less than the second threshold, stopping distributing resources for the transaction to be processed, and reducing preset resources of the target mechanism.
Optionally, the processing module 402 is further configured to:
after resources are allocated to the to-be-processed transaction from the second class of resources, counting the transaction amount of the target mechanism for carrying out the transaction by utilizing the second class of resources;
and when the transaction amount is determined to be larger than a fourth threshold value, increasing preset resources of the target institution.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A method for resource allocation, comprising:
acquiring a transaction to be processed and determining a target mechanism corresponding to the transaction to be processed;
acquiring transaction data of a target mechanism in a set time period, wherein the transaction data comprises transaction amount of the target mechanism in the set time period and transaction time corresponding to each transaction, and the set time period is a time period with preset duration before the transaction to be processed;
determining the current resource use condition of the target mechanism according to the transaction amount of the target mechanism in the set time period and the transaction time corresponding to each transaction;
determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the product of the resource pre-allocated to the target mechanism and the first type of resource pre-allocated to all mechanisms, and the first type of resource is determined according to the product of the preset duration and the total number of threads pre-allocated to all mechanisms;
if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources.
2. The method of claim 1, wherein said allocating resources for said pending transactions from a second class of resources comprises:
determining whether the utilization rate of the second class of resources is greater than a first threshold;
if the utilization rate of the second type of resources is not greater than the first threshold, allocating resources for the transaction to be processed from the second type of resources; or alternatively, the first and second heat exchangers may be,
if the utilization rate of the second-class resources is greater than the first threshold value and the average transaction time of the target mechanism is less than the second threshold value, allocating resources for the transaction to be processed from the second-class resources; the average transaction time of the target institution is determined based on the transaction data of the target institution over a set period of time.
3. The method as recited in claim 2, further comprising:
if the usage rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is less than the second threshold, after allocating resources for the transaction to be processed from the second type of resources, the method further includes:
determining the current occupied resources of the target mechanism according to the transaction data of the target mechanism in a set time period;
and when the current occupied resource of the target mechanism is determined to be larger than a third threshold value, increasing the preset resource of the target mechanism.
4. The method as recited in claim 2, further comprising:
and if the utilization rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is not less than the second threshold, stopping distributing resources for the transaction to be processed, and reducing preset resources of the target mechanism.
5. The method according to any one of claims 1 to 4, further comprising, after said allocating resources for said pending transaction from the second class of resources:
counting the transaction amount of the target mechanism for carrying out transactions by utilizing the second type of resources;
and when the transaction amount is determined to be larger than a fourth threshold value, increasing preset resources of the target institution.
6. A resource allocation apparatus, comprising:
the acquisition module is used for acquiring the transaction to be processed and determining a target mechanism corresponding to the transaction to be processed; acquiring transaction data of a target mechanism in a set time period, wherein the transaction data comprises transaction amount of the target mechanism in the set time period and transaction time corresponding to each transaction, and the set time period is a time period with preset duration before the transaction to be processed;
the processing module is used for determining the current resource use condition of the target mechanism according to the transaction amount of the target mechanism in the set time period and the transaction time corresponding to each transaction; determining whether the current resource usage of the target mechanism exceeds the preset resource usage of the target mechanism, wherein the preset resource usage is determined according to the product of the resource pre-allocated to the target mechanism and the first type of resource pre-allocated to all mechanisms, and the first type of resource is determined according to the product of the preset duration and the total number of threads pre-allocated to all mechanisms; if the first type of resources are exceeded, resources are allocated for the transaction to be processed from the second type of resources, and the second type of resources are resources except the first type of resources in the total resources.
7. The apparatus of claim 6, wherein the processing module is specifically configured to:
determining whether the utilization rate of the second class of resources is greater than a first threshold;
if the utilization rate of the second type of resources is not greater than the first threshold, allocating resources for the transaction to be processed from the second type of resources; or alternatively, the first and second heat exchangers may be,
if the utilization rate of the second-class resources is greater than the first threshold value and the average transaction time of the target mechanism is less than the second threshold value, allocating resources for the transaction to be processed from the second-class resources; the average transaction time of the target institution is determined based on the transaction data of the target institution over a set period of time.
8. The apparatus of claim 7, wherein the processing module is further to:
if the usage rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is less than the second threshold, after allocating resources for the transaction to be processed from the second type of resources, the method further includes:
determining the current occupied resources of the target mechanism according to the transaction data of the target mechanism in a set time period;
and when the current occupied resource of the target mechanism is determined to be larger than a third threshold value, increasing the preset resource of the target mechanism.
9. The apparatus of claim 7, wherein the processing module is further to:
and if the utilization rate of the second type of resources is greater than the first threshold, and the average transaction time of the target mechanism is not less than the second threshold, stopping distributing resources for the transaction to be processed, and reducing preset resources of the target mechanism.
10. The apparatus of any of claims 6 to 9, wherein the processing module is further to:
after resources are allocated to the to-be-processed transaction from the second class of resources, counting the transaction amount of the target mechanism for carrying out the transaction by utilizing the second class of resources;
and when the transaction amount is determined to be larger than a fourth threshold value, increasing preset resources of the target institution.
CN201710606745.6A 2017-07-24 2017-07-24 Resource allocation method and device Active CN107292741B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201710606745.6A CN107292741B (en) 2017-07-24 2017-07-24 Resource allocation method and device
PCT/CN2018/089864 WO2019019807A1 (en) 2017-07-24 2018-06-05 Resource allocation method and device
TW107125302A TWI688905B (en) 2017-07-24 2018-07-23 Resource configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710606745.6A CN107292741B (en) 2017-07-24 2017-07-24 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN107292741A CN107292741A (en) 2017-10-24
CN107292741B true CN107292741B (en) 2023-09-01

Family

ID=60102965

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710606745.6A Active CN107292741B (en) 2017-07-24 2017-07-24 Resource allocation method and device

Country Status (3)

Country Link
CN (1) CN107292741B (en)
TW (1) TWI688905B (en)
WO (1) WO2019019807A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292741B (en) * 2017-07-24 2023-09-01 中国银联股份有限公司 Resource allocation method and device
CN111736981A (en) * 2019-08-01 2020-10-02 北京京东尚科信息技术有限公司 Container resource allocation method, device, equipment and storage medium
CN112181649A (en) * 2020-09-22 2021-01-05 广州品唯软件有限公司 Container resource adjusting method and device, computer equipment and storage medium
CN112130997B (en) * 2020-09-22 2022-09-20 新华三大数据技术有限公司 Resource allocation method and device
CN112529435A (en) * 2020-12-17 2021-03-19 中国农业银行股份有限公司 Resource allocation method and device
CN112596503B (en) * 2020-12-18 2022-04-22 浙江中控技术股份有限公司 Configuration method for scanning period of control system and related equipment
CN114722278B (en) * 2022-03-31 2024-03-08 北京金堤科技有限公司 Information pushing method and device, storage medium and electronic equipment
CN114844834B (en) * 2022-04-29 2024-04-26 中国建设银行股份有限公司 Method and device for adjusting flow control threshold, electronic equipment, medium and product
CN114980333B (en) * 2022-05-20 2024-05-14 中国联合网络通信集团有限公司 Verification method and device of resource allocation result, electronic equipment and storage medium
CN117236903B (en) * 2023-11-09 2024-05-10 浙江浙商互联信息科技有限公司 Intelligent management method and system for high-speed service area

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811154A (en) * 2011-05-31 2012-12-05 阿里巴巴集团控股有限公司 Resource acquisition method and network server system
CN103426040A (en) * 2012-05-14 2013-12-04 中国银联股份有限公司 Research and development management system
KR20140002581A (en) * 2013-12-09 2014-01-08 삼성증권주식회사 Trading system performing dynamic resource management and providing method thereof
CN103559093A (en) * 2013-11-15 2014-02-05 北京中指实证数据信息技术有限公司 Resource allocation method and device for servers
WO2016014943A2 (en) * 2014-07-24 2016-01-28 Rivada Networks Llc Broadband orthogonal resource grouping
CN105678620A (en) * 2016-01-07 2016-06-15 深圳市金证科技股份有限公司 Resource scheduling method and system for transaction system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6546402B1 (en) * 2000-06-05 2003-04-08 International Business Machines Corporation System and method for asynchronous view maintenance
US20130031327A1 (en) * 2011-07-28 2013-01-31 Yung Chang System and method for allocating cache memory
TW201435609A (en) * 2013-03-11 2014-09-16 Chunghwa Telecom Co Ltd Method for asynchronously monitoring data change among multiple devices
CN105988858A (en) * 2015-05-15 2016-10-05 中国银联股份有限公司 Virtual machine resource scheduling method, device and system
CN107292741B (en) * 2017-07-24 2023-09-01 中国银联股份有限公司 Resource allocation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102811154A (en) * 2011-05-31 2012-12-05 阿里巴巴集团控股有限公司 Resource acquisition method and network server system
CN103426040A (en) * 2012-05-14 2013-12-04 中国银联股份有限公司 Research and development management system
CN103559093A (en) * 2013-11-15 2014-02-05 北京中指实证数据信息技术有限公司 Resource allocation method and device for servers
KR20140002581A (en) * 2013-12-09 2014-01-08 삼성증권주식회사 Trading system performing dynamic resource management and providing method thereof
WO2016014943A2 (en) * 2014-07-24 2016-01-28 Rivada Networks Llc Broadband orthogonal resource grouping
CN105678620A (en) * 2016-01-07 2016-06-15 深圳市金证科技股份有限公司 Resource scheduling method and system for transaction system

Also Published As

Publication number Publication date
TWI688905B (en) 2020-03-21
WO2019019807A1 (en) 2019-01-31
TW201909048A (en) 2019-03-01
CN107292741A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN107292741B (en) Resource allocation method and device
CN105447604B (en) Account processing method and device
CN105912403B (en) The method for managing resource and device of Docker container
CN103473137B (en) Deadly embrace avoidance resource allocating method and system
CN107124472A (en) Load-balancing method and device, computer-readable recording medium
CN103810045B (en) Resource allocation methods, explorer, Resource Server and system
CN108154298B (en) Distribution task allocation method and device, electronic equipment and computer storage medium
CN110599315A (en) Resource allocation method, device and equipment for multi-level account
CN109767070A (en) Case distribution method, device, computer equipment and storage medium
WO2016101996A1 (en) Allocating cloud computing resources in a cloud computing environment
CN111738709A (en) Transaction processing method and device
CN111190739A (en) Resource allocation method and device, electronic equipment and storage medium
CN107967650A (en) A kind of batch accounting data processing method and processing device of core banking system
CN107168800A (en) A kind of memory allocation method and device
CN109670932B (en) Credit data accounting method, apparatus, system and computer storage medium
CN106980463A (en) The method for controlling quality of service and device of storage system
US20140047454A1 (en) Load balancing in an sap system
CN107704320B (en) A kind of method for allocating tasks and system of distributed system
CN110865913B (en) Pressure testing method and device
CN114358508A (en) Work order distribution method, device, equipment and medium
CN107196866B (en) Flow control method and device
CN104834570A (en) Cloud computing platform resource management method and cloud computing platform resource management system based on resource pools
CN105824651B (en) A kind of smart card is interior to apply installation method and device
CN109426565A (en) A kind of memory allocation method, device and terminal
CN111352710A (en) Process management method and device, computing equipment and storage medium

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