Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification one or more embodiment,
Below in conjunction with the attached drawing in this specification one or more embodiment, to the technology in this specification one or more embodiment
Scheme is clearly and completely described, it is clear that and described embodiment is only this specification a part of the embodiment, rather than
Whole embodiments.Based on this specification one or more embodiment, those of ordinary skill in the art are not making creativeness
The range of disclosure protection all should belong in every other embodiment obtained under the premise of labour.
Fixed date total system fish for it is all be not carried out successful business and retried, when the number of services retried compared with
When more, a large amount of system resource will be consumed.Wherein, partial service has a characteristic that some execute the business of failure, is executing
When multiple business retries, number of retries is more, and success rate is lower.
For example, it is assumed that have the execution of charge operation be unsuccessfully since the account balance deficiency of trade company causes, if that
The business carried out many times retries, and has certain time interval between retrying per business twice, still always remaining sum
Deficiency retries, it is more likely that still fail even when being further continued for carry out business.Moreover, number of retries is more, substantially more energy
Determine the state that trade company will keep account not supplement with money, then it is lower to the estimation of success rate.
The business retried for having the characteristics that above-mentioned business, when carry out business retries, so that it may take certain arrange
Apply the consumption reduced to system resource.Based on this, at least one embodiment of this specification provides a kind of business and retries method, should
Method is intended to reduce a large amount of business and retries consumption to resource.
This method can be when executing service fail, and determination retries time interval, and it is to the industry that this, which retries interval duration,
Business carry out business business adjacent twice when retrying retry between time interval." retrying interval duration " tool that this method determines
Have following features: when the business number of retries gradually increases, the interval duration that retries also is gradually increased.For example,
Business executes for the first time and first time business retry between the interval duration that retries can be 1 day, second of business is retried with first
Secondary business retry between retry interval duration can be 3 days, third time business retry with second of business retry between weight
Examination interval duration can be 6 days, etc..It can be seen that the number that business retries is more, it is bigger to retry interval duration.
It is specific determine described in " retry interval duration " method can there are many, several determinations particularized below retry the time
The example at interval, including but not limited to:
For example, can according to business number of retries and it is scheduled retry time set-up mode determination retry interval duration,
This, which retries time set-up mode, can be a kind of formula.For example, between the formula can be used to indicate that business number of retries and retry
Functional relation between duration, illustratively, business, which is retried, next time retries interval duration between the execution of this business
It is " current retries interval duration "+N days, wherein N is business number of retries.For example, following table 1 illustrates under the formula
Retry interval duration calculating:
Table 1 retries interval duration
Business number of retries |
Retry interval duration |
1 |
0+1=1 |
2 |
1+2=3 |
3 |
3+3=6 |
4 |
6+4=10 |
5 |
10+5=15 |
In another example the above-mentioned scheduled time set-up mode that retries can be setting business number of retries and retry interval duration
Between a kind of corresponding relationship, but the corresponding relationship is independent of business number of retries.It lower is retried every time for example, can recorde
When currently retry interval duration, and retry interval duration in the current base for retrying interval duration for what business next time retried
It is double on plinth.For example, the interval duration (i.e. apart from the time interval for executing failure for the first time) that retries when first time business retries is 1
It, can recorde down " 1 ", and determines and retry interval duration (i.e. distance when " 1*2=2 days " are retried as second of business
The time interval that first time business retries).In this example, the determination for retrying the specific value of interval duration is based on one
Secondary retries interval duration, without including business number of retries as " " current retries interval duration "+N days ".But,
It business number of retries and retries interval duration and establishes corresponding relationship, e.g., " first time business retries --- 1 day ", " second of industry
Business retries --- and 2 days ", " third time business retries --- and 4 days ".
Alternatively, for another example be also possible to next time retry interval duration will be than adjacent last time when retrying interval
It is long 2 days more.Deng.--- 3 days ", " second of business retries --- 5 days for example, first time business retries ", " third time business weight
Examination --- 7 days ".
Other examples are no longer lifted in detail, as long as it is bigger to meet the more multiple examination interval duration of business number of retries.
After determination retries interval duration, interval duration execution can be retried according to this, business of business is retried.For example,
First time business retries and second of business retry between retry interval duration be 2 days, then just being retried in first time business
Two days after execution, carries out secondary business and retry.
The business that one this specification one or more embodiment of Fig. 1 example provides retries the process of method, may include:
In step 100, when business executes failure, record traffic number of retries.
For example, the business number of retries of can recorde is 0 when business executes failure for the first time.When having carried out first time business
It can new business number of retries be more 1 when retrying, similarly, and so on.
In a step 102, according to business number of retries and it is scheduled retry time set-up mode, determine business next time
It retries and retries interval duration between the execution of this business.
This step can determine that business next time is retried and execute that (this business execution can be holds for the first time with this business
Row, be also possible to execute the business executed after failure for the first time retry) between retry interval duration.
For example, carrying out first time business when business executes failure for the first time after described " retrying interval duration " and retrying.
In another example carrying out second of business after execution first time business retries after described " retrying interval duration " and retrying.Than
Such as, interval duration can be retried according to the determination of the mode of table 1.
Simple in order to implement, this number retried with business increases and retries the retry mechanism that interval duration increases,
Can be applied to it is all retry business, i.e., whether differentiated service does not have the characteristics that this " when executing multiple business and retrying, is retried
Number is more, and success rate is lower ".On the one hand, for not having the business of the feature, it will usually be retried just in preceding business several times
It is able to carry out success, too much influence can't be caused to the execution efficiency of this partial service;On the other hand, for having the spy
The business of point also can reduce the consumption to resource by this gradually sparse mechanism retried just.It is of course also possible to only
It is also possible to retrying using this method for partial service, for example, the partial service can carry out specified selection.
What each secondary business retried retries interval duration timing machine really, can be when business executes failure for the first time, once
The business that pre-determined number is calculated in property, which retries, corresponding retries interval duration.It " is held after 1 day for example, can be calculated
Row first time business retries, and is then spaced second of the business of progress in 2 days again and retries, is then spaced 4 days progress third time business again
Retry ", when waiting execution third time business to retry, retried followed by the business for calculating next group pre-determined number corresponding heavy
Examination interval duration, for example, " carrying out the 4th business after being spaced 7 days to retry, being then spaced the 5th business weight of progress in 11 days again
Examination ", etc..In another example the business next time that calculates, which is retried, executes it with this business when can also be that business of every execution retries
Between retry interval duration.
At step 104, when retrying interval duration described in the arrival, carry out business is retried.
In this step, when judging whether to retry interval duration described in arrival, a kind of judgment mode of example: can be each
When carry out business retries, record and retry the time, then calculate current time when judging and this retry between the time when
Between it is poor, whether which, which reaches described, retries interval duration.When retrying interval duration described in the arrival, carry out business is retried.
In step 106, if retrying success, terminate this business.In this step, when business retries each time, if
Success is retried, then does not continue to carry out business and retries, service ending.
In step 108, if retrying failure, the business number of retries is updated, and continues to determine that business retries next time
It is corresponding to retry interval duration.
In this step, when business retries each time, if retrying failure, needs to continue business and retry.So root
According to the method for this example, lower business number of retries can be updated, i.e. business number of retries adds 1, and according to the mode of step 102 after
Business retries and corresponding retries interval duration next time for continuous determination.
The business retries method, by when business number of retries gradually increases, setting next time business retry and this
Business execute between retrying interval duration be also gradually increased so that retrying of retrying of business is spaced in gradually rarefaction, then
The consumption to resource can be reduced.Furthermore for the business that each executes failure, independent it can execute above-mentioned
Business retries method, and the business that can disperse different business retries the time, avoids fishing for the business of magnanimity in the same time as far as possible
It is retried, can also reduce the consumption to system resource.
The business that Fig. 2 example this specification one or more embodiment provides retries the process of method, and this method is to collect
For real-time bill in charge system is checked and write off, the processing of this method is illustrated:
In step 200, operation system requests charge information, and obtains charging result, such as need to collect X to trade company A
Expense, total Y member.
In this step, operation system can be gone to charge system request to some trade company carry out charging, from charge system to
Operation system returns to charging result, collects Y member to trade company A.
In step 202, operation system sends Charge message to charging system.
For example, charging system is for charging to trade company, then operation system can send obtained charging result
To charging system, indicate that charging system whereabouts trade company A collects Y member.
In step 204, charging system generates bill, key message is recorded, for example, collecting X expense, total Y to trade company A
Member, concurrent message are handled to system of checking and writing off.In this step, charging system can indicate that checking and writing off management system carries out bill processing,
It goes to execute checking and writing off for real-time bill.
In step 206, charge is caused to fail since billing and accounting system is busy or trade company's A account balance is insufficient at this time.
In this step, the account balance that management system removes Accounting system inquiry trade company A again is checked and write off, if account balance fills
Foot, then can check and write off above-mentioned bill;Otherwise, if originals such as the account balance deficiency or billing and accounting system of trade company A are busy
Cause can cause to check and write off unsuccessfully.
In a step 208, it checks and writes off management system and recognizes scene needs and retry, register a dynamic task, dynamic is appointed
Business needs to retry according to specified time interval.
In this step, management system is checked and write off after checking and writing off unsuccessfully, so that it may control centre be gone to register a dynamic task.Institute
The dynamic task stated refers to that the task can periodically carry out triggering operation.Task is checked and write off for any one real-time bill, when appoint
When business executes failure, one dynamic task of the corresponding registration in control centre can be removed.The effect of the dynamic task is so that scheduling
Center can periodically go triggering check and write off management system carry out business retry.
In addition, could be aware that this dynamic is appointed when control centre receives the dynamic task registration for checking and writing off management system
Corresponding real-time bill of being engaged in checks and writes off task and executes failure for the first time, is not retried also, subsequent to need to trigger by control centre
It checks and writes off management system execution business to retry, then it is 0 that control centre, which can recorde current business number of retries, and subsequent execution is primary
After business retries, cumulative 1, and so on.
Furthermore checking and writing off management system side can have multiple real-time bills to check and write off task, it is also possible to will appear multiple tasks all
Failure is executed, then checking and writing off the corresponding dynamic task of task, Ke Yifen to separate different bills in real time in control centre lateral areas
Not Tian Jia Different Dynamic task mark.Illustratively, task, corresponding dynamic task are checked and write off for the real-time bill of trade company A
It can recorde as the merchant identification of trade company A.Similarly, the real-time bill of trade company B is checked and write off the corresponding dynamic task of task and be can recorde
For the merchant identification of trade company B.It can certainly be using other mark differentiation modes.
It is retried due to checking and writing off management system progress business by control centre, control centre can be known as appointing
Be engaged in triggering side, will check and write off management system and is known as task execution side, what the task triggering side was used to be registered according to business execution side
Dynamic task is sent to business execution side retries task triggering.
In step 210, control centre's determination retries interval duration as unit of day, for example, between n-th retries
It is divided into that (N-1) is secondary to be retried interval+N days.
The interval duration that retries in this step is described in a mode as an example, not limited to this.
For example, being divided into 0+1=1 days between retrying for the 1st time.
It is divided into 1+2=3 days between retrying for 2nd time.
It is divided into 3+3=6 days between retrying for 3rd time.
The 4th is divided into 6+4=10 days between retrying.It is subsequent and so on, no longer it is described in detail.
In addition, control centre when determination retries interval duration, can go out corresponding subsequent multiple business with one-time calculation
What is retried retries interval duration, for example, calculated that the 1st business retry retries interval duration, the weight that the 2nd business retries
Examination interval duration, what the 3rd business retried retries interval duration etc.;It is also possible that only calculating the weight that business retries next time
Examination interval duration, waits and performs after business retries next time, then calculate down that business next time retries retry interval duration.May be used also
To use other modes.
It since the number that business retries is more, retries interval duration and is also gradually increased, in order to avoid influencing to retry when N is excessive
Failure, can set a business number of retries maximum value, when business number of retries reaches scheduled number maximum value, this is most
Big value time business retry it is corresponding retry to be spaced duration and will continue to use to business always retry success.For example, it is assumed that business retries time
Number maximum value N are 15, then the 15th business, which retries the corresponding interval duration that retries, can continue to use to business always and retry success,
For example, the 16th business retries the interval duration that retries that retries with the 17th business, also to use the 15th business to retry corresponding
Retry interval duration.
In the step 212, interval duration is retried described in the arrival, control centre, which sends to retry to the business execution side, to appoint
Business triggering, is retried with triggering the business execution side carry out business.
For example, the control centre as task triggering side can retry task to management system transmission is checked and write off after 1 day
Triggering, triggering, which checks and writes off management system and executes the 1st business, to be retried, and is checked and write off management system whereabouts Accounting system and mend and checks and writes off.
In step 214, business executes root and retries according to triggering carry out business.
Management system is checked and write off after carry out business retries as business execution side, can feed back a weight to control centre
Test result, this is retried the result is that retrying successfully or retrying failure.
In the step 216, business executes direction triggering side feeding back unsuccessful result.
For example, failure can be retried to control centre's feedback by checking and writing off management system after the 1st business retries.
In step 218, control centre updates the business number of retries, and continues to determine that business retries correspondence next time
Retry interval duration.In this step, control centre receive check and write off management system feedback when retrying unsuccessfully, can update
Business number of retries is 1, and continues to determine how long interval carries out the 2nd business and retry, and retrying interval duration is 1+2=3 days.
In a step 220, when control centre retries interval duration described in the arrival, to the business side of executioning transmission task
Triggering, is retried with triggering the business execution side carry out business.
For example, after being spaced 3 days, control centre retries task triggering to checking and writing off management system transmission again, to trigger core
Pin management system carries out the 2nd business and retries.
In step 222, management system progress business is checked and write off to retry.
Similarly, it checks and writes off management system and can also be fed back after retrying and retry result.
Assuming that have passed through after multiple business retries, success is retried, thens follow the steps 224.
In step 224, it checks and writes off management system and retries success to control centre's feedback.
In step 226, control centre terminates dynamic task.
In the example of above-mentioned Fig. 2, the update of business number of retries can be executed by control centre side and retries interval
The calculating of duration, and management system progress business weight is checked and write off according to the interval duration triggering that retries being calculated by control centre
Examination, until business retries success.
The business that Fig. 3 example this specification one or more embodiment provides retries the process of method, example shown in Fig. 3
In son, the update of business number of retries and the calculating for retrying interval duration can also be executed by checking and writing off management system, and be dispatched
Center only needs clocked flip, i.e., control centre can timing to the triggering for checking and writing off management system and sending the task that retries, and
Whether business is executed according to the triggering to retry, then can retry interval duration by check and write off that management system calculates according to oneself come true
It is fixed.May include handling as follows:
Wherein, step 300 is identical to step 206 as the step 200 in Fig. 2 to step 306, is no longer described in detail, may refer to
Correspondence process in Fig. 2.
In step 308, it checks and writes off management system and registers a dynamic task to control centre.The dynamic task can be by adjusting
The timing of degree center retries triggering to management system transmission task is checked and write off, for example, sending primary triggering every 5 minutes.In addition, checking and writing off
It is 0, after business of subsequent execution retries, cumulative 1 that management system, which can recorde current business number of retries, and so on.
In the step 310, it checks and writes off management system determination and retries interval duration as unit of day, for example, n-th weight
It is divided into that (N-1) is secondary to be retried interval+N days between examination.
Such as, it is determined that it is divided into 1 day between retrying for the 1st time, is divided into 3 days between retrying for the 2nd time.
In step 312, control centre retries task triggering to management system transmission is checked and write off, which can be by dispatching
Center is sent every the set time.
In a step 314, check and write off management system judge the current last business of triggered time distance execute the time when
Between be spaced and whether reached corresponding and retry interval duration.
For example, being divided into 1 day i.e. 24 hour between retrying for the 1st time, it is assumed that the time gap that control centre sends triggering is last
16 hours of time interval that business executes, 16 less than 24, also not up to retry interval duration, then checking and writing off management system can be with
That ignores control centre's transmission retries task triggering.
In another example the triggering that control centre is sent is had received again when checking and writing off management system, and by calculating, the triggering
Current time and last business to execute the time interval of time be 24 hours, reached and retried interval duration, then checked and write off pipe
Reason system can continue to execute step 316.
In order to carry out the calculating of above-mentioned time interval, check and write off management system can after performing business every time and retrying,
The time retried is all recorded, retries interval duration so that whether subsequent calculating has reached.
In step 316, it checks and writes off management system and retries task triggering according to, execution business retries.
In step 318, management system is checked and write off when retrying unsuccessfully, more new business number of retries.
After retrying unsuccessfully, checks and writes off management system also and will continue subsequent business and retry, method and aforementioned step
It is identical, it is periodically triggered by control centre, checks and writes off management system and judge whether to execute the triggering.
Assuming that checking and writing off management system retries success, then step 320 can be continued to execute.
In step 320, checking and writing off management system notice control centre terminates dynamic task, then subsequent control centre is just no longer
Send the corresponding task retries triggering.
In addition, business execute the reason of failure can there are many, it is one of the reason is that account balance is insufficient, if that
Trade company is sometime carrying out account charging, and according to the scheme of above-mentioned example, the business number of retries the more, retry interval
Duration is bigger, it would be possible to influence the timeliness for the task of checking and writing off.Based on this, Fig. 4 illustrates this specification one or more embodiment
The business of offer retries the process of method, which increases account balance and change joint-action mechanism on the basis of Fig. 2 example,
It enables to after account charging success, carries out mending as soon as possible and check and write off, promote the timeliness for task of checking and writing off.
It is shown in Figure 4, between step 222 and step 224, three steps 2221 are increased to 2223.
Wherein, in step 2221, billing and accounting system can notify the success of control centre's account charging, for example, the account of trade company A
Family is supplemented with money, and remaining sum is sufficient.
In step 2222, control centre finds the corresponding dynamic task of trade company A accordingly, and resets business next time and retry
Retry interval duration.The interval duration that retries after resetting retries interval duration less than current.For example, original distance is next time
It should be 3 days that business retried, which retries interval duration, can be after over-reset and execute at once, or be spaced 3 hours etc..Resetting
Purpose be so that business retries executes as early as possible.
In step 2223, control centre retries triggering according to the interval duration transmission task that retries after resetting.
On triggering, it if checking and writing off management system retries success, can notify control centre, this is terminated by control centre
Dynamic task.
In order to realize above-mentioned method, at least one embodiment of this specification additionally provides a kind of business and retries device.Such as
Shown in Fig. 5, the apparatus may include: business execution module 51, interval determination module 52 and retry processing module 53.
Business execution module 51 executes failure for business when doing business, to occur;
Interval determination module 52 retries interval duration for determining, the interval duration that retries is to the target service
Carry out business business adjacent twice when retrying retry between time interval;Also, when business number of retries gradually increases,
The interval duration that retries also is gradually increased;
Processing module 53 is retried, for retrying interval duration according to determining, executes the business weight to target service
Examination.
In one example, as shown in fig. 6, the device can also include: number logging modle 54.
Number logging modle 54 is used for when business executes failure, record traffic number of retries;
The interval determination module 52, for according to the business number of retries and scheduled retrying time setting side
Formula determines that business is retried next time and retries interval duration between the execution of this business;
It is described to retry processing module 53, for when retrying successfully, end to retry target service;Otherwise, by described
Number logging modle updates the business number of retries, and continues to be determined according to the business number of retries by interval determination module
Business, which retries, next time corresponding retries interval duration.
In one example, interval determination module 52 are also used to: being account balance deficiency when the reason of business executes failure
When, monitor the variation of account balance;If detect account charging success, interval duration, the weight after resetting are retried described in resetting
Examination interval duration retries interval duration less than current.
The device or module that above-described embodiment illustrates can specifically realize by computer chip or entity, or by having
The product of certain function is realized.A kind of typically to realize that equipment is computer, the concrete form of computer can be personal meter
Calculation machine, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation are set
It is any several in standby, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each module can be realized in the same or multiple software and or hardware when specification one or more embodiment.
Each step in above-mentioned process as shown in the figure, execution sequence are not limited to the sequence in flow chart.In addition, each
The description of a step can be implemented as software, hardware or its form combined, for example, those skilled in the art can be by it
It is embodied as the form of software code, can is the computer executable instructions that can be realized the corresponding logic function of the step.
When it is realized in the form of software, the executable instruction be can store in memory, and by the processor in equipment
It executes.
For example, corresponding to the above method, this specification one or more embodiment provides a kind of business simultaneously and retries equipment.
The equipment may include processor, memory and storage on a memory and the computer instruction that can run on a processor,
The processor is by executing described instruction, for realizing following steps:
When doing business, business occurs and executes failure;
It determines and retries interval duration, the interval duration that retries is adjacent twice when retrying to business progress business
Business retry between time interval;Also, when business number of retries gradually increases, the interval duration that retries also gradually increases
Greatly;
Interval duration is retried according to determining, execution retries the business of the business.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that this specification one or more embodiment can provide as method, system or calculating
Machine program product.Therefore, this specification one or more embodiment can be used complete hardware embodiment, complete software embodiment or
The form of embodiment combining software and hardware aspects.Moreover, this specification one or more embodiment can be used at one or
It is multiple wherein include computer usable program code computer-usable storage medium (including but not limited to magnetic disk storage,
CD-ROM, optical memory etc.) on the form of computer program product implemented.
This specification one or more embodiment can computer executable instructions it is general on
It hereinafter describes, such as program module.Generally, program module includes executing particular task or realization particular abstract data type
Routine, programs, objects, component, data structure etc..Can also practice in a distributed computing environment this specification one or
Multiple embodiments, in these distributed computing environments, by being executed by the connected remote processing devices of communication network
Task.In a distributed computing environment, the local and remote computer that program module can be located at including storage equipment is deposited
In storage media.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.At data
For managing apparatus embodiments, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to side
The part of method embodiment illustrates.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
The foregoing is merely the preferred embodiments of this specification one or more embodiment, not to limit this theory
Bright book one or more embodiment, all within the spirit and principle of this specification one or more embodiment, that is done is any
Modification, equivalent replacement, improvement etc. should be included within the scope of the protection of this specification one or more embodiment.