CN109324925A - The transaction methods and device of Distributed Architecture - Google Patents
The transaction methods and device of Distributed Architecture Download PDFInfo
- Publication number
- CN109324925A CN109324925A CN201810998303.5A CN201810998303A CN109324925A CN 109324925 A CN109324925 A CN 109324925A CN 201810998303 A CN201810998303 A CN 201810998303A CN 109324925 A CN109324925 A CN 109324925A
- Authority
- CN
- China
- Prior art keywords
- subelement
- rollback
- unit
- executes
- program
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1474—Saving, restoring, recovering or retrying in transactions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Retry When Errors Occur (AREA)
Abstract
The embodiment of the present invention provides the transaction methods and device of a kind of Distributed Architecture.The described method includes: obtaining the subelement of the first unit after detecting that first unit receives process exception message;Wherein, the first unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services have execution order;According to the execution order, backward executes rollback to the subelement, determines the corresponding target subelement of the process exception message;It determines the object invocation program for calling the target subelement, the process exception message is dished out to the object invocation program.The embodiment of the invention provides a kind of modes of the service exception problem in processing distributed type assemblies environment, to ensure the integrality of affairs in Distributed Architecture;Flexible rollback configuration is provided simultaneously for each unit or subelement.
Description
Technical field
The present embodiments relate to the transaction methods of field of computer technology more particularly to a kind of Distributed Architecture and
Device.
Background technique
Distributed environment is by different location, with different function or possesses the multiple stage computers of different data and pass through communication
A kind of computer system that network connection is got up completes extensive letter under the unified management control of control system in phase
Cease processing task.In distributed type assemblies environment, some business need to complete across multiple services, and these services were being called
It is possible that service exception in journey, so as to cause the imperfect of entire affairs, accordingly, it is desirable to provide a kind of processing business is abnormal
Mode, with realize the integrality of affairs is ensured.
Summary of the invention
The embodiment of the present invention provides the transaction methods and device of a kind of Distributed Architecture, and its purpose is to provide one
The mode of service exception problem in kind processing distributed type assemblies environment.
On the one hand, the embodiment of the present invention provides a kind of transaction methods of Distributed Architecture, which comprises
After detecting that first unit receives process exception message, the subelement of the first unit is obtained;Wherein, described
First unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services
With execution order;
According to the execution order, backward executes rollback to the subelement, determines that the process exception message is corresponding
Target subelement;
It determines the object invocation program for calling the target subelement, the process exception message is dished out to the target
Caller.
On the other hand, the embodiment of the present invention provides a kind of transacter of Distributed Architecture, and described device includes:
It obtains module and obtains the son of the first unit after detecting that first unit receives process exception message
Unit;Wherein, the first unit executes a destination service, and each subelement executes the son clothes of a destination service
Business, and the sub-services have execution order;
Roll-back module, for according to the execution order, backward to execute rollback to the subelement, determines that the process is different
The corresponding target subelement of normal message;
It dishes out module, for determining the object invocation program for calling the target subelement, by the process exception message
It dishes out to the object invocation program.
On the other hand, the embodiment of the invention also provides a kind of electronic equipment, including memory, processor, bus and
The computer program that can be run on a memory and on a processor is stored, the processor is realized above-mentioned when executing described program
Step in the transaction methods of Distributed Architecture.
In another aspect, being stored thereon with the embodiment of the invention also provides a kind of non-transient computer readable storage medium
Computer program realizes the step in the transaction methods of above-mentioned Distributed Architecture when described program is executed by processor.
The transaction methods and device of Distributed Architecture provided in an embodiment of the present invention, detect that first unit receives
After process exception message, the subelement of the first unit is obtained;The execution order of sub-services, backward pair are executed according to subelement
The subelement executes rollback, with the corresponding target subelement of the determination process exception message, and further determines that and calls institute
The object invocation program for stating target subelement dishes out the process exception message to the object invocation program;The present invention is real
It applies example and provides a kind of mode for handling the service exception problem in distributed type assemblies environment, to ensure affairs in Distributed Architecture
Integrality;Flexible rollback configuration is provided for each unit or subelement simultaneously, can be automatically controled event when breaking down
Hinder unit and carry out rollback, and to process exception message is thrown off, convenient for the timely treatment progress exception of object invocation program.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the flow diagram of the transaction methods of Distributed Architecture provided in an embodiment of the present invention;
Fig. 2 is the first exemplary Distributed Architecture schematic diagram of the embodiment of the present invention;
Fig. 3 is the structural schematic diagram of the transacter of Distributed Architecture provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 shows a kind of flow diagram of the transaction methods of Distributed Architecture provided in an embodiment of the present invention.
As shown in Figure 1, the transaction methods of Distributed Architecture provided in an embodiment of the present invention, the method specifically include
Following steps:
Step 101, after detecting that first unit receives process exception message, the subelement of the first unit is obtained;
Wherein, the first unit executes a destination service, and each subelement executes the sub-services of a destination service, and institute
Sub-services are stated with execution order.
Wherein, first unit is any service unit in Distributed Architecture.First unit executes a destination service, and the mesh
Mark service include at least two sub-services, two sub-services respectively by first unit subelement execute, and each sub-services it
Between have execution order.Optionally, each unit or the institutional framework (relationship between superior and subordinate between node) of subelement pass through
Spring configuration file is configured;The scheduling of each unit or subelement is by Spring towards tangent plane programming (Aspect
Oriented Programming, AOP) it realizes.
After process exception occurs in subelement, subelement is by process exception message to being thrown off to first unit.If distribution
Formula frame detects that first unit receives process (process) unexpected message from its subelement, obtains first unit packet
The subelement included, to determine the generation position of process exception.
As the first example, referring to fig. 2, Fig. 2 show the Distributed Architecture of a tree structure, wherein using unit 3 as
For first unit, unit 3 executes a destination service, and the destination service includes 3 sub-services, respectively by unit 4, unit 5
And unit 6 executes, and execution sequence is followed successively by unit 4, unit 5, unit 6;If unit 3 is received from unit 4, unit 5
Or the process exception message of unit 6, then the subelement information of Distributed Architecture acquiring unit 3.
Step 102, according to the execution order, backward executes rollback to the subelement, determines that the process exception disappears
Cease corresponding target subelement.
Wherein, rollback (Rollback) refers to program or data processing mistake, program or data is restored to last correct
The behavior of state.After determining the subelement that first unit includes, sequence is executed according to what each subelement was configured, backward is to each
Subelement carries out rollback, that is, executes the process of service or sub-services, and the execution order that each unit or subelement configure inversely performs,
Rollback is inversely carried out when occurring abnormal, and during rollback, determines the corresponding target subelement of process exception message, i.e.,
The position that process exception occurs.
With continued reference to Fig. 2, rollback is carried out to the subelement of unit 3, then rollback order is successively are as follows: unit 6, unit 5, unit
4。
Step 103, determine the object invocation program for calling the target subelement, by the process exception message dish out to
The object invocation program.
Wherein it is determined that further determining that after the target subelement of generation process exception and calling the target subelement
Object invocation program dishes out process exception message to the object invocation program, knows that target is single convenient for object invocation program
Process exception occurs for member, and treatment progress is abnormal in time.
In the above embodiment of the present invention, after detecting that first unit receives process exception message, it is single to obtain described first
The subelement of member;The execution order of sub-services is executed according to subelement, backward executes rollback to the subelement, described in determination
The corresponding target subelement of process exception message, and further determine that the object invocation program for calling the target subelement, it will
The process exception message is dished out to the object invocation program;The embodiment of the invention provides a kind of processing distributed type assemblies rings
The mode of service exception problem in border, to ensure the integrality of affairs in Distributed Architecture;It is single for each unit or son simultaneously
Member provides flexible rollback configuration, can be automatically controled trouble unit when breaking down and carries out rollback, and to being thrown off process
Unexpected message is abnormal convenient for the timely treatment progress of object invocation program.
Optionally, in the embodiment of the present invention, described according to the execution order, backward executes rollback to the subelement
Step, comprising:
According to the execution order, backward obtains the default execution parameter of the subelement, and the default execution parameter is used
The process of corresponding sub-services whether has been executed in the instruction subelement;
If the default execution parameter indicates that the subelement is not carried out the process, skips the subelement and obtain
The default execution parameter of next subelement;
If the default execution parameter indicates that the subelement has executed the process, the subelement is executed back
Rolling, and obtain the default execution parameter of next subelement.
Wherein, it presets execution parameter and is used to indicate the process whether subelement has executed corresponding sub-services, right
During subelement carries out rollback, judged whether according to default execution parameter to each subelement process rollback;If default hold
Row parameter indicates that current subelement is not carried out the process, then skips the subelement, not to the subelement process rollback, and continue
Judge whether next subelement needs rollback, obtains the default execution parameter of next subelement;Conversely, if default execute ginseng
Number indicates that current subelement has executed the process, then executes rollback to the subelement, and continue to judge next subelement
Whether rollback is needed, obtains the default execution parameter of next subelement.
In above-described embodiment, support section subelement rollback, due in distributed type assemblies environment, when the processing of whole flow process
Between it is longer, it is larger to be related to data volume, after exception occurs in one link in centre, can not have to entire link and carry out rollback, only
Currently there is abnormal unit in rollback.
Referring to fig. 2, process abnormal (i.e. process exception) is that unit 5 occurs, and unit 6 is not carried out at this time, in rollback
During, it can judge whether active cell has executed according to the default parameter that executes, can be skipped if being not carried out, is i.e. unit 6
Rollback method will not be executed really.After the completion of 3 rollback of unit, can front unit 5 occur abnormal to being thrown off, throw
It gives top-ranked unit (General Init unit), the top-ranked unit exception can be thrown to the program of calling (is dished out
PaaSException)。
As another implementation, first unit can be also arranged to automatic rollback unit, even first unit is connecing
It receives its subelement to dish out after process exception message, rollback processing can be carried out automatically.As shown in Fig. 2, occurring in unit 5
Process is abnormal, and 5 superior node of unit is dished out process exception information;After unit 3 receives process exception, due to
Unit 3 is automatic rollback unit, and can all subelements of unit 3 be carried out with rollback, and execution sequence is as follows: unit 6, unit 5, list
Member 4.
Optionally, in the embodiment of the present invention, described the step of rollback is executed to the subelement, comprising:
If occurring rollback exception in rollback process, by the rollback exception throws to the calling journey for calling the subelement
Sequence.
That is, during rollback, it, will be described in the rollback exception throws to calling if there is rollback exception
The caller of unit, i.e., object invocation program described above know the unit hair of current rollback convenient for object invocation program
Raw rollback is abnormal, and processing rollback in time is abnormal.
With continued reference to Fig. 2, if unit 6 and unit 5 complete rolling back action, rollback exception occur in unit 4, (rollback is different
Often), the rollback can throw to unit 3 upwards extremely at this time, and unit 3, which continues up, dishes out, and throw to GeneralUnit,
GeneralUnit can throw the exception to the program (dish out PaaSException) of calling, and object invocation program is to rollback at this time
Abnormality processing, after having handled, triggering continues rollback and completes this rollback, is handled again by specific requirements later.
Optionally, in the embodiment of the present invention, the method also includes:
In the first unit before executing the destination service, make the first unit call each sub-services into
Journey.
Wherein, every height list is preferentially called before performance objective service for each first unit with subelement
The sub-services of member, i.e., carry out each subelement executing preceding method of calibration, can be called before the execution of current subelement, be used for school
Test whether current subelement has relevant execution condition.
Optionally, in the embodiment of the present invention, the method also includes:
In the first unit before executing rollback, the first unit is made to call the rollback program of each subelement.
Wherein, in the rollback logic of the embodiment of the present invention, first unit is made to call the Rollback of all subelements first
Then process executes the rollback service logic program of this unit again.If occurring abnormal to being thrown off
UnitProcessException is abnormal.
Specifically, as the second example, the Distributed Architecture in Fig. 2 includes top-ranked unit General Unit, unit 1,
Each subelement of unit 2, unit 3 and User defined element and unit 3: unit 4, unit 5, unit 6;Wherein, exist
On service logic is realized, all units are inherited from Unit class, and realize following abstract method:
(1) process method
All subelements execute logic and realize, can call the Process of all subelements first in the method, then again
Execute the service logic program of top-ranked unit;If occurring abnormal abnormal to UnitProcessException is thrown off.
(2) rollback method
Top-ranked unit rollback logic is realized, can call the Rollback method of all subelements first in the method, so
Execute the rollback service logic program of this unit again afterwards.If occurring abnormal abnormal to UnitProcessException is thrown off.
(3) globalCheck method
Global method of calibration can be called before all units and subelement execute, push up for verifying active cell
Whether grade cell node has relevant execution condition before executing.
(4) beforeProcessCheck method
Method of calibration before unit executes can be called, for verifying whether active cell has before active cell execution
Relevant execution condition.
(5) afterProcessCheck method
Method of calibration after unit executes can be called, for verifying patrolling for active cell execution after active cell execution
It whether correct collects.
(6) processTakeSeconds method
Unit executes time-out time configuration, and the time-out time of service or sub-services is executed for configuration unit or subelement.
Optionally, in the embodiment of the present invention, the method also includes:
Record that the rollback is abnormal and/or the exception information of the process exception.
Wherein, for the processing progress that follows up, processing rollback in time is abnormal and/or the process exception, the embodiment of the present invention
In go back recording exceptional information.
Specifically, as third example, referring to table 1, the embodiment of the present invention provides a user interface (User
Interface, UI), the interface UI includes table 1, checks exception information convenient for recording exceptional information and user.
Table 1:
Wherein, exception information includes process identification number (ID), unit title, User ID, Business Name, time started, knot
Beam time, state, Exception Type (process exception or rollback are abnormal) and IP address;When user chooses Business Name (such as
Mouse is placed on abnormal summary info column), it can check specific exception information;But for detailed exception information log,
It needs to be checked by journal file.
When using the page, to avoid operating mistake that from can inquiring the exception information of target user by input User ID,
The maloperation for operating other users is avoided the occurrence of, and data newly-generated in the list can be aligned to front.
In the UI page, subsequent operation function can be also provided for user, including is restored to execute, continued rollback, whole rollbacks
Etc. functions;User clicks corresponding function, and frame system is submitted to backstage asynchronous execution;And backstage executes the length of time not
One, but the interface UI on foreground will not automatic refresh page, need user oneself manual refreshing, or according to whether abnormal look into occur
It askes exception information and checks the current execution state of each unit.
In subsequent operation function, restore execution and refer to after there is exception, developer solves specific according to exception information
The problem of after, clicking " restore execute " scheduler program can continue to execute according to present case, comprising: 1, occur after executing exception,
It is continued to execute according to the unit (or subelement) of rollback again according to since active cell;2, after there is rollback exception, after
It is continuous to execute rollback, by all exception throws.
Continue rollback and refer to rollback exception occur in program, after related personnel repairs this exception, continues to execute back
Rolling operation, by abnormal to being thrown off, the rolling back action before completing before.
Whole rollbacks, which refer to, carries out whole rollbacks from back to front for current business process, if what business procedure did not completed,
Carry out rollback from back to front since unfinished unit;If business procedure is completed, since the last one unit
Rollback forward.
In the above embodiment of the present invention, after detecting that first unit receives process exception message, it is single to obtain described first
The subelement of member;The execution order of sub-services is executed according to subelement, backward executes rollback to the subelement, described in determination
The corresponding target subelement of process exception message, and further determine that the object invocation program for calling the target subelement, it will
The process exception message is dished out to the object invocation program;The embodiment of the invention provides a kind of processing distributed type assemblies rings
The mode of service exception problem in border, to ensure the integrality of affairs in Distributed Architecture;It is single for each unit or son simultaneously
Member provides flexible rollback configuration, can be automatically controled trouble unit when breaking down and carries out rollback, and to being thrown off process
Unexpected message is abnormal convenient for the timely treatment progress of object invocation program;And support section subelement rollback, due to distributed type assemblies
In environment, the processing time of whole flow process is longer, and it is larger to be related to data volume, can be with after in centre, exception occurs in one link
Rollback is carried out without entire link, only abnormal unit currently occurs in rollback.
The transaction methods of Distributed Architecture provided in an embodiment of the present invention are described above, are situated between below in conjunction with attached drawing
Continue the transacter of Distributed Architecture provided in an embodiment of the present invention.
Referring to Fig. 3, present invention implementation provides a kind of transacter of Distributed Architecture, and described device includes:
It obtains module 301 and obtains the first unit after detecting that first unit receives process exception message
Subelement;Wherein, the first unit executes a destination service, and each subelement executes the son clothes of a destination service
Business, and the sub-services have execution order.
Wherein, first unit is any service unit in Distributed Architecture.First unit executes a destination service, and the mesh
Mark service include at least two sub-services, two sub-services respectively by first unit subelement execute, and each sub-services it
Between have execution order.Optionally, each unit or the institutional framework (relationship between superior and subordinate between node) of subelement pass through
Spring configuration file is configured;The scheduling of each unit or subelement is by Spring towards tangent plane programming (Aspect
Oriented Programming, AOP) it realizes.
After process exception occurs in subelement, subelement is by process exception message to being thrown off to first unit.If distribution
Formula frame detects that first unit receives process (process) unexpected message from its subelement, obtains first unit packet
The subelement included, to determine the generation position of process exception.
Roll-back module 302, for according to the execution order, backward to execute rollback to the subelement, determine it is described into
The corresponding target subelement of journey unexpected message.
Wherein, rollback (Rollback) refers to program or data processing mistake, program or data is restored to last correct
The behavior of state.After determining the subelement that first unit includes, sequence is executed according to what each subelement was configured, backward is to each
Subelement carries out rollback, that is, executes the process of service or sub-services, and the execution order that each unit or subelement configure inversely performs,
Rollback is inversely carried out when occurring abnormal, and during rollback, determines the corresponding target subelement of process exception message, i.e.,
The position that process exception occurs.
Module of dishing out 303 disappears the process exception for determining the object invocation program for calling the target subelement
Breath is dished out to the object invocation program.
Wherein it is determined that further determining that after the target subelement of generation process exception and calling the target subelement
Object invocation program dishes out process exception message to the object invocation program, knows that target is single convenient for object invocation program
Process exception occurs for member, and treatment progress is abnormal in time.
Optionally, in the embodiment of the present invention, the roll-back module 302 includes:
Acquisition submodule, for according to the execution order, backward to obtain the default execution parameter of the subelement, described
The default parameter that executes is used to indicate the process whether subelement has executed corresponding sub-services;
First rollback submodule, if indicating that the subelement is not carried out the process for the default execution parameter,
It skips the subelement and obtains the default execution parameter of next subelement;
Second rollback submodule, if indicating that the subelement has executed the process for the default execution parameter,
Rollback is executed to the subelement, and obtains the default execution parameter of next subelement.
Optionally, in the embodiment of the present invention, the roll-back module 302 includes:
Dish out submodule, if for occurring rollback exception in rollback process, will the rollback exception throws to described in calling
The caller of subelement.
Optionally, in the embodiment of the present invention, described device further include:
Information logging modle, for recording, the rollback is abnormal and/or the exception information of the process exception.
Optionally, in the embodiment of the present invention, described device further include:
First calling module, for before executing the destination service, making the first unit in the first unit
Call the process of each sub-services.
Optionally, in the embodiment of the present invention, described device further include:
Second calling module, it is each in the first unit calling before executing rollback, the first unit
The rollback program of subelement.
In the above embodiment of the present invention, after detecting that first unit receives process exception message, obtains module 301 and obtain
The subelement of the first unit;Roll-back module 302 executes the execution order of sub-services according to subelement, and backward is single to the son
Member executes rollback, with the corresponding target subelement of the determination process exception message, and further determines that and calls target
The object invocation program of unit, module of dishing out 303 dish out the process exception message to the object invocation program;The present invention
Embodiment provides a kind of mode for handling the service exception problem in distributed type assemblies environment, to ensure thing in Distributed Architecture
The integrality of business;Flexible rollback configuration is provided for each unit or subelement simultaneously, can be automatically controled when breaking down
Trouble unit carries out rollback, and to process exception message is thrown off, convenient for the timely treatment progress exception of object invocation program.
Fig. 4 shows the structural schematic diagram of a kind of electronic equipment of further embodiment of this invention offer.
Referring to fig. 4, electronic equipment provided in an embodiment of the present invention, the electronic equipment include memory (memory) 41,
Processor (processor) 42, bus 43 and it is stored in the computer program that can be run on memory 41 and on a processor.
Wherein, the memory 41, processor 42 complete mutual communication by the bus 43.
The processor 42 is used to call the program instruction in the memory 41, realizes when executing described program such as this
The method provided in invention above-described embodiment.
In another embodiment, following method is realized when the processor executes described program:
After detecting that first unit receives process exception message, the subelement of the first unit is obtained;Wherein, described
First unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services
With execution order;
According to the execution order, backward executes rollback to the subelement, determines that the process exception message is corresponding
Target subelement;
It determines the object invocation program for calling the target subelement, the process exception message is dished out to the target
Caller.
Electronic equipment provided in an embodiment of the present invention can be used for executing the corresponding program of method of above method embodiment,
This implementation repeats no more.
Electronic equipment provided in an embodiment of the present invention after detecting that first unit receives process exception message, obtains institute
State the subelement of first unit;The execution order of sub-services is executed according to subelement, backward executes rollback to the subelement, with
It determines the corresponding target subelement of the process exception message, and further determines that the object invocation for calling the target subelement
Program dishes out the process exception message to the object invocation program;The embodiment of the invention provides a kind of processing distributions
The mode of service exception problem in formula cluster environment, to ensure the integrality of affairs in Distributed Architecture;It is simultaneously each list
Member or subelement provide flexible rollback configuration, can be automatically controled trouble unit when breaking down and carry out rollback, and upwards
Process exception of dishing out message is abnormal convenient for the timely treatment progress of object invocation program.
A kind of non-transient computer readable storage medium that further embodiment of this invention provides, the non-transient computer can
It reads to be stored with computer program on storage medium, realize when described program is executed by processor as mentioned in the above embodiment of the present invention
Step in the method for confession.
In another embodiment, following method is realized when described program is executed by processor:
After detecting that first unit receives process exception message, the subelement of the first unit is obtained;Wherein, described
First unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services
With execution order;
According to the execution order, backward executes rollback to the subelement, determines that the process exception message is corresponding
Target subelement;
It determines the object invocation program for calling the target subelement, the process exception message is dished out to the target
Caller.
Non-transient computer readable storage medium provided in an embodiment of the present invention, realization when described program is executed by processor
The method of above method embodiment, this implementation repeat no more.
It is different to detect that first unit receives process for non-transient computer readable storage medium provided in an embodiment of the present invention
After normal message, the subelement of the first unit is obtained;The execution order of sub-services is executed according to subelement, backward is to the son
Unit executes rollback, with the corresponding target subelement of the determination process exception message, and further determines that and calls the target
The object invocation program of subelement dishes out the process exception message to the object invocation program;The embodiment of the present invention mentions
A kind of mode of the service exception problem in processing distributed type assemblies environment is supplied, to ensure the complete of affairs in Distributed Architecture
Property;Flexible rollback configuration is provided for each unit or subelement simultaneously, can be automatically controled trouble unit when breaking down
Rollback is carried out, and to process exception message is thrown off, convenient for the timely treatment progress exception of object invocation program.
Further embodiment of this invention discloses a kind of computer program product, and the computer program product is non-including being stored in
Computer program in transitory computer readable storage medium, described program include program instruction, when described program instruction is counted
When calculation machine executes, computer is able to carry out method provided by above-mentioned each method embodiment, for example,
After detecting that first unit receives process exception message, the subelement of the first unit is obtained;Wherein, described
First unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services
With execution order;
According to the execution order, backward executes rollback to the subelement, determines that the process exception message is corresponding
Target subelement;
It determines the object invocation program for calling the target subelement, the process exception message is dished out to the target
Caller.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (10)
1. a kind of transaction methods of Distributed Architecture characterized by comprising
After detecting that first unit receives process exception message, the subelement of the first unit is obtained;Wherein, described first
Unit executes a destination service, and each subelement executes the sub-services of a destination service, and the sub-services have
Execution order;
According to the execution order, backward executes rollback to the subelement, determines the corresponding target of the process exception message
Subelement;
It determines the object invocation program for calling the target subelement, the process exception message is dished out to the object invocation
Program.
2. backward is single to the son the method according to claim 1, wherein described according to the execution order
Member executes the step of rollback, comprising:
According to the execution order, backward obtains the default execution parameter of the subelement, and the default execution parameter is for referring to
Show whether the subelement has executed the process of corresponding sub-services;
If the default execution parameter indicates that the subelement is not carried out the process, skips the subelement and obtain next
The default execution parameter of a subelement;
If the default execution parameter indicates that the subelement has executed the process, rollback is executed to the subelement, and
Obtain the default execution parameter of next subelement.
3. the method according to claim 1, wherein described the step of executing rollback to the subelement, comprising:
If occurring rollback exception in rollback process, by the rollback exception throws to the caller for calling the subelement.
4. according to the method described in claim 3, it is characterized by further comprising:
Record that the rollback is abnormal and/or the exception information of the process exception.
5. the method according to claim 1, wherein further include:
In the first unit before executing the destination service, the first unit is made to call the process of each sub-services.
6. the method according to claim 1, wherein further include:
In the first unit before executing rollback, the first unit is made to call the rollback program of each subelement.
7. a kind of transacter of Distributed Architecture characterized by comprising
It obtains module and obtains the subelement of the first unit after detecting that first unit receives process exception message;
Wherein, the first unit executes a destination service, and each subelement executes the sub-services of a destination service, and institute
Sub-services are stated with execution order;
Roll-back module, for according to the execution order, backward to execute rollback to the subelement, determines that the process exception disappears
Cease corresponding target subelement;
Module of dishing out dishes out the process exception message for determining the object invocation program for calling the target subelement
To the object invocation program.
8. device according to claim 7, which is characterized in that the roll-back module includes:
Acquisition submodule, for according to the execution order, backward to obtain the default execution parameter of the subelement, described default
It executes parameter and is used to indicate the process whether subelement has executed corresponding sub-services;
First rollback submodule is skipped if indicating that the subelement is not carried out the process for the default execution parameter
The subelement and the default execution parameter for obtaining next subelement;
Second rollback submodule, if indicating that the subelement has executed the process for the default execution parameter, to institute
It states subelement and executes rollback, and obtain the default execution parameter of next subelement.
9. a kind of electronic equipment, which is characterized in that on a memory and can be including memory, processor, bus and storage
The computer program run on processor, the processor are realized when executing described program such as any one of claims 1 to 6 institute
Step in the transaction methods for the Distributed Architecture stated.
10. a kind of non-transient computer readable storage medium, is stored thereon with computer program, it is characterised in that: described program
The step in the transaction methods such as Distributed Architecture described in any one of claims 1 to 6 is realized when being executed by processor
Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810998303.5A CN109324925A (en) | 2018-08-29 | 2018-08-29 | The transaction methods and device of Distributed Architecture |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810998303.5A CN109324925A (en) | 2018-08-29 | 2018-08-29 | The transaction methods and device of Distributed Architecture |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109324925A true CN109324925A (en) | 2019-02-12 |
Family
ID=65264186
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810998303.5A Pending CN109324925A (en) | 2018-08-29 | 2018-08-29 | The transaction methods and device of Distributed Architecture |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109324925A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110347533A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | The processing method of data exception, calculates equipment and medium at device |
CN111277639A (en) * | 2020-01-16 | 2020-06-12 | 中国建设银行股份有限公司 | Method and device for maintaining data consistency |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101620567A (en) * | 2009-08-13 | 2010-01-06 | 恒生电子股份有限公司 | Error locating auxiliary method and device |
CN101853186A (en) * | 2008-12-31 | 2010-10-06 | Sap股份公司 | Distributed transactional recovery system and method |
CN102043682A (en) * | 2011-01-27 | 2011-05-04 | 中国农业银行股份有限公司 | Workflow exception handing method and system |
CN103593236A (en) * | 2013-11-14 | 2014-02-19 | 华为技术有限公司 | Computer equipment, method and device for scheduling service process |
CN107846477A (en) * | 2017-12-21 | 2018-03-27 | 武汉众邦领创技术有限公司 | Transmission communication network management receives the system and method for pipe Internet of Things equipment |
CN107908494A (en) * | 2017-11-10 | 2018-04-13 | 泰康保险集团股份有限公司 | Processing method, device, electronic equipment and the storage medium of anomalous event |
-
2018
- 2018-08-29 CN CN201810998303.5A patent/CN109324925A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101853186A (en) * | 2008-12-31 | 2010-10-06 | Sap股份公司 | Distributed transactional recovery system and method |
CN101620567A (en) * | 2009-08-13 | 2010-01-06 | 恒生电子股份有限公司 | Error locating auxiliary method and device |
CN102043682A (en) * | 2011-01-27 | 2011-05-04 | 中国农业银行股份有限公司 | Workflow exception handing method and system |
CN103593236A (en) * | 2013-11-14 | 2014-02-19 | 华为技术有限公司 | Computer equipment, method and device for scheduling service process |
CN107908494A (en) * | 2017-11-10 | 2018-04-13 | 泰康保险集团股份有限公司 | Processing method, device, electronic equipment and the storage medium of anomalous event |
CN107846477A (en) * | 2017-12-21 | 2018-03-27 | 武汉众邦领创技术有限公司 | Transmission communication network management receives the system and method for pipe Internet of Things equipment |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110347533A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | The processing method of data exception, calculates equipment and medium at device |
CN111277639A (en) * | 2020-01-16 | 2020-06-12 | 中国建设银行股份有限公司 | Method and device for maintaining data consistency |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110138837A (en) | Request processing method, device, computer equipment and storage medium | |
US11269718B1 (en) | Root cause detection and corrective action diagnosis system | |
US10439937B2 (en) | Service addressing in distributed environment | |
JP6332774B2 (en) | Network function virtualized NFV failure management apparatus, device, and method | |
CN106502769A (en) | Distributed transaction processing method, apparatus and system | |
TWI255109B (en) | Autonomic server farm, method of server failure diagnosis, and self-healing in a server farm | |
CN104991821B (en) | method and device for processing monitoring tasks in batches | |
CN109286529A (en) | A kind of method and system for restoring RabbitMQ network partition | |
CN110807064B (en) | Data recovery device in RAC distributed database cluster system | |
US20070168201A1 (en) | Formula for automatic prioritization of the business impact based on a failure on a service in a loosely coupled application | |
CN107145406A (en) | A kind of disaster-tolerant backup method and system based on Clustering | |
US11108638B1 (en) | Health monitoring of automatically deployed and managed network pipelines | |
CN109324925A (en) | The transaction methods and device of Distributed Architecture | |
TW573266B (en) | Universal service management system | |
CN116016123A (en) | Fault processing method, device, equipment and medium | |
CN110543462A (en) | Microservice reliability prediction method, prediction device, electronic device, and storage medium | |
CN107426012B (en) | Fault recovery method and device based on super-fusion architecture | |
CN113377535A (en) | Distributed timing task allocation method, device, equipment and readable storage medium | |
WO2011144386A1 (en) | Transaction processing system | |
CN114064343B (en) | Abnormal handling method and device for block chain | |
CN110362294A (en) | Development task executes method, apparatus, electronic equipment and storage medium | |
US20210373868A1 (en) | Automated Deployment And Management Of Network Intensive Applications | |
CN109688232A (en) | A kind of mirror image retrogressive method, mirror image backtracking system and proxy server | |
CN114237910A (en) | Client load balancing implementation method and device | |
JP2006285453A (en) | Information processor, information processing method, and information processing program |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190212 |