Invention content
To overcome the problems in correlation technique, this specification embodiment provides the idempotent control in net system switching process
Method, apparatus and system processed.
According to this specification embodiment in a first aspect, a kind of idempotent control method in providing net system switching process, institute
The method of stating includes:In net system switching process, the call request that idempotent verifies is sent to second system, the call request carries
Business odd numbers;Determined whether to accept the corresponding business of the business odd numbers according to the idempotent check results of second system, wherein the
The idempotent check results of two system are used to characterize the idempotent control record whether the business odd numbers is successively inserted into second system.
Further, determined whether to accept the corresponding business of the business odd numbers according to the idempotent check results of second system
Including following at least either step:When the idempotent check results of second system characterize the power that the business odd numbers is inserted into second system
When equal controls are recorded successfully, the corresponding business of the business odd numbers is accepted;Or when the idempotent check results of second system characterize
When the business odd numbers is inserted into the idempotent control record failure of second system, if the business odd numbers is not found in second system
Corresponding business paper accepts the corresponding business of the business odd numbers;Or when the idempotent check results of second system characterize institute
When stating the idempotent control record failure of business odd numbers insertion second system, corresponded to if finding the business odd numbers in second system
Business paper, notify business odd numbers corresponding service handling success described in upstream business system.
Further, the step of accepting the business odd numbers corresponding business include:Sheet is executed according to the business odd numbers
Ground idempotent verification;Determine whether to accept the corresponding business of the business odd numbers according to local idempotent check results, wherein local
Idempotent check results be used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
Further, determine whether that accepting the corresponding business of the business odd numbers includes according to local idempotent check results
At least either step below:It is recorded as when local idempotent check results characterize the local idempotent control of the business odd numbers insertion
When work(, the corresponding business of the business odd numbers is accepted;Or it is inserted into when local idempotent check results characterize the business odd numbers
When local idempotent control record fails, after the corresponding service handling of the business odd numbers is completed, operation system institute is notified
State the corresponding service handling success of business odd numbers.
Further, before sending the call request that idempotent verifies to second system, further include:Receive upstream business system
The service request that system is sent;The service request is responded, to generate business odd numbers.
According to the second aspect of this specification embodiment, the idempotent control method in a kind of net system switching process, institute are provided
The method of stating includes:In net system switching process, the call request for the idempotent verification that the first system is sent, the call request are received
Carrying business odd numbers;Local idempotent verification is executed according to the business odd numbers, and idempotent check results are sent to the first system,
So that the first system determines whether to accept the corresponding business of the business odd numbers according to the idempotent check results;Wherein, local
Idempotent check results be used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
Further, it includes following at least either step idempotent check results to be sent to the first system:When the business
When the idempotent control that odd numbers is inserted into local is recorded successfully, the idempotent for characterizing the business odd numbers and being inserted into local is sent to the first system
Control records successful first idempotent check results;Or when the business odd numbers is inserted into local idempotent control record failure
When, if locally not finding the corresponding business paper of the business odd numbers, the first idempotent verification is sent to the first system
As a result;Or when the business odd numbers is inserted into local idempotent control record failure, if locally finding business odd numbers pair
The business paper answered sends to the first system and characterizes the second power that the business odd numbers is inserted into local idempotent control record failure
Etc. check results.
Further, the first idempotent check results accept the corresponding business of the business odd numbers for the first system,
The second idempotent check results after the corresponding service handling of the business odd numbers is completed, notify upstream for the first system
The corresponding service handling success of business odd numbers described in operation system.
According to the third aspect of this specification embodiment, the idempotent control device in a kind of net system switching process, institute are provided
Stating device includes:First sending module, in net system switching process, sending the calling that idempotent verifies to second system and asking
It asks, the call request carries business odd numbers;Service handling module, for being according to the determination of the idempotent check results of second system
It is no to accept the corresponding business of the business odd numbers, wherein the idempotent check results of second system are for characterizing the business odd numbers
Whether the idempotent control record of second system is successively inserted into.
Further, the service handling module is for executing following either step:When the idempotent of second system verifies knot
When the idempotent control that fruit characterizes the business odd numbers insertion second system is recorded successfully, the corresponding industry of the business odd numbers is accepted
Business;Or when the idempotent check results of second system characterize the idempotent control record failure that the business odd numbers is inserted into second system
When, if not finding the corresponding business paper of the business odd numbers in second system, accept the corresponding business of the business odd numbers;
Or when the idempotent check results of second system characterize the business odd numbers and are inserted into the idempotent control record failure of second system,
If finding the corresponding business paper of the business odd numbers in second system, business odd numbers described in upstream business system is notified to correspond to
Service handling success.
Further, the service handling module is used for:Local idempotent verification is executed according to the business odd numbers;According to this
The idempotent check results on ground determine whether to accept the corresponding business of the business odd numbers, wherein local idempotent check results are used
Record is controlled in whether the characterization business odd numbers is successively inserted into local idempotent.
Further, the service handling module is for executing following at least either step:When local idempotent verifies knot
When the idempotent control that fruit characterizes business odd numbers insertion local is recorded successfully, the corresponding business of the business odd numbers is accepted;Or
Person is when local idempotent check results characterize the business odd numbers and are inserted into local idempotent control record failure, in the business
After the corresponding service handling of odd numbers is completed, the corresponding service handling success of business odd numbers described in operation system is notified.
Further, described device further includes:Second receiving module, the business for receiving the transmission of upstream business system are asked
It asks;Generation module, for responding the service request, to generate business odd numbers.
According to the fourth aspect of this specification embodiment, the idempotent control device in a kind of net system switching process, institute are provided
Stating device includes:First receiving module, the calling in net system switching process, receiving the idempotent verification that the first system is sent
Request, the call request carry business odd numbers;Second sending module, for executing local idempotent school according to the business odd numbers
Test, and idempotent check results be sent to the first system so that the first system according to the idempotent check results determine whether by
Manage the corresponding business of the business odd numbers;Wherein, local idempotent check results are for characterizing whether the business odd numbers succeeds
It is inserted into local idempotent control record.
Further, second sending module is for executing following at least either step:When the business odd numbers is inserted into
When local idempotent control is recorded successfully, sends the local idempotent of the characterization business odd numbers insertion to the first system and control record
Successful first idempotent check results;Or when the business odd numbers is inserted into local idempotent control record failure, if at this
Ground does not find the corresponding business paper of the business odd numbers, and the first idempotent check results are sent to the first system;Or
When the business odd numbers is inserted into local idempotent control record failure, if locally finding the corresponding business sheet of business odd numbers
According to the second idempotent verification for sending the idempotent control record failure for characterizing business odd numbers insertion local to the first system is tied
Fruit.
Further, the first idempotent check results accept the corresponding business of the business odd numbers for the first system,
The second idempotent check results after the corresponding service handling of the business odd numbers is completed, notify upstream for the first system
The corresponding service handling success of business odd numbers described in operation system.
According to the 5th of this specification embodiment aspect, the idempotent control system in a kind of net system switching process, institute are provided
The system of stating includes:The first system, second system and upstream business system;The first system is used in net system switching process,
If receiving the service request of upstream business system transmission, the call request that idempotent verifies, the calling are sent to second system
Ask carrying business odd numbers;And determined whether to accept the corresponding business of the business odd numbers according to the idempotent check results;
Idempotent check results are sent to the first system by the second system for executing idempotent verification;Wherein, idempotent check results
The idempotent that second system whether is successively inserted into for characterizing the business odd numbers controls record.
Further, the upstream business system further includes:Switching switch, the first system is sent to for controlling service request
System or second system.
Further, the switching switch is further used for:By the corresponding service request of business in the white list to prestore
It is sent to the first system, the corresponding service request of business other than the white list is sent to the second system.
According to the 6th of this specification embodiment the aspect, a kind of computer readable storage medium is provided, meter is stored thereon with
Calculation machine program, which realizes any of the above-described embodiment method when being executed by processor.
According to the 7th of this specification embodiment aspect, a kind of computer equipment is provided, including memory, processor and deposit
The computer program that can be run on a memory and on a processor is stored up, the processor realizes above-mentioned when executing described program
The method of one embodiment.
Using this specification example scheme, during system switches, by calling the idempotent to method, system to verify
Service, so that it is determined that whether business by being accepted to method, system, to avoid different systems from repeating to accept same item business, protects
The global idempotence between each system in net system switching process is hindered.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not
This specification can be limited.
Specific implementation mode
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is the purpose only merely for description specific embodiment in the term that this specification uses, is not intended to be limiting this explanation
Book.The "an" of used singulative, " described " and "the" are also intended to packet in this specification and in the appended claims
Most forms are included, unless context clearly shows that other meanings.It is also understood that term "and/or" used herein is
Refer to and include one or more associated list items purposes any or all may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, not taking off
In the case of this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
In a Distributed System, there is the upstream and downstream system for the relationship of directly invoking to need to ensure the power of service call
Etc. property.In application system, the characteristics of idempotent operation be arbitrarily performed a plurality of times caused by influence with once execute
Influence identical, in a distributed system, same request parameter is interaction is once with the multiple effect of interaction between system.
Above-mentioned characteristic is known as idempotence.
Idempotence is kept to be very important in systems.It is as shown in Figure 1 that one kind not meeting the case where idempotence requires.
In step 102, upstream business system sends service request to service system.At step 104, service system is accepted
The request.In step 106, service system upstream traffic system transmission accepts success message, but the message is not sent
Success.In step 108, upstream business system retransmits service request to service system.In step 110, service handling
System accepts the request again.In step 112, service system upstream traffic system return accepts success message.This
Same business is resulted in be accepted twice.
By taking payment transaction as an example, when upstream business system initiates payment request to service system, service handling system
System can accept delivery operation according to the request, to deduct assets from the account of user, if deducted successfully, account balance
Reduce corresponding value;If deducting failure, account balance is constant, while service system can be returned with upstream traffic system
Pay the prompt message of failure.It is a kind of that typically payment request is correctly handled by service system, but business by
The handling result that reason system returns fails to return to upstream business system due to network etc..Upstream business system can at this time
Payment request can be sent to service system again by modes such as refresh operation interfaces, service system executes again
Deduct the operation of account assets.It is repeated and has been accepted twice which results in same business, cause user's loss of assets.
System switching refers to replacing the first system (i.e. legacy system) with second system (i.e. new system), will be accepted in legacy system
Service switching to new system on the process that accepts.Sometimes, after legacy system being switched to new system, new system it is unstable or
There is exception, in order to avoid influencing business, it is also possible to new system be switched back into legacy system again, switched again after new system stabilization
To legacy system.In new, legacy system handoff procedure, if a business accepts success via new system, but legacy system is not
It can know that new system has accepted success, it is likely that cause legacy system to repeat to accept the business, if legacy system is also successfully accepted
The business can then cause to violate idempotence requirement.
In view of the above-mentioned problems, this specification embodiment provides the idempotent control method in a kind of net system switching process, such as Fig. 2
Shown, the above method may include following steps 202 and step 204:
Step 202:In net system switching process, the call request that idempotent verifies is sent to second system, the calling is asked
Seek carrying business odd numbers;
Step 204:Determined whether to accept the corresponding business of the business odd numbers according to the idempotent check results of second system,
Wherein, the idempotent check results of second system are used to characterize the idempotent control whether the business odd numbers is successively inserted into second system
Record.
The scheme of this specification embodiment first goes the idempotent for calling second system to sentence when the first system accepts a business
Disconnected service, judges to service and judges whether the business accepted in second system by the idempotent, to determine that the first system is
It is no to accept the business, it avoids the first system and second system repeats to accept same item business, ensured in net system switching process
Global idempotence between each system.
In general, it may include following below scheme during service handling:Business of the upstream business system to the business that accepts
Receiving system sends service request, business odd numbers is carried in service request, for uniquely determining a business.Service system
Business is accepted after receiving service request, and the information that the business has been accepted is added to the idempotent in database and is controlled
In record, whether idempotent control record is accepted for record traffic.After accepting successfully, business can be generated according to business odd numbers
Document, and business paper is committed to database;Meanwhile service system can return to an industry with upstream traffic system
Business accepts success message, to notify the upstream business system business to accept success.
In step 202, the effect of idempotent verification is whether checking system had accepted the corresponding business of business odd numbers.
It was accepted in second system due to being possible to this business, so need to provide an idempotent verification service by second system, the
One system is by calling the idempotent of second system to verify service, so as to know whether second system had accepted corresponding industry
Business.Business odd numbers can be carried by calling in the call request of second system idempotent verification service, second system is receiving calling
After request, business odd numbers therein can be extracted, and idempotent verification is executed according to the business odd numbers.
In step 204, judge second in such a way that business odd numbers to be inserted into the idempotent control record of second system
Whether system accepted corresponding business.Why will be by the way of being inserted into, rather than directly inquire business odd numbers correspondence
Business paper whether there is in idempotent control record, be because in some cases, second system has other thread to exist
The business being accepted, but business does not accept completion also to not submit, other threads can not inquire business paper, so even if
The business paper is not present from idempotent control record queries, can not illustrate that the business paper is not accepted in new system.Therefore,
This specification embodiment can more accurately judge whether business is accepted by way of insertion, and it is general to reduce erroneous judgement
Rate.
After business odd numbers is inserted into the idempotent control record of second system, in fact it could happen that any one in following three kinds of situations
Person:
Situation one:
The idempotent control that business odd numbers is inserted into second system records successfully.If be inserted into successfully, illustrate second system herein
It was not carried out insertion operation before, was currently inserted into be inserted into for the first time.That is, second system did not accept the business.
Therefore, the first system should accept the corresponding business of business odd numbers.After service handling success, the first system can also notify
The corresponding service handling success of the upstream business system business odd numbers.
Situation two:
Business odd numbers is inserted into the idempotent control record failure of second system, but does not find the business odd numbers in second system
Corresponding business paper.Such case illustrates that the first system had called up the idempotent judgement service of second system before this,
And idempotent control record is inserted into successfully, but the follow-up acceptance procedure of second system is abnormal, and does not accept success, upstream business system
System is retried again, retries rear the first system and the idempotent of new system is called to judge service again.At this point, the first system should be by
Manage the corresponding business of business odd numbers.After service handling success, the first system can also notify the upstream business system business
The corresponding service handling success of odd numbers.
Situation three:
Business odd numbers is inserted into the idempotent control record failure of second system, and the business odd numbers pair is found in second system
The business paper answered.Such case illustrates that the business has accepted success in second system, and the first system no longer needs to remain seized of.
Therefore, the first system can directly notify the corresponding service handling success of the upstream business system business odd numbers.
In one embodiment, the first system can first call local idempotent to verify service to look into when accepting business
Ask whether the business had accepted locally, it is out-of-date only not accepted in local when business, just accepts corresponding business, to avoid
Business is locally repeating to accept.Specifically, the step of accepting business odd numbers corresponding business include:It is executed according to business odd numbers
Local idempotent verification;Determine whether to accept the corresponding business of the business odd numbers according to local idempotent check results, wherein this
The idempotent check results on ground are used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
After business odd numbers is inserted into local idempotent control record, in fact it could happen that any one in following two situations:
Situation one:
Business odd numbers is inserted into local idempotent control and records successfully.Such case illustrates that the local business odd numbers that do not accepted corresponds to
Business, therefore, the first system should accept the business.After service handling success, the first system can also notify upstream industry
The corresponding service handling success of the business system business odd numbers.
Situation two:
Business odd numbers is inserted into local idempotent control record failure.It is corresponding that such case illustrates that local accepted business odd numbers
Business, therefore, the first system no longer need to remain seized of, and the first system can directly notify the upstream business system business odd numbers pair
The service handling success answered.
In one embodiment, if the idempotent control that business odd numbers is inserted into second system records successfully, second system can be with
Idempotent is returned to the first system and verifies success message, to notify the first system to accept business.If business odd numbers is inserted into second system
Idempotent control record failure, second system can to the first system return idempotent verify failed message, to notify the first system
Without accepting business.
In one embodiment, if the first system or second system successfully accept business, the first system can be upstream
Operation system returns to " idempotent repeating transmission " result code, for notifying upstream business system business to accept success.
Corresponding control sequential figure is as shown in Figures 3 to 5.Embodiment shown in Fig. 3 includes the following steps:
Step 302:Upstream business system sends service request to the first system.
Step 304:The first system calls the idempotent verification service of second system.
Step 306:The idempotent that business odd numbers is inserted into second system by second system controls record.
Step 308:If be inserted into successfully, or fail if be inserted into, and does not find the business odd numbers in second system
Corresponding business paper, second system send idempotent to the first system and verify success message.
Step 310:The first system executes local idempotent verification.
Step 312:Business odd numbers is inserted into local idempotent control and recorded successfully by the first system, and the first system accepts business.
Step 314:After the first system is accepted successfully, upstream traffic system returns to " idempotent repeating transmission " result code.
Embodiment shown in Fig. 4 includes the following steps:
Step 402:Upstream business system sends service request to the first system.
Step 404:The first system calls the idempotent verification service of second system.
Step 406:The idempotent that business odd numbers is inserted into second system by second system controls record.
Step 408:If be inserted into successfully, or fail if be inserted into, and does not find the business odd numbers in second system
Corresponding business paper, second system send idempotent to the first system and verify success message.
Step 410:The first system executes local idempotent verification.
Step 412:Business odd numbers is inserted into local idempotent control record failure, the first system upstream traffic by the first system
System returns to " idempotent repeating transmission " result code.
Embodiment shown in fig. 5 includes the following steps:
Step 502:Upstream business system sends service request to the first system.
Step 504:The first system calls the idempotent verification service of second system.
Step 506:The idempotent that business odd numbers is inserted into second system by second system controls record.
Step 508:If being inserted into failure, and the corresponding business paper of business odd numbers is found in second system, second
System sends idempotent to the first system and verifies failed message.
Step 510:The first system upstream traffic system returns to " idempotent repeating transmission " result code.
This specification embodiment also provides the idempotent control method in a kind of net system switching process, as shown in fig. 6, the side
Method may include following steps 602 and step 604:
Step 602:In net system switching process, the call request for the idempotent verification that the first system is sent, the tune are received
With request carrying business odd numbers;
Step 604:Local idempotent verification is executed according to the business odd numbers, and idempotent check results are sent to the first system
System, so that the first system determines whether to accept the corresponding business of the business odd numbers according to the idempotent check results;Wherein, originally
The idempotent check results on ground are used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
The second system of this specification embodiment can provide idempotent and judge service, for receiving the first of service request
System is called, to make the first system know whether second system had accepted the business, to avoid the first system weight
Same business is accepted again, has ensured the global idempotence between each system in net system switching process.
Second system can extract business odd numbers therein, and according to the business odd numbers after receiving call request
Execute idempotent verification.In step 604, judged in such a way that business odd numbers to be inserted into the idempotent control record of second system
Whether second system accepted corresponding business.Can more accurately be judged by way of insertion business whether by by
Reason reduces probability of miscarriage of justice.
After business odd numbers is inserted into the idempotent control record of second system, in fact it could happen that any one in following three kinds of situations
Person:
Situation one:
The idempotent control that business odd numbers is inserted into second system records successfully.If be inserted into successfully, illustrate second system herein
It was not carried out insertion operation before, was currently inserted into be inserted into for the first time.That is, second system did not accept the business.
Therefore, second system, which can send to characterize the business odd numbers and be inserted into local idempotent control to the first system, record successful the
One idempotent check results, so that the first system accepts the business.
Situation two:
Business odd numbers is inserted into the idempotent control record failure of second system, but does not find the business odd numbers in second system
Corresponding business paper.Such case illustrates that the first system had called up the idempotent judgement service of second system before this,
And idempotent control record is inserted into successfully, but the follow-up acceptance procedure of second system is abnormal, and does not accept success, upstream business system
System is retried again, retries rear the first system and the idempotent of new system is called to judge service again.At this point, second system can be to
The first system sends the local idempotent control of the characterization business odd numbers insertion and records successful first idempotent check results, so that
The first system accepts the business.
Situation three:
Business odd numbers is inserted into the idempotent control record failure of second system, and the business odd numbers pair is found in second system
The business paper answered.Such case illustrates that the business has accepted success in second system, and the first system no longer needs to remain seized of.
Therefore, second system can be sent to the first system characterizes the business odd numbers is inserted into local idempotent control record failure the
Two idempotent check results, to notify the first system without accepting the business.In addition, the first system is receiving the verification of the second idempotent
As a result after, the corresponding service handling success of business odd numbers described in upstream business system can also be notified.
As shown in fig. 7, being the overview flow chart of the idempotent control method of this specification one embodiment.
In a step 702, the first system receives service request.
In step 704, the first system calls new system idempotent to judge service.
In step 706, second system receives idempotent and judges to ask.
In step 708, second system is attempted to be inserted into idempotent control record, is inserted into and successfully thens follow the steps 710;It is inserted into and loses
It loses and thens follow the steps 716.
In step 720, second system returns to idempotent to the first system and verifies success message.
In step 712, the first system executes local idempotent and judges.Idempotent control record, which is inserted into, successfully to be thened follow the steps
714, insertion unsuccessfully thens follow the steps 722.
Step 714:The first system accepts business.
Step 716:Second system judges that service handling document whether there is, and there is no then follow the steps 718;In the presence of then holding
Row step 720.
Step 718:Second system returns to idempotent to the first system and verifies success message, and executes step 712.
Step 720:Second system returns to idempotent to the first system and verifies failed message, and executes step 722.
Step 722:The first system does not continue to accept the business, and executes step 724.
Step 724:The return of the first system upstream traffic system accepts success message.
Corresponding with the embodiment of idempotent control method in aforementioned system handoff procedure, this specification embodiment also provides
The embodiment of idempotent control device, computer storage media and computer equipment in net system switching process.
As shown in figure 8, Fig. 8 is the power in a kind of net system switching process of this specification shown according to an exemplary embodiment
The block diagram of equal controller 800, described device include:
First sending module 802, in net system switching process, sending the calling that idempotent verifies to second system and asking
It asks, the call request carries business odd numbers;
Service handling module 804, for determining whether to accept the business sheet according to the idempotent check results of second system
Number corresponding business, wherein the idempotent check results of second system are for characterizing whether the business odd numbers is successively inserted into second
The idempotent control record of system.
The specific details of the realization process of the function of modules and effect are shown in corresponding first in the above method in above-mentioned apparatus
The realization process of step performed by system, details are not described herein.
As shown in figure 9, in a kind of net system switching process that Fig. 9 is this specification to be shown according to another exemplary embodiment
The block diagram of idempotent control device 900, described device include:
First receiving module 902, the calling in net system switching process, receiving the idempotent verification that the first system is sent
Request, the call request carry business odd numbers;
Second sending module 904, for executing local idempotent verification according to the business odd numbers, and by idempotent check results
Be sent to the first system so that the first system determine whether to accept the business odd numbers according to the idempotent check results it is corresponding
Business;Wherein, local idempotent check results are used to characterize whether the business odd numbers to be successively inserted into local idempotent control note
Record.
The specific details of the realization process of the function of modules and effect are shown in corresponding second in the above method in above-mentioned apparatus
The realization process of step performed by system, details are not described herein.
The embodiment of idempotent control device in this specification net system switching process can be applied on a computing device, example
Such as server or terminal device.Device embodiment can also pass through hardware or software and hardware combining by software realization
Mode is realized.It is the processor by file process where it as the device on a logical meaning for implemented in software
Corresponding computer program instructions in nonvolatile memory are read what operation in memory was formed.For hardware view,
As shown in Figure 10, it is a kind of hardware configuration of computer equipment where the idempotent control device in this specification net system switching process
Figure, other than processor 1002 shown in Fig. 10, memory 1004, network interface 1006 and nonvolatile memory 1008,
Server or electronic equipment in embodiment where device can also include generally according to the actual functional capability of the computer equipment
Other hardware repeat no more this.
For device embodiments, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separating component
The module of explanation may or may not be physically separated, and the component shown as module can be or can also
It is not physical module, you can be located at a place, or may be distributed on multiple network modules.It can be according to actual
It needs that some or all of module therein is selected to realize the purpose of this specification scheme.Those of ordinary skill in the art are not
In the case of making the creative labor, you can to understand and implement.
As shown in figure 11, Figure 11 is in a kind of net system switching process that this specification is shown according to another exemplary embodiment
Idempotent control system block diagram, the system comprises:
Upstream business system 1102, the first system 1104 and second system 1106;
The first system 1104 is used in net system switching process, if receiving the industry of the transmission of upstream business system 1102
Business request sends the call request that idempotent verifies to second system 1106, and the call request carries business odd numbers;And according to
The idempotent check results determine whether to accept the corresponding business of the business odd numbers;
Idempotent check results are sent to the first system 1104 by the second system 1106 for executing idempotent verification;
Wherein, idempotent check results are used to characterize the idempotent control record whether the business odd numbers is successively inserted into second system 1106.
In one embodiment, upstream business system 1102 further includes switching switch 1108, for controlling service request hair
It is sent to the first system 1104 or second system 1106.Switch switch 1108 by setting, upstream business system 1102 can be controlled
System accepts business by the first system 1104 or second system 1106.It is possible to further which a white list is arranged, switching is opened
The first system 1104 can be sent to by the corresponding service request of business in the white list to prestore by closing 1108, other than white list
The corresponding service request of business be sent to second system 1106.In net system switching process, can first by a part (such as
1%) service switching is accepted to second system, therefore, can white list first be added in 1% business, be waited second systems
After stabilization, then gradually other service switchings to second system are accepted.In this way, net system switching process can be reduced
In influence to business.Even if second system accepts failure, 1% business only also at most can be influenced.
In one embodiment, service request can be assembled into request object by upstream business system, and to the first system
1104 send RPC requests (Remote Procedure Call, remote procedure call).The first system is receiving service request
Later, can also to the parameter in service request carry out parameter verification, as non-empty verification and legitimacy verifies, to ensure business
Smoothly execute.
Function in the present embodiment performed by the first system 1104 and second system 1106 respectively with above method embodiment
In the function that is executed by the first system it is identical with the function that is executed by second system, details are not described herein again.
Above-described embodiment can be used for being switched to the idempotent deterministic process of the first system from second system, be cut from the first system
The idempotent judgment step for changing to second system is similar, and the idempotent that second system can be first carried out in deterministic process judges, recalls
The first system idempotent judges service, this ensures that regardless of switch instances, second system and the first system idempotent control
The insertion sequence of system record is consistent.
The first system and second system provide the form of idempotent judgement service to method, system tune in this specification embodiment
With, idempotent judge service realization in, using be inserted into idempotent control record come do idempotent judge by the way of, avoided other
Concurrent thread leads to idempotent misjudgment accepting the business paper, also can guarantee in high concurrent real-time calling system stringent
Idempotence.In addition, upstream business system is not necessarily to do special idempotent processing, can at any time between the first system and second system into
Row switching, overall plan implementation cost is low, to upstream business system without intrusion.
The scheme of this specification embodiment has certain versatility, and for the same operation system, there are two systems in downstream
The scene that upstream business system business request can be carried, could be used that the program to ensure global idempotence.
Correspondingly, this specification embodiment also provides a kind of computer storage media, is stored thereon with computer program, should
The idempotent control method in the net system switching process in any of the above-described embodiment is realized when program is executed by processor.
Correspondingly, this specification embodiment also provides a kind of computer equipment, including memory, processor and is stored in
On reservoir and the computer program that can run on a processor, the processor realize any of the above-described implementation when executing described program
The idempotent control method in net system switching process in example.
It (includes but not limited to disk that the application, which can be used in the storage medium that one or more wherein includes program code,
Memory, CD-ROM, optical memory etc.) on the form of computer program product implemented.Computer-usable storage medium packet
Permanent and non-permanent, removable and non-removable media is included, information storage is can be accomplished by any method or technique.Letter
Breath can be computer-readable instruction, data structure, the module of program or other data.The example packet of the storage medium of computer
It includes but is not limited to:Phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory (DRAM),
Other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory
(EEPROM), fast flash memory bank or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), digital versatile disc
(DVD) or other optical storages, magnetic tape cassette, tape magnetic disk storage or other magnetic storage apparatus or any other non-biography
Defeated medium can be used for storage and can be accessed by a computing device information.
Those skilled in the art will readily occur to the disclosure after considering specification and putting into practice specification disclosed herein
Other embodiments.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes
Or adaptive change follow the general principles of this disclosure and include the disclosure it is undocumented in the art it is known often
Knowledge or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following
Claim point out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
The foregoing is merely the preferred embodiments of the disclosure, not limiting the disclosure, all essences in the disclosure
With within principle, any modification, equivalent substitution, improvement and etc. done should be included within the scope of the disclosure protection god.