CN108647105A - Idempotent control method in net system switching process, apparatus and system - Google Patents

Idempotent control method in net system switching process, apparatus and system Download PDF

Info

Publication number
CN108647105A
CN108647105A CN201810497483.9A CN201810497483A CN108647105A CN 108647105 A CN108647105 A CN 108647105A CN 201810497483 A CN201810497483 A CN 201810497483A CN 108647105 A CN108647105 A CN 108647105A
Authority
CN
China
Prior art keywords
business
idempotent
odd numbers
check results
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810497483.9A
Other languages
Chinese (zh)
Other versions
CN108647105B (en
Inventor
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810497483.9A priority Critical patent/CN108647105B/en
Publication of CN108647105A publication Critical patent/CN108647105A/en
Application granted granted Critical
Publication of CN108647105B publication Critical patent/CN108647105B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

This specification embodiment provides a kind of idempotent control method being related in net system switching process, apparatus and system, during system switches, by calling the idempotent to method, system to verify service, so that it is determined that whether business is by accepting method, system, to avoid different systems from repeating to accept same item business, the global idempotence between each system in net system switching process has been ensured.

Description

Idempotent control method in net system switching process, apparatus and system
Technical field
This specification is related to idempotent control method in technical field of data processing more particularly to net system switching process, dress It sets and system.
Background technology
In Distributed System, different application systems is responsible for different functions, and a business function needs pass through The calling serviced between multiple systems realizes have the upstream and downstream system of the relationship of directly invoking to need to ensure the idempotent of service call Property.Application system often has life cycle, continues on older systems when the cost for creating the cost of an application system is less than The cost of upgrading, and bring future value bigger when, enterprise often selects to create a system to replace legacy system, and will Originally it was switched to new system by the business function that legacy system is accepted to accept, this process is called system switching.
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.
Description of the drawings
The drawings herein are incorporated into the specification and forms part of this specification, and shows the reality for meeting this specification Apply example, and the principle together with specification for explaining this specification.
Sequence diagram when Fig. 1 is the idempotent failure of one embodiment.
Fig. 2 is the idempotent control method flow chart in the net system switching process of this specification one embodiment.
Fig. 3 is the sequence diagram of the idempotent control of this specification first embodiment.
Fig. 4 is the sequence diagram of the idempotent control of this specification second embodiment.
Fig. 5 is the sequence diagram of the idempotent control of this specification 3rd embodiment.
Fig. 6 is the idempotent control method flow chart in the net system switching process of another embodiment of this specification.
Fig. 7 is the overview flow chart of the idempotent control method of this specification one embodiment.
Fig. 8 is the structural schematic diagram of the idempotent control device in the net system switching process of this specification one embodiment.
Fig. 9 is the structural schematic diagram of the idempotent control device in the net system switching process of another embodiment of this specification.
Figure 10 is the frame of the idempotent control device place computer equipment in net system switching process in this specification embodiment Figure.
Figure 11 is the structural schematic diagram of the idempotent control system in the net system switching process of this specification one embodiment.
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.

Claims (15)

1. the idempotent control method in a kind of net system switching process, the method includes:
In net system switching process, the call request that idempotent verifies is sent to second system, the call request carries business sheet Number;
Determined whether to accept the corresponding business of the business odd numbers according to the idempotent check results of second system, wherein the second system The idempotent check results of system are used to characterize the idempotent control record whether the business odd numbers is successively inserted into second system.
2. according to the method described in claim 1, determining whether to accept the business according to the idempotent check results of second system The corresponding business of odd numbers includes following at least either step:
When the idempotent control that the idempotent check results of second system characterize the business odd numbers insertion second system records successfully, Accept the corresponding business of the business odd numbers;Or
When the idempotent check results of second system, which characterize the business odd numbers, is inserted into the idempotent control record failure of second system, If not finding the corresponding business paper of the business odd numbers in second system, the corresponding business of the business odd numbers is accepted;Or Person
When the idempotent check results of second system, which characterize the business odd numbers, is 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.
3. according to the method described in claim 2, the step of accepting the business odd numbers corresponding business includes:
Local idempotent verification is executed according to the business odd numbers;
Determine whether to accept the corresponding business of the business odd numbers according to local idempotent check results, wherein local idempotent Check results are used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
4. according to the method described in claim 3, determining whether to accept the business odd numbers according to local idempotent check results Corresponding business includes following at least either step:
When local idempotent check results, which characterize the local idempotent control of the business odd numbers insertion, to be recorded successfully, accept described The corresponding business of business odd numbers;Or
When local idempotent check results, which characterize the business odd numbers, is inserted into local idempotent control record failure, in the industry It is engaged in after the corresponding service handling completion of odd numbers, notifies the corresponding service handling success of business odd numbers described in operation system.
5. according to the method described in claim 1, before sending the call request that idempotent verifies to second system, further include:
Receive the service request that upstream business system is sent;
The service request is responded, to generate business odd numbers.
6. the idempotent control method in a kind of net system switching process, the method includes:
In net system switching process, the call request for the idempotent verification that the first system is sent is received, the call request carries industry 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 first System determines whether to accept the corresponding business of the business odd numbers according to the idempotent check results;Wherein, local idempotent school Result is tested for characterizing whether the business odd numbers is successively inserted into local idempotent control record.
7. according to the method described in claim 6, it includes following at least any step that idempotent check results, which are sent to the first system, Suddenly:
When the business odd numbers, which is inserted into local idempotent control, to be recorded successfully, is sent to the first system and characterize the business odd numbers It is inserted into local idempotent control and records successful first idempotent check results;Or
When the business odd numbers is inserted into local idempotent control record failure, if locally not finding the business odd numbers pair The business paper answered sends the first idempotent check results to the first system;Or
When the business odd numbers is inserted into local idempotent control record failure, if locally finding the corresponding industry of business odd numbers Business document is inserted into local idempotent to the first system transmission characterization business odd numbers and controls the second idempotent verification for recording and failing As a result.
8. according to the method described in claim 7, the first idempotent check results accept the business sheet for the first system Number corresponding business, the second idempotent check results are completed for the first system in the corresponding service handling of the business odd numbers Later, the corresponding service handling success of business odd numbers described in upstream business system is notified.
9. the idempotent control device in a kind of net system switching process, described device include:
First sending module, in net system switching process, the call request that idempotent verifies, the tune to be sent to second system With request carrying business odd numbers;
Service handling module, it is corresponding for determining whether to accept the business odd numbers according to the idempotent check results of second system Business, wherein the idempotent check results of second system are for characterizing the power whether the business odd numbers is successively inserted into second system Equal controls record.
10. the idempotent control device in a kind of net system switching process, described device include:
First receiving module, the call request in net system switching process, receiving the idempotent verification that the first system is sent, institute It states call request and carries business odd numbers;
Second sending module for executing local idempotent verification according to the business odd numbers, and idempotent check results is 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 are used to characterize whether the business odd numbers to be successively inserted into local idempotent control record.
11. the idempotent control system in a kind of net system switching process, the system comprises:
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, to the Two system sends the call request of idempotent verification, and the call request carries business odd numbers;And it is verified and is tied according to the idempotent Fruit determines whether to accept the corresponding business of the business odd numbers;
Idempotent check results are sent to the first system by the second system for executing idempotent verification;Wherein, idempotent verifies As a result it is used to characterize the idempotent control record whether the business odd numbers is successively inserted into second system.
12. system according to claim 11, the upstream business system further include:
Switching switch, the first system or second system are sent to for controlling service request.
13. system according to claim 12, the switching switch is further used for:
The corresponding service request of business in the white list to prestore is sent to the first system, other than the white list The corresponding service request of business is sent to the second system.
14. a kind of computer readable storage medium, is stored thereon with computer program, power is realized when which is executed by processor Profit requires the method described in 1 to 8 any one.
15. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, the processor realize the method described in claim 1 to 8 any one when executing described program.
CN201810497483.9A 2018-05-22 2018-05-22 Idempotent control method, device and system in system switching process Active CN108647105B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810497483.9A CN108647105B (en) 2018-05-22 2018-05-22 Idempotent control method, device and system in system switching process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810497483.9A CN108647105B (en) 2018-05-22 2018-05-22 Idempotent control method, device and system in system switching process

Publications (2)

Publication Number Publication Date
CN108647105A true CN108647105A (en) 2018-10-12
CN108647105B CN108647105B (en) 2022-02-01

Family

ID=63757423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810497483.9A Active CN108647105B (en) 2018-05-22 2018-05-22 Idempotent control method, device and system in system switching process

Country Status (1)

Country Link
CN (1) CN108647105B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553214A (en) * 2021-07-30 2021-10-26 国网电子商务有限公司 Idempotent checking method and device
CN113722122A (en) * 2021-08-13 2021-11-30 北京东方国信科技股份有限公司 RPC (remote procedure call) power equality guarantee method and system
CN113783666A (en) * 2020-11-27 2021-12-10 北京京东振世信息技术有限公司 Method and device for processing service
TWI768403B (en) * 2019-11-29 2022-06-21 大陸商支付寶(杭州)信息技術有限公司 Methods and devices for cryptographic key management based on blockchain system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446801A (en) * 2014-06-23 2016-03-30 阿里巴巴集团控股有限公司 Task processing method and device in distributed system
CN105740258A (en) * 2014-12-09 2016-07-06 阿里巴巴集团控股有限公司 Business processing method and device based on power equal sign check
CN106921712A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN107193827A (en) * 2016-03-14 2017-09-22 阿里巴巴集团控股有限公司 Divide the idempotent control method and device of storehouse point table
CN107229455A (en) * 2016-03-24 2017-10-03 阿里巴巴集团控股有限公司 A kind of method for processing business, apparatus and system
CN107391758A (en) * 2017-08-24 2017-11-24 阿里巴巴集团控股有限公司 Database switching method, device and equipment
US20180131678A1 (en) * 2016-11-10 2018-05-10 International Business Machines Corporation Managing Idempotent Operations while Interacting with a System of Record

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446801A (en) * 2014-06-23 2016-03-30 阿里巴巴集团控股有限公司 Task processing method and device in distributed system
CN105740258A (en) * 2014-12-09 2016-07-06 阿里巴巴集团控股有限公司 Business processing method and device based on power equal sign check
CN106921712A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 A kind of method for processing business and device
CN107193827A (en) * 2016-03-14 2017-09-22 阿里巴巴集团控股有限公司 Divide the idempotent control method and device of storehouse point table
CN107229455A (en) * 2016-03-24 2017-10-03 阿里巴巴集团控股有限公司 A kind of method for processing business, apparatus and system
US20180131678A1 (en) * 2016-11-10 2018-05-10 International Business Machines Corporation Managing Idempotent Operations while Interacting with a System of Record
CN107391758A (en) * 2017-08-24 2017-11-24 阿里巴巴集团控股有限公司 Database switching method, device and equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI768403B (en) * 2019-11-29 2022-06-21 大陸商支付寶(杭州)信息技術有限公司 Methods and devices for cryptographic key management based on blockchain system
CN113783666A (en) * 2020-11-27 2021-12-10 北京京东振世信息技术有限公司 Method and device for processing service
CN113553214A (en) * 2021-07-30 2021-10-26 国网电子商务有限公司 Idempotent checking method and device
CN113553214B (en) * 2021-07-30 2024-04-02 国网数字科技控股有限公司 Idempotent verification method and device
CN113722122A (en) * 2021-08-13 2021-11-30 北京东方国信科技股份有限公司 RPC (remote procedure call) power equality guarantee method and system

Also Published As

Publication number Publication date
CN108647105B (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN108647105A (en) Idempotent control method in net system switching process, apparatus and system
US20210157800A1 (en) Blockchain-based transaction processing methods, apparatuses, and electronic devices
EP3816910B1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
CN109787830A (en) Gray scale distribution control method, device, system, electronic equipment and storage medium
EP3258396A1 (en) Data synchronization method, device and system
US11314727B2 (en) Blockchain management apparatus, blockchain management method, and program
EP3816912A1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
CN108596587B (en) Cash-up auditing method, apparatus, electronic device, program product and storage medium
CN110033280A (en) Pay anti-fluttering method and device
CN109388420A (en) Application upgrade test method, device, computer equipment and storage medium
CN108241616B (en) Message pushing method and device
CN113076248A (en) Application processing method, device and equipment and readable storage medium
CN107864209A (en) The method, apparatus and server of data write-in
CN105095310A (en) Data processing method, first server, second server and data processing system
CN110716730A (en) Gray scale distribution method, device, equipment and computer readable storage medium
CN108959879A (en) Data capture method, device, electronic equipment and the server of application program
CN111784359B (en) Multi-mode wind control grading disaster recovery method and device
US9210147B1 (en) Method, apparatus and computer program product for assessing risk associated with authentication requests
CN112905449A (en) Target test method, device, equipment and storage medium
CN106878369B (en) Service processing method and device
CN105574020B (en) Database operation method and device
CN111124705A (en) Service request processing method and device
CN104239145B (en) A kind of data consistency control method and device based on case mechanism
CN116431367B (en) Method, system and computer readable storage medium for modifying ticket information
CN116627800A (en) Hot-pluggable mock testing method, device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201022

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201022

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant