A kind of resource regulating method and device
Technical field
The application is related to technical field of information processing, more particularly to a kind of resource regulating method and device.
Background technology
Scheduling of resource is a kind of common concepts of Computer Applied Technology field, and it can both refer in an equipment
The scheduling of resource (being, for example, different application assigned processing thread, memory sources etc.) in portion, can also refer to
Task scheduling (being, for example, different equipment distribution bandwidth resources) that can also be between multiple devices.Should at these
With in scene, " resource " is all often limited, and resource user is much larger than resource to the demand of resource
How total quantity, therefore, carry out reasonably dispatching to limited resource, resource utilization tried one's best
Improve, be always researcher's important directions of interest.
Periodic scheduling is a kind of common strategy in scheduling of resource, and this mode is applied to resource user couple
Resource has the application scenarios of regular demand.For example, in a timed task system, application program A
Need to need the 6th~15 point in each integral point in operation in the 1st~10 minute of each integral point, application program B
Clock operation, application program C need running for the 11st~20 minute in each integral point.As can be seen that A and C
The operation period stagger completely, therefore A and C can be set to be multiplexed identical processing thread in theory.Assuming that
A and C operations are required to 5 processing threads, then at the 0th minute of each integral point, by 5 from thread pool
Individual thread is distributed to A and used, and at the 10th minute, after A operations are finished, 5 threads are released back into thread pool,
This 5 threads can distribute to application program C at the 11st minute again and use.
But in actual applications, many application programs are not to maintain during running for the demand of thread
Constant, and more thread often is needed in the starting stage of program operation, with run time
Promote, required number of threads is gradually decreased.For example, application program A needs for 1~5 minute before operation
5 threads, 2 threads were only needed at the 6th~10 minute.Wherein 3 threads will have been used at the 5th minute
Thread pool is released back into advance after finishing, that is to say, that this 3 threads the 6th~10 minute are places each integral point
In a kind of interim complete idle state.All had characteristics that in view of many application programs, therefore
The overall thread resources utilization rate of system is still relatively low.
In addition to processing thread distribution, in some other application scenarios, such as limited bandwidth resource, have
Distribution of cache resources etc. is limited, similar resources idle is also all there is.
The content of the invention
For above-mentioned technical problem, the application provides a kind of resource regulating method and device, and technical scheme is as follows:
According to the 1st of the application the aspect there is provided a kind of resource regulating method, each batch operation is distributed
The resource definition gone out is a resource collection and determines the resource of in a resource collection points of different batches release
Justice is different subset of resources, and methods described includes:
For allocated arbitrary collection, determine that the remaining of each subset takes duration in the set;
Receive the random subset discharged and determine the resource in the subset be interim slack resources after, really
The idle duration of residue of the fixed idle subset;
Distributed and do not discharge other set in, search with the idle subset match it is current occupied
Use subset;Wherein, other described set, different sets are combined into the collection belonging to the idle subset;It is described
Match and be:Occupied subset it is remaining take duration be not more than the idle subset residue leave unused duration and
The resource quantity of occupied subset is not less than the resource quantity of the idle subset;
Function replacement is carried out to the idle subset using the occupied subset found, and will be described idle
Resource identification in subset is non-provisional slack resources;The function is replaced with:Allocation plan of physical resources is carried out
Update, need the resource allocation operations of the idle subset resource bearing for script, carried object and repaiied
It is changed to the resource of found occupied subset.
According to the 2nd of the application the aspect there is provided a kind of resource scheduling device, each batch operation is distributed
The resource definition gone out is a resource collection and determines the resource of in a resource collection points of different batches release
Justice is different subset of resources, and described device includes:
Duration determining module is taken, for for allocated arbitrary collection, determining each subset in the set
Residue takes duration;
Idle duration determining module, for receiving the random subset discharged and determining in the subset
After resource is interim slack resources, determine that the residue of the idle subset is left unused duration;
Searching modul, in other set for having distributed and not discharged, searching and the idle subset phase
The current occupied subset of matching;Wherein, other described set, are combined into the collection belonging to the idle subset
Different sets;The matching is:The remaining duration that takes of occupied subset is not more than the surplus of the idle subset
Spare time puts resource quantity of the resource quantity not less than the idle subset of duration and occupied subset;
Replacement module, for carrying out function replacement to the idle subset using the occupied subset found,
And be non-provisional slack resources by the resource identification in the idle subset;The function is replaced with:To resource
Plan of distribution is updated, and the resource allocation operations of the idle subset resource bearing are needed for script, will
It carries resource of the object modification for found occupied subset.
Technical scheme provided herein, resource is distributed according to different release by each batch operation
Batch cutting is different subset of resources.So, whenever after a subset of resources of actual recovered, if the son
Collection is in interim idle state, then can just in occupied resource, finding can take at that time from currently
The occupied subset of interim idle subset is stated, so that it is not busy that the resource in interim idle subset is converted into non-provisional
Put resource.Because non-provisional slack resources can participate in normal resource allocation without being dispatched by periodic resources
Limitation, hence in so that overall resource utilization has obtained effective lifting.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory,
The application can not be limited.
Brief description of the drawings
, below will be to implementing in order to illustrate more clearly of the embodiment of the present application or technical scheme of the prior art
The accompanying drawing used required in example or description of the prior art is briefly described, it should be apparent that, describe below
In accompanying drawing be only some embodiments described in the application, for those of ordinary skill in the art,
Other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the resource regulating method of the application;
Fig. 2 is the structural representation of the resource scheduling device of the application;
Fig. 3 is the structural representation for configuring a kind of equipment of the application device.
Embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with this Shen
Accompanying drawing that please be in embodiment, the technical scheme in the embodiment of the present application is described in detail, it is clear that institute
The embodiment of description is only some embodiments of the present application, rather than whole embodiments.Based on the application
In embodiment, the every other embodiment that those of ordinary skill in the art are obtained should all belong to this Shen
The scope that please be protect.
During periodic resources scheduling described in background technology is a kind of ideal situation, more practical applications,
Resource user will not typically be completely fixed for the use demand of resource, therefore generally require to reserve
A part of resource, to tackle irregular resource use demand.
Still so that thread resources are dispatched as an example, because each thread can consume internal memory, if the line run simultaneously
Number of passes amount is excessive, and the performance of system can be affected greatly, therefore, typically to meeting default thread pool,
Ensure the performance of system by way of limiting number of threads.The scheme dispatched using periodic resources,
On the premise of number of threads is limited, if the run time of each application program and thread quantity required are all in system
It is relatively-stationary, then by reasonably arranging limited thread resources can be made to obtain fully in theory
Utilization.But in actual applications, it is impossible to all application programs have fixed run time, because
This typically will also retain certain in addition to the application assigned thread performed to periodicity in thread pool
The thread of quantity, demand is performed with the application program for tackling those bursts.In view of this practical application request,
These threads retained can also be considered as a kind of effective resource occupation.
However, when described in the background technology, although application program A releases 3 lines in advance
Journey, but these three threads will also distribute to application program C at the 11st minute to be used, therefore this 3 lines
Journey is interim idle, can not be equal to it is other retain threads, the application program for distributing to burst,
Unless just there is application program to need to use thread at the 6th~10 minute, but such case occurrence probability is very
It is low.
In view of the above-mentioned problems, the application offer resource scheduling scheme is as follows:
First, the resource definition each batch operation distributed is a resource collection, and by one
The resource definition of point different batches release is different subset of resources in resource collection.
And then, for any a resource collection dispensed, based on resource user to resource
Use demand rule, it may be determined that go out the corresponding Resource release time of each subset in the set, so that it is determined that:
The timing since current time, each subset also needs to how long to be released respectively, namely each subset is surplus
Remaining occupancy duration.It is understood that " residue takes duration " of each subset of resources is can be over time
Passage and dynamic reduces.When " residue takes duration " of some subset of resources is changed into 0, it is meant that
Corresponding resource will be released.
On the other hand, the subset of resources being just released for portion, based on it in next dispatching cycle
Use demand, it may be determined that the next time for going out subset correspondence resource is allocated the time, so that it is determined that:From current
Moment starts timing, the subset also need to how long can by sub-distribution again, namely each subset residue it is idle when
Long, in other words, how long the subset will also leave unused temporarily before be allocated next time.It is understood that
" the idle duration of residue " is also over time and dynamically to reduce.
On the basis of above-mentioned definition and explanation, the application provides a kind of resource regulating method, referring to Fig. 1 institutes
Show, this method may comprise steps of:
S101, for allocated arbitrary collection, determines that the remaining of each subset takes duration in the set;
S102, receives the random subset discharged and determines that the resource in the subset is interim slack resources
Afterwards, the idle duration of residue of the idle subset is determined;
Application scheme mainly for " interim slack resources " propose, i.e.,:In current point in time statistics, remain
Spare time puts the subset that duration is more than 0.For non-provisional slack resources, it is understood that there may be two kinds of situations, a class is
It can be dispensed again at once, a length of 0 when corresponding remaining idle;Another kind of is dividing again of not determining
With plan, a length of ∞ when can be considered remaining idle, but it has functionally been equal to reservation resource, Ke Yiren
Meaning participates in unplanned property resource allocation.As can be seen that the situation of this two class " non-provisional slack resources " is actual
And it is not belonging to the resources idle problem domains that the application needs to solve.
S103, in other set for having distributed and not discharged, is searched and working as that the idle subset matches
Preceding occupied subset;
Here " other set " refer to and gather different set belonging to the idle subset, and " matching "
Need while two aspect conditions of satisfaction, are defined as follows:
A) the remaining of occupied subset takes the idle duration of residue that duration is not more than the idle subset;
B) resource quantity of occupied subset is not less than the resource quantity of the idle subset.
S104, function replacement is carried out to the idle subset using the occupied subset found, and by institute
It is non-provisional slack resources to state the resource identification in idle subset;
Here " function replacement " refers to:Original allocation plan of physical resources is updated, needed for script
The resource allocation operations of the idle subset resource bearing are wanted, object modification are carried occupied to be found
With the resource of subset.
" interim " property of " interim slack resources " is mainly reflected in:Although resource is discharged in advance,
The resource is not free in complete meaning, because according to allocation plan of physical resources, the resource will be in future
Some time by sub-distribution again.And technical scheme provided herein, pass through the side of cutting subset of resources
Formula, can recognize within following a period of time, which is currently just in occupied subset of resources meeting in advance
It is released, how long discharges later.And then, in current point in time, for any a " interim idle money
Source " Ri, if it is possible to find that a matched (definition of matching can be found in S103 and say in other set
It is bright) occupied resource Ro, equivalent to that the label of Ri " interim " can be removed, being converted to join
With normal resource allocation, do not dispatched the non-provisional slack resources limited by periodic resources, and belong to originally
" handing-over " is given to the Ro for the task that is currently executing in Ri task.As long as Ro will be in future according to normal
Time is released, it becomes possible to take over the next item down task for originally belonging to R1 in time.
In two matching conditions described by S103, condition a corresponding practical significance is:Ro needs
It can catch up with and be released before Ri is allocated next time;And the corresponding practical significances of condition b are:Ro is needed
There are enough abilities to undertake the originally belonging to Ri of the task.
In actual applications, it is also desirable to, for interim slack resources subset Ri, one can be found
Occupied subset Ro so that the Ro idle duration of the remaining residue for taking duration just equal to Ri and Ro
Resource quantity is just equal to Ri resource quantity;In this case, Ri and Ro is in time and resource quantity side
Face is matched completely, can avoid the phenomenon of " interim idle " completely in theory.It is understood that here
The time delay of the processes such as distribution, release is have ignored on duration, if it is considered that above-mentioned processing delay, actual also
So that matching condition to be set to:It is slightly less than the Ri idle duration of residue, i.e. the two difference during Ro remaining occupancy
Absolute value is less than some default threshold value.
If above-mentioned condition is not easy to meet, the matching strategy of some suboptimums can be further configured, citing is such as
Under:
1) more than two current occupied subsets are searched:Ro1, Ro2 ..., it is desirable to while meet it is as follows
Matching condition:
1.1) Ro1, Ro2 ... remaining residue of the duration no more than Ri that take leave unused duration;It is preferred that
Matching condition is still " being equal to ", if it is considered that distribution processing delay is then " being slightly less than ";
1.2) Ro1, Ro2 ... resource quantity summation be not less than Ri resource quantity;Optimum Matching bar
Part is still " being equal to ".
2) to meet the multiple occupied subset Ro1 of matching condition in S103, Ro2 ... it is remaining take when
Long to carry out descending arrangement, the remaining higher occupied subset of duration that takes of preferential selection is used as lookup result.
3) occupied subset Ro1s multiple to matching condition in S103, Ro2 ... resource quantity risen
Sequence is arranged, and the preferential less occupied subset of resource quantity of choosing is used as lookup result.
As can be seen that the overall principle of above-mentioned suboptimum matching strategy is:As far as possible reduce Ro from " being released " to
" instead of Ri be allocated " between duration and as far as possible enable Ro resource be fully utilized (when
So, unemployed Ro resources can also be converted to non-provisional slack resources, and the application no longer does and further retouched
State), so as to reduce the interim vacancy rate of resource.Under mentioned above principle, those skilled in the art can also be flexible
Other matching strategies are designed, so that more matching strategies are derived, for example can be by above-mentioned matching strategy
It is used in combination, the application is to this and need not be defined.
With reference to some specific application scenarios, application scheme is illustrated:
Embodiment 1:
In a timed task system, application program A need operation in the 1st~10 minute of each integral point,
Application program B needs to need in each integral point in operation in the 6th~15 minute of each integral point, application program C
Run within 11st~20 minute, 3 application program operations are required to 5 processing threads.Due to A and C fortune
The row period staggers completely, and A is identical with Thread Count needed for C operations, therefore A and C can be set to answer
Thread is handled with identical.It is the initialization scheduling flow of thread resources below:
● the 1st minute starts:
5 processing threads are distributed into application program A, with being learnt according to A moving law:There are 3 threads
It will discharge, 2 threads will discharge at the end of the 10th minute, will can distribute at the end of the 5th minute
5 processing thread dividings to application program A are two subsets, as shown in table 1.1:
Subset is numbered |
Resource quantity |
Residue takes duration |
A1 |
3 |
5 minutes |
A2 |
2 |
10 minutes |
Table 1.1
Wherein, " residue takes duration " in table 1.1 is over time and dynamically to reduce.
When " residue takes duration " of some subset of resources is changed into 0, it is meant that corresponding resource will be released.
● terminate within the 5th minute (the 6th minute starts):
First, A1 will be released, according to operation plan, and A1 will be again assigned to application at the 10th minute
Program C, therefore A1 turns into idle subset temporarily, now the temporarily idle subset of system is as shown in table 1.2:
Subset is numbered |
Resource quantity |
The idle duration of residue |
A1 |
3 |
5 minutes |
Table 1.2
The thread situation that now application program A takes is updated as shown in table 1.3:
Subset is numbered |
Resource quantity |
Residue takes duration |
A2 |
2 |
5 minutes |
Table 1.3
On the other hand, started at the 6th minute, 5 processing threads are distributed into application program B, with according to B
Moving law learn:There are 3 threads to be discharged at the end of the 10th minute, 2 threads will be at the 15th point
Discharged at the end of clock, then it is two subsets that distributed to application program B 5 can be handled into thread dividings,
As shown in table 1.4:
Subset is numbered |
Resource quantity |
Residue takes duration |
B1 |
3 |
5 minutes |
B2 |
2 |
10 minutes |
Table 1.4
Now, for interim idle subset A1, B1 can be found and meet foregoing " matching condition ":B1
Residue take duration be not more than A1 residue leave unused duration, B1 and A1 resource quantity it is equal, and B1 and
A1 is belonging respectively to different set.Therefore function replacement can be carried out to A1 and B1.After replacing it, A1
Just become non-provisional slack resources, can participate in normal resource allocation, not dispatched by periodic resources
Limitation.
● terminate within the 10th minute (the 11st minute starts):
A2 and B1 are released, and due to replacement operation before, now script allocative decision is " by A1+A2
Application program C " is distributed to be changed into " B1+A2 being distributed into application program C ".
B1+A2 distributes to application program C, a new resource collection is formd again, if application program C
Also there is fixed thread release rule, then count the remaining of each subset in the set again and take duration.
Embodiment 2:
In comprehensive business system, the renewal time point of different server service data is different with the update cycle,
And after business datum just updates, the visit capacity of service server than it is larger, it is necessary to access side provide compared with
High access bandwidth, over time, visit capacity is gradually reduced, and can also be accordingly gradually reduced also
To accessing the access bandwidth that side is provided.
Based on above-mentioned primary demand, it is assumed that in an operation system, comprising needing periodic allocation access bandwidth
Service A, B, C of resource.
Server A updates business datum at daily 0 point and 12 points, needs to distribute for it in renewal time point
Access bandwidth 300M, often spends 4 hours and reclaims 100M, until next renewal time point is accessed again
Bandwidth is recovered to 300M.
Server B updates business datum at daily 4 points and 16 points, needs to distribute for it in renewal time point
Access bandwidth 150M, often spends 4 hours and reclaims 50M, until next renewal time point is accessed band again
Width recovers to 150M.
Server C updates business datum at daily 4 points and 16 points, needs to distribute for it in renewal time point
Access bandwidth 150M, often spends 4 hours and reclaims 50M, until next renewal time point is accessed band again
Width recovers to 150M.
Therefore A and C can be set to be multiplexed identical processing access bandwidth.It is below the first of access bandwidth resource
Beginningization scheduling flow:
● 0 o'clock:
300M access bandwidths are distributed into server A, with being learnt according to A moving law:There is 100M respectively
Access bandwidth will discharge after 4 hours, 100M access bandwidths will discharge after 8 hours, and 100M accesses band
Width will after 12h discharge and (actually be equivalent to and do not discharge, be that unifying identifier can be considered distribution immediately after release),
The 300M access bandwidths for having distributed to server A can be divided into 3 subsets, as shown in table 2.1:
Subset is numbered |
Resource quantity |
Residue takes duration |
A1 |
100M |
4 hours |
A2 |
100M |
8 hours |
A3 |
100M |
12 hours |
Table 2.1
Wherein, " residue takes duration " in table 2.1 is over time and dynamically to reduce.
When " residue takes duration " of some subset of resources is changed into 0, it is meant that corresponding resource will be released.
● 4 o'clock:
First, A1 will be released, according to operation plan, and A1 will be again assigned to server at the 12nd point
A, therefore A1 turns into idle subset temporarily, now the temporarily idle subset of system is as shown in table 2.2:
Subset is numbered |
Resource quantity |
The idle duration of residue |
A1 |
100M |
8 hours |
Table 2.2
The access bandwidth situation that now server A takes is updated as shown in table 2.3:
Subset is numbered |
Resource quantity |
Residue takes duration |
A2 |
100M |
4 hours |
A3 |
100M |
8 hours |
Table 2.3
On the other hand, 150M access bandwidths are distributed into server B, 150M access bandwidths is distributed into clothes
Be engaged in device C.With the moving law according to B and C, the 150M for having distributed to server B can be accessed respectively
Bandwidth partition is divided into 3 subsets for 3 subsets, by the 150M access bandwidths for having distributed to server C,
As shown in table 2.4 and 2.5:
Subset is numbered |
Resource quantity |
Residue takes duration |
B1 |
50M |
4 hours |
B2 |
50M |
8 hours |
B3 |
50M |
12 hours |
Table 2.4
Subset is numbered |
Resource quantity |
Residue takes duration |
C1 |
50M |
4 hours |
C2 |
50M |
8 hours |
C3 |
50M |
12 hours |
Table 2.5
Now, for interim idle subset A1, from occupied subset B1 of other current set, B2, C1,
In C2, it is impossible to find independent a subset satisfaction and A1 matching condition, reason is corresponding resource quantity
It is different.It is excellent for the ease of management but the combination of any two resource can meet the matching condition with A1
First select the remaining duration identical subset that takes to be combined, as a result include:And (B2+C2), (B1+C1)
Further according to " the preferential higher occupied subset of remaining occupancy duration of choosing is used as lookup result ", final choosing
The result taken is (B2+C2).Can now function replacement be carried out to A1 and (B2+C2).After replacing it,
A1 just becomes non-provisional slack resources, can participate in normal resource allocation, not dispatched by periodic resources
Limitation.
● 8 o'clock:
A2, B1, C1 are released, as idle subset;A length of 4 hours when wherein A2 residue is idle,
A length of 8 hours when B1, C1 residue are idle.According to present embodiment assumes that the limitation of condition, currently to A2,
B1, C1 can not find the replaceable subset of resources of matching, but in actual applications, it is likely that there is it
His server, which can be provided in interchangeable subset of resources, the present embodiment, no longer does extended description.
● 12 o'clock:
Need to redistribute 300M resources to server A, according to replacement operation before, now distribute originally
Scheme " A1+A2+A3 is distributed into server A " is changed into " (C2+B2)+A2+A3 being distributed into clothes
Be engaged in device A, and forms a new resource collection again.
Embodiment 3:
Application scheme can be applied in allocation of financial resource, to reduce the vacancy rate of fund.To borrow or lend money
Exemplified by business, it is assumed that there are the credit side x and debit y of debtor-creditor relationship:January 1, x provided one to y
The loan that total value is 12000 yuan, the time limit is 3 months, mode of satisfaction is monthly repaid for point 3 phases.Make loans
After success, x accordingly have a total value be 12000 yuan, the time limit be 3 months credits.In order to obtain as early as possible
Income is obtained, this credits is sold to z by x in the form of assets are transferred the possession of quickly, and (activity price can be in loan
Floated above and below principal and interest summation in certain limit, unrelated with application scheme), and arrange x after 3 months expire
Principal and interest is settled accounts to z in the lump.
Discounting for the improper factor such as overdue, x will be 1 day 2 months, March 1, and April 1 is respectively
Receive 3 refund cashes from y.For x:On the one hand, the refund cash received every time is actual
It is to return z to own, therefore can not freely allocates;On the other hand, because x and z agreement is to expire for 3 months
Disposable clearance, therefore the refund cash from y that earlier month is received afterwards, before final statement day,
Actually it is constantly in idle state.
It can be seen that, in above-mentioned business, the refund cash from y that x is received in the past few months complies fully with this
" interim slack resources " described in application, and for " fund " this resource, also one weight
The characteristics of wanting:Idle fund can not obtain income, only by modes such as loan, investments, could make fund
Constantly increment.
In order to avoid leave unused capital, a kind of scheme for being readily apparent that is:After installment reimbursement cash is received every time,
New, relatively short-term a loan is provided again using this cash.For example, it is also desirable to:X is 2
The first phase that the moon is received from y on the 1st refunds after (assuming that total value is 4200 yuan), provides one again immediately always
The loan that volume is 4200 yuan, the time limit is 2 months.But be actually difficult to encounter what is so matched completely just
Demand for loan, so even a short term loan can be provided successfully, be also often amount, time limit etc. it is multi-party
Face be adjusted after result.Interim leave unused of fund is still unavoidable from.
And apply and provided resource scheduling scheme is provided itself, then it can efficiently solve above mentioned problem.
First, in actual applications, as the dispatching party of resource, credit side x should have some money financial products,
And be always adapted in different time points, different debit y1, y2, y3 ... from the selection of these financial products
The product that oneself needs, and be bound to give back fund to x by stages according to product agreement.Based on such
Application scenarios, each loan that can provide x is considered as a resource collection, according to repayment schedule, will
Corresponding cash flow of refunding every time is considered as a subset of resources.
For allocated arbitrary collection, determine that the remaining of each subset takes duration in the set;
Receive the random subset discharged and determine the resource in the subset be interim slack resources after, really
The idle duration of residue of the fixed idle subset;
Distributed and do not discharge other set in, search with the idle subset match it is current occupied
Use subset;Wherein, other described set, different sets are combined into the collection belonging to the idle subset;It is described
Match and be:Occupied subset it is remaining take duration be not more than the idle subset residue leave unused duration and
The resource quantity of occupied subset is not less than the resource quantity of the idle subset;
Function replacement is carried out to the idle subset using the occupied subset found, and will be described idle
Resource identification in subset is non-provisional slack resources;The function is replaced with:Allocation plan of physical resources is carried out
Update, need the resource allocation operations of the idle subset resource bearing for script, carried object and repaiied
It is changed to the resource of found occupied subset.Corresponding fund concocting method is as follows:
Often provide after a loan, according to repayment schedule, determine every cash flow gives back the time.
Often receive after an installment reimbursement cash flow Ri, determine the idle duration of residue of this cash flow.Then
In other all pens have been offered loans, search with the pen that refund cash flow Ri has matched that (what is matched determines
Justice can be found in preceding embodiment introduction, repeat no more here) the cash flow Ro that do not refund.After searching successfully,
Function replacement is carried out to Ri and Ro, the corresponding cash flows of Ri turn into complete idle fund, Ke Yi after replacement
In the case of unrestricted, (such as investment, housing loan) continues to live in any form.And arrive the final accounting period
When, Ro also has become cash flow of having refunded, and the cash flow corresponding to Ri will be replaced to participate in final clearing.
Illustrated with reference to example:
Assuming that bank x provides Annual Percentage Rate to be to personal user is 3 months in 18%, time limit, mode of satisfaction is points 3
The loan product of phase monthly " equal principal ".And there is a large number of users " to use " product.
● on January 1st, 2015:
It is that 12000, Annual Percentage Rate is the loan that 18%, time limit is 3 months that x has provided a total value to user y1
Money, mode of satisfaction for point 3 phases, monthly repay by " equal principal ".Repayment schedule is as shown in table 3.1:
Refund the date |
Month refund total value |
Capital |
Interest |
2015/2/1 |
4120.60 |
3940.60 |
180.00 |
2015/3/1 |
4120.60 |
3999.70 |
120.89 |
2015/4/1 |
4120.60 |
4059.70 |
60.90 |
Table 3.1
After loan origination success, x is by the assignment of credit to z1, and Settlement Date is on April 1st, 2015.So
Offered loans for upper one, can be 3 cash flows according to repayment schedule cutting, be considered as 3 resources
Subset, as shown in table 3.2:
Subset is numbered |
Resource quantity |
It is remaining away from repayment date |
1.1 |
4120.60 |
1 month (approximate) |
1.2 |
4120.60 |
2 months (approximate) |
1.3 |
4120.60 |
3 months (approximate) |
Table 3.2
Scheme is illustrated for convenience, " remaining away from repayment date " approximate table in units of the whole month in table 3.2
Show, more accurate statistical method can be used in actual applications, this has no effect on the reality of application scheme
It is existing.
● on 2 1st, 2015:
X receives the first stroke from y1 and refunded, and the amount of money is 4120.60 yuan.This cash actually belong to by
Transfer the possession of assets, it is necessary to April 1 in 2015 daily settlement to z1, therefore this cash turns into idle subset temporarily,
Subset of now leaving unused temporarily is as shown in table 3.3:
Subset is numbered |
Resource quantity |
The idle duration of residue |
1.1 |
4120.60 |
2 months (approximate) |
Table 3.3
And now the outstanding amount of money situations of y1 are updated as shown in table 3.4:
Table 3.4
For example, it is assumed that now just have user y2 to x borrowed a total value be 12000, Annual Percentage Rate be 18%,
Time limit is the loan of 3 months, and mode of satisfaction for point 3 phases, monthly repay by " equal principal ".For the pen
Offer loans, can be 3 cash flows according to repayment schedule cutting, be considered as 3 subset of resources, such as table 3.5
It is shown:
Subset is numbered |
Resource quantity |
It is remaining away from repayment date |
2.1 |
4120.60 |
1 month (approximate) |
2.2 |
4120.60 |
2 months (approximate) |
2.3 |
4120.60 |
3 months (approximate) |
Table 3.5
Now, for interim idle subset 1.1, subset 2.2 can be found and meet matching condition, therefore utilized
Subset 2.2 carries out function replacement, after the completion of replacement, 4120.60 yuan of cash flows corresponding to 1.1 with subset 1.1
, can be in the case of unrestricted, in any form (such as investment, housing loan) as complete idle fund
Continue to live.
It should be noted that the situation of above-mentioned " just having user y2 to borrow or lend money money to x ", is for only for ease of
A kind of citing of explanation scheme.In fact, because x loan is long-term externally offer, and have a large number of users
" use " product, therefore, even without the situation of above-mentioned " just ", remains on very big possibility
In other loans provided, the subset matched with subset 1.1 is found, by lookup result and subset
1.1 carry out function replacement.Therefore said circumstances should not be construed as the limitation to application scheme.
● on March 1st, 2015:
X receives second refund from y1, and the amount of money is 4120.60 yuan.This cash actually belong to by
Transfer the possession of assets, it is necessary to April 1 in 2015 daily settlement to z1, therefore this cash turns into idle subset temporarily,
Subset of now leaving unused temporarily is as shown in table 3.6:
Table 3.6
And now the outstanding amount of money situations of y1 are updated as shown in table 3.7:
Subset is numbered |
Resource quantity |
It is remaining away from repayment date |
1.3 |
4120.60 |
1 month (approximate) |
Table 3.7
For convenience of description, here it is still assumed that now just there is user y3 to borrow a total value for 12000 to x,
Annual Percentage Rate is the loan that 18%, time limit is 3 months, and mode of satisfaction for point 3 phases, monthly repay by " equal principal "
Also.Offered loans for the pen, can be 3 cash flows according to repayment schedule cutting, be considered as 3 moneys
Source subset, as shown in table 3.8:
Subset is numbered |
Resource quantity |
It is remaining away from repayment date |
3.1 |
4120.60 |
1 month (approximate) |
3.2 |
4120.60 |
2 months (approximate) |
3.3 |
4120.60 |
3 months (approximate) |
Table 3.8
Now, for interim idle subset 1.2, subset 3.1 can be found and meet matching condition, therefore utilized
Subset 3.1 carries out function replacement, after the completion of replacement, 4120.60 yuan of cash flows corresponding to 1.2 with subset 1.2
As complete idle fund, it can continue to live in any form in the case of unrestricted.
● on April 1st, 2015:
X receives the 3rd refund from y1, and the amount of money is 4120.60 yuan.Now x and z1 assets transfer
Account day has arrived.Further according to y2 and y3 repayment schedule, now subset 2.2 and subset 3.3 are corresponding also
Money cash flow just arrives account, according to replacement result twice before, x will utilize subset 2.2 (be used for replace 1.1),
Cash flow corresponding to subset 3.1 (being used to replace 1.2) and subset 1.3 is settled accounts with z1.
It can be seen that, using application scheme, by the way that assets are carried out with cutting, restructuring, breach the fund time limit
Constraint.As long as one is transferred the possession of assets within the distribution phase, occur refund at least twice behavior, such as single-candidate capital
Loan, equal principal loan, credit card installment reimbursement etc., can will every time be received using application scheme
Refund cash be converted to complete idle fund so that this part fund can not constrained by the time limit
In the case of, continue to come into operation.Also, changed by carrying out mutually scheduling between many assets, it is theoretical
On leave unused capital rate can be compressed to 0.
Corresponding to above method embodiment, the application also provides a kind of resource scheduling device, shown in Figure 2,
The device can include:
Duration determining module 110 is taken, for for allocated arbitrary collection, determining each subset in the set
Remaining take duration;
Idle duration determining module 120, for receiving the random subset discharged and determining in the subset
Resource be interim slack resources after, determine that the residue of the idle subset is left unused duration;
Searching modul 130, in other set for having distributed and not discharged, searching and idle subset phase
The current occupied subset matched somebody with somebody;Match and be:The remaining duration that takes of occupied subset is not more than idle subset
The resource quantity of the idle duration of residue and occupied subset is not less than the resource quantity of idle subset;
Replacement module 140, for carrying out function replacement to idle subset using the occupied subset found,
And the resource identification in subset is would sit idle for for non-provisional slack resources;Function is replaced with:To allocation plan of physical resources
It is updated, the resource allocation operations of idle subset resource bearing is needed for script, object is carried and repaiied
It is changed to the resource of found occupied subset.
In a kind of embodiment of the application, searching modul 140 can be specifically for:
Search more than two current occupied subsets;
When the remaining occupancy duration of the current occupied subset of two or more is idle no more than the residue of idle subset
The resource quantity summation of the long and occupied subset of two or more is not less than the resource quantity of idle subset.
In a kind of embodiment of the application, searching modul 140 can be specifically for:
Search the occupied subset for meeting following condition:
Occupied subset it is remaining take duration be equal to idle subset residue leave unused duration,
And the resource quantity of occupied subset is equal to the resource quantity of idle subset.
In a kind of embodiment of the application, searching modul 140 can be specifically for:
The remaining duration that takes of occupied subset to meeting matching condition carries out descending arrangement, preferential to choose surplus
The remaining higher occupied subset of duration that takes is used as lookup result.
In a kind of embodiment of the application, searching modul 140 can be specifically for:
The resource quantity of occupied subset to meeting matching condition carries out ascending order arrangement, preferentially chooses number of resources
Less occupied subset is measured as lookup result.
Said apparatus provided herein can apply in the equipment such as PC, mobile phone, server,
It is a kind of device hardware structural representation for being used to configure said apparatus provided herein shown in Fig. 3,
The equipment can include:Processor 1010, memory 1020, input/output interface 1030, communication interface
1040 and bus 1050.Wherein processor 1010, memory 1020, input/output interface 1030 and communication
Interface 1040 passes through the communication connection between the realization of bus 1050 in device interior.
Processor 1010 can using general CPU (Central Processing Unit, central processing unit),
Microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC),
Or the mode such as one or more integrated circuits is realized, for performing relative program, to realize that the application is carried
The technical scheme of confession.
Memory 1020 can use ROM (Read Only Memory, read-only storage), RAM
(Random Access Memory, random access memory), static storage device, dynamic memory etc.
Form is realized.Memory 1020 can store an operating system and other applications, pass through software or solid
Part realizes that during technical scheme provided herein, related program code is stored in memory 1020,
And execution is called by processor 1010.
Input/output interface 1030 is used to connect input/output module, to realize information input and export.It is defeated
Equipment can also be external in carry as component Configuration (not shown) in a device by entering output/module
For corresponding function.Wherein input equipment can include keyboard, mouse, touch-screen, microphone, all kinds of sensings
Device etc., output equipment can include display, loudspeaker, vibrator, indicator lamp etc..
Communication interface 1040 is used for connection communication module (not shown), to realize that this equipment is set with other
Standby communication interaction.Wherein communication module can be realized logical by wired mode (such as USB, netting twine)
Letter, can also wirelessly realize communication (such as mobile network, WIFI, bluetooth).
Bus 1050 includes a path, equipment each component (for example processor 1010, memory 1020,
Input/output interface 1030 and communication interface 1040) between transmit information.
Although it should be noted that the said equipment illustrate only processor 1010, memory 1020, input/
Output interface 1030, communication interface 1040 and bus 1050, but in specific implementation process, this sets
It is standby to include realizing other assemblies necessary to normal operation.In addition, those skilled in the art can be with
Understand, can also be only comprising component necessary to application scheme be realized, without wrapping in the said equipment
Containing all components shown in figure.
As seen through the above description of the embodiments, those skilled in the art can be understood that this
Application can add the mode of required general hardware platform to realize by software.Understood based on such, this Shen
The part that technical scheme please substantially contributes to prior art in other words can be in the form of software product
Embody, the computer software product can be stored in storage medium, such as ROM/RAM, magnetic disc,
CD etc., including some instructions to cause a computer equipment (can be personal computer, server,
Or the network equipment etc.) perform method described in some parts of each embodiment of the application or embodiment.
Each embodiment in this specification is described by the way of progressive, identical phase between each embodiment
As part mutually referring to what each embodiment was stressed is the difference with other embodiment.
For device embodiment, because it is substantially similar to embodiment of the method, so describing to compare
Simply, the relevent part can refer to the partial explaination of embodiments of method.Device embodiment described above is only
It is only illustrative, wherein the module illustrated as separating component can be or may not be physics
It is upper separated, when implementing application scheme can the function of each module in same or multiple softwares and/or
Realized in hardware.Some or all of module therein can also be selected to realize this reality according to the actual needs
Apply the purpose of a scheme.Those of ordinary skill in the art are without creative efforts, you can with
Understand and implement.
Described above is only the embodiment of the application, it is noted that for the common of the art
For technical staff, on the premise of the application principle is not departed from, some improvements and modifications can also be made,
These improvements and modifications also should be regarded as the protection domain of the application.