Specific embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with this Shen
Accompanying drawing that please be in embodiment, is described in detail, it is clear that institute to the technical scheme in the embodiment of the present application
The embodiment of description is only some embodiments of the present application, rather than whole embodiments.Based on the application
In embodiment, the every other embodiment that those of ordinary skill in the art are obtained should all belong to this Shen
The scope that please be protect.
Application scheme is used to process the correlating event with dependence, it is assumed that there are event X and event Y,
The wherein effect of Y is the implementing result for cancelling X, and treatment is seen in logic, and the execution of Y is needed with the execution of X
Premised on, then event X and event Y constitutes one group of correlating event.For example, event X be certain information of issue,
Event Y to recall above- mentioned information, event X be certain account is withholdd, event Y for recall it is above-mentioned withhold,
Etc..For convenience of description, in this application, the X in same group of correlating event is referred to as elementary event, Y
Referred to as cancel event.
The operation framework of application scheme is illustrated as shown in figure 1, at including event request side apparatus 10 and event
Reason side apparatus 20.Wherein event request side apparatus 10 are the request initiator of elementary event and revocation event, thing
Part treatment side apparatus 20 are the actual execution sides of elementary event and revocation event, and two side apparatus can be by various shapes
The real-time performance communication connection of formula, request side apparatus 10 indicate treatment side by sending event handling request message
Equipment 20 processes corresponding event.According to the difference of concrete application scene, the concrete form of two side apparatus both can be with
It is that server apparatus can also be client device, the application need not simultaneously be defined to this.For description side
Just, hereinafter will respectively with " event request side " and the abbreviation other side of " event handling side " in the application
Case is illustrated.
The purpose of design of application scheme is:Event handling side can recognize that the out of order situation of correlating event,
Correct treatment is made in the case where appearance is out of order and event request side is fed back in time, it is to avoid event request
Side re-transmission request message.Also to ensure that the processing mode when correlating event order is normal is unaffected simultaneously.
To meet the demand, the application provides a kind of correlating event processing method, shown in Figure 2, the method
May comprise steps of:
S101, receives treatment request message of the event request side for object event;
S102, the group mark according to object event judges whether to have received the corresponding event handling of group mark
Request message, S106 is performed if otherwise performing S103, being;
S103, judges the type of object event, then performed if elementary event S105, if revocation thing
Part then performs S105;
S104, the treatment operation of performance objective event (specially elementary event);
S105, is not directed to the processing failure of object event (specially cancelling event) to event request side feedback
Message;
S106, judges whether the corresponding elementary event of treated group mark, if it is performs S107, otherwise
Perform S110;
S107, judges the type of object event, and S109 is then performed if revocation event;
S109, the treatment operation of performance objective event (specially cancelling event);
S110, judges the type of object event, and S111 is then performed if elementary event;
S111, not the treatment operation of performance objective event (specially elementary event)
Above-mentioned correlating event processing method, is applied to event handling side apparatus, in S101, event handling side
Equipment receives event handling request message from communication interface, and in this application, the request that will be currently received disappears
Breath asks the event for the treatment of to be referred to as object event, according to the practical application scene of the application, a target
Event had both been probably that elementary event is also likely to be revocation event, and event handling side can be according to event handling request
Entrained information directly distinguishes the event type of the treatment of request in message.
In method flow shown in Fig. 2, other steps in addition to S101 can be divided into two major classes by function:Sentence
Disconnected class step and execution class step, wherein judging class step for the order/out of order feelings of identification events request message
Condition, performing class step is then used to perform corresponding processing mode according to recognition result, to ensure expectation function
It is normal to realize.
The judgement class step in the application method is illustrated first, is related in the method flow shown in Fig. 2
Judgement class step include S102, S103, S106, S107 and S110, illustrate separately below:
The effect of S102 is to judge whether to receive the event handling request message of certain event group first.
In this application, will be a pass for the elementary event of same event body and its revocation event definition
Connection event group, for example for same Confirmation of Orders operation and cancellation operation, for the same receipts of fund
Money and reimbursement operation, etc..The different event group of different event body correspondences, for any one occurrence,
In addition to the event identifier with itself, also with a group mark, if two group mark phases of event
Together, then illustrate that the two events are directed to same event body.
Event handling side can extract the group mark of the request event after an event handling request is received,
And judge whether to have before this and receive the event handling request with same group mark, if otherwise said
Bright is to receive this group for the treatment of request of event first, is to illustrate it is not to receive first.Certainly, no matter sentence
How is disconnected result, and event handling side is required for recording the group mark of current event, for subsequently sentencing
It is disconnected.In this application, need not be defined for group physical record of mark and judgment mode.
The effect of S106 be have determined that be not receive certain event group first message after, determine whether
The type of message for receiving before.
In this application, treatment that can be by inquiring about elementary event is recorded, and this group received before judgement disappears
Breath type.Because the reception and event handling of event handling request message are completed in event handling side,
Here it is considered that not postponing between message sink and event handling.Therefore, for arbitrary event
Group, if the treatment record of elementary event cannot be inquired, the message received before explanation is at revocation event
Reason request message, if instead the treatment record of elementary event can be inquired, received base before explanation
Present event processes request message and processed.
S103, S107 and S110 are the judgements to current goal event type, can be asked according to event handling
Ask entrained information in message directly to determine the event type of request treatment, no longer describe in detail here.
The execution class step in the application method is illustrated below, is related in the method flow shown in Fig. 2
Execution class step include S104, S105, S108, S109, S111 and S112, said separately below
It is bright:
S104, from deterministic process, current goal event is elementary event, and is not received before same
The treatment request of group event, this branches into normal sequence, and it is (specific to process the object event according to normal mode
It is elementary event), it is however generally that, normal process mode mentioned here should also comprise determining whether energy
It is enough to process and operated to event request side feedback processing result etc. is necessary after local completion treatment, this Shen
Please not reinflated explanation.
S105, from deterministic process, current goal event is revocation event, but is not received but before
Cross with the treatment request of group event, illustrate to occur in that it is out of order, now cancel cannot successful execution, but not
Event request side is needed to feed back the message for showing " revocation failure ".
In actual applications, " revocation failure " is the main original for causing event request to stress hair revocation request message
Because of (either automatic triggering or user trigger manually), and the application is sent " revocation failure " by preventing
The mode of message, precisely in order to avoiding other side from retransmitting revocation request message.
In the specific implementation, event handling side still can perform once revocation behaviour according to current request message
Make, but it can be seen from decision logic, the destruction operation is cannot be successful, therefore here can directly by
Processing mode is set to not perform destruction operation, so as to reduce the wasting of resources of event handling side.
In a kind of specific embodiment of the application, can also be directly to event request side feedback for current
The treatment success message of revocation event, it is to be understood that this step does not actually accomplish " revocation " place
Reason, according to the complete execution logic of the application, to ensure the normal realization of expectation function, if this step point
Branch is triggered, then after subsequently received event handling request message, will necessarily trigger S111 branches, so should
" cancelling successfully " message sends in advance equivalent in the case where the normal realization of expectation function is ensured, so that
Reduce the actual wait-for-response time of other side.
S109, from deterministic process, current goal event is revocation event, is received before with group event
Treatment request and treated with group elementary event, this branches into normal sequence, according to normal side
Formula processes the object event (specially cancelling event), it is however generally that, normal process mentioned here
Mode should also comprise determining whether to process and after local completion treatment to event request side feedback at
The necessary operation such as reason result, the not reinflated explanation of the application.
S111, from deterministic process, current goal event is elementary event, but is once received before
With the revocation request of group, illustrate to occur in that out of order.It is the reverse event of elementary event in view of revocation event,
Here it is by the way for the treatment of:Current elementary event is not processed, this way is equivalent to " supporting
Disappear " before the revocation event that does not process, finally, the expected knot with " first substantially cancelling again "
Fruit is consistent.Certainly the demands such as subsequent query are met, when actually keeping a record, still can be according to " basic thing
Part is processed ", the mode of " revocation event processed " recorded.
It can be seen that, application scheme can occur ensureing when message is out of order using the cooperation of S105 and S111
The normal realization of expectation function, and by way of preventing to send revocation event failed message, it is possible to reduce
The situation of event request side re-transmission request message occurs, so as to reduce the wasting of resources, reduce to user's use feeling
It is affected.In addition, the processing mode of " counteracting " can't cause more long delay, if in fact,
Only have elementary event treatment request message to occur postponing in whole process, then the process time of out of order process is not
Can be higher than the process time of normal sequence process, this also reduce further causes event request side because of time-out
The possibility of re-transmission request message.
With reference to Fig. 2 it can be found that in such scheme, thering are two to judge that branch is not related to, this is
Because in some systems, the factor such as meeting connected applications demand, network condition, interacts to event request message
Mechanism is configured so that 1 elementary event request and 1 revocation event are only allowed in same event group
Request, that is to say, that for event handling side, the event request message reception of same event group is sequentially
Only exist two kinds of situations:Elementary event request message → revocation event request message (normal sequence), revocation thing
Part treatment request message → elementary event processes request message (out of order), and two such is left a blank corresponding to branch
Situation is really be not in, therefore only by tetra- execution steps of S104, S105, S109 and S111
Can all of situation of covering:
Situation a, first receives elementary event treatment request message, then receive revocation event handling request message:
First carry out S104 branches, normal process elementary event;
S109 branches, normal process revocation event are performed again.
Situation b, first receives revocation event handling request message, then receive elementary event treatment request message:
S105 branches are first carried out, revocation event is untreated;
S111 branches are performed again, untreated revocation event before counteracting.
If system is not limited the event number in same event group, event handling side joint is received
Treatment request message order then can be increasingly complex, for example may repeatedly receive elementary event treatment request disappear
Breath or revocation event handling request message.For such case, need to only be supplemented on the basis of such scheme
The processing mode of S108 and S112 can ensure the normal realization of expectation function, as shown in figure 3, after supplement
Processing mode is as follows:
S108, from deterministic process, current goal event is elementary event, is received before with group event
Treatment request and treated elementary event with group, the branch is equivalent to repeating to have received for same
The elementary event treatment request of one event ontology, belongs to abnormal condition.Processing mode can normally go to hold
The treatment operation of the capable elementary event, but due to being successfully processed once before, therefore this is performed
Will not succeed, that is, new elementary event result will not be produced.
S112, from deterministic process, current goal event is revocation event, is received before with group event
Treatment request but it is untreated with group elementary event, that is to say, that be once connected to before with group removing
Pin event handling request, the revocation event handling request for same event ontology is have received equivalent to repetition,
Belong to abnormal condition.Processing mode can be the normal treatment operation for going to perform the revocation event, but by
It is cancelled and is not carried out with the treatment request of group elementary event, or elementary event in did not received, therefore this
Performing to succeed, that is, will not produce new revocation event handling result.
As can be seen that the S108 and S112 of supplement are only logically to have done perfect to method flow, it is actual
On can't produce actual effect, so if from simplify treatment from the point of view of, here can also directly by
The processing mode of S108 is set to not perform the treatment operation of the elementary event, sets the processing mode of S112
For the treatment for not performing the revocation event is operated, so as to reduce the resource consumption of event handling side.
Explanation is needed exist for, due to receiving the possibility of revocation event handling request in the presence of repetition, therefore
When S109 is performed, according to normal processing mode, can first judge object event same group of elementary event whether
It has been be revoked that, if be not revoked, further performed the destruction operation of the elementary event.If removed
Pin, illustrate to be currently needed for the revocation event of a repetition for the treatment of, and destruction operation will not be successfully, if conformed to the principle of simplicity
From the point of view of change treatment, processing mode directly can also be set to not perform the place of the revocation event here
Reason operation, so as to reduce the resource consumption of event handling side.
With reference to several specific situations being likely to occur, the handling process after improving is illustrated:
Foregoing situation a and situation b is not repeated explanation
Situation c, continuously receives the request message of elementary event treatment twice:
First carry out S104 branches, normal process elementary event;
S108 branches are performed again, and the elementary event for repeating does not produce actual effect.
Situation d, continuously receives revocation event handling request message twice:
S105 branches are first carried out, revocation event is untreated;
S112 branches are performed again, and the revocation event for repeating does not produce actual effect.
Situation e, first receives elementary event treatment request message, then receives revocation event handling request message, then
Receive elementary event treatment request message:
First carry out S104 branches, normal process elementary event;
S109 branches, normal process revocation event are performed again;
S108 branches are performed again, and the elementary event for repeating does not produce actual effect.
Situation f, first receives revocation event handling request message, then receives elementary event treatment request message, then
Receive revocation event handling request message:
S105 branches are first carried out, revocation event is untreated;
S111 branches are performed again, untreated revocation event before counteracting;
S112 branches are performed again, and the revocation event for repeating does not produce actual effect.
Increasingly complex message sequence situation, does not do exhaustive one by one herein.It can be seen that, even without to same
Event number in event group is limited, still can be to the various feelings that are likely to occur using application scheme
Shape is made and meets expected correct treatment.In addition, according to the introduction of preceding embodiment, in S111 with " counteracting "
Mode perform elementary event and its revocation event after, regardless of whether the treatment record of generation elementary event,
All without final result is influenceed, illustrate:After " counteracting " operation was performed once, subsequently
Have received again with the elementary event treatment request message of group, S108 performed if treatment record is generated before,
S111 is performed if treatment record is not generated before, the request of this elementary event will not produce actual effect.
Similarly, if whether the follow-up revocation event handling request message that have received with group, gave birth to according to before again
Recorded into treatment, S109 or S112 may be triggered, regardless of whether triggering which branch, revocation event will not
Produce actual effect.
Corresponding to above method embodiment, the application also provides a kind of correlating event for being applied to event handling side
Processing unit, shown in Figure 4, the device can include:
Message reception module 210, for receiving treatment request message of the event request side for object event;
First judge module 221, for being identified according to the group of object event, judges whether to have received group mark
Corresponding event handling request message;
Second judge module 222, for judging whether the corresponding elementary event of treated group mark;
3rd judge module 223, the type for judging object event;
First performing module 231, for not receiving the corresponding event handling request message of group mark and mesh
In the case that mark event is elementary event, the treatment operation of performance objective event;
Second performing module 232, for not receiving the corresponding event handling request message of group mark and mesh
In the case that mark event is revocation event, the processing failure to event request side feedback for object event does not disappear
Breath;
3rd performing module 233, for receiving the corresponding event handling request message of group mark, locating
Managed the group corresponding elementary event of mark and in the case that object event is revocation event, performance objective event
Treatment operation;
4th performing module 234, for receiving the corresponding event handling request message of group mark, not locating
Managed the group corresponding elementary event of mark and in the case that object event is elementary event, not performance objective thing
The treatment operation of part.
In a kind of specific embodiment of the application, the second performing module can be specifically for:Please to event
Side is asked to feed back the treatment success message for current revocation event.
In a kind of specific embodiment of the application, the second performing module can be specifically for:
The not treatment operation of performance objective event;
Or
After the treatment operation failure of performance objective event, the place of object event is not directed to event request side feedback
Reason failed message.
Shown in Figure 5, in a kind of specific embodiment of the application, said apparatus can also include the
Five performing modules 235, for received the corresponding event handling request message of group mark, processed group
Identify in the case that corresponding elementary event and object event be elementary event, not the place of performance objective event
Reason operation.
In a kind of specific embodiment of the application, said apparatus can also include the 6th performing module 236,
For to have received the corresponding event handling request message of group mark, untreated group of mark corresponding basic
In the case that event and object event are revocation event, the not treatment operation of performance objective event.
It is understood that the 5th performing module 235 and the 6th performing module 236 are used as two kinds of functional independences
Module, both can as shown in Figure 5 simultaneously configuration in a device, it is also possible to individually configure in a device,
Therefore the structure shown in Fig. 5 should not be construed as the restriction to application scheme.
The function of modules and the implementation process of effect specifically refer to correspondence step in the above method in said apparatus
Rapid implementation process, will not be repeated here.
As seen through the above description of the embodiments, those skilled in the art can be understood that this
Application can add the mode of required general hardware platform to realize by software.Based on such understanding, this Shen
The part that technical scheme please substantially contributes to prior art in other words can be in the form of software product
Embody, the computer software product can be stored in storage medium, such as ROM/RAM, magnetic disc,
CD etc., including some instructions are used to so that computer equipment (can be personal computer, server,
Or the network equipment etc.) perform method described in some parts of each embodiment of the application or embodiment.
Each embodiment in this specification is described by the way of progressive, identical phase between each embodiment
As part mutually referring to what each embodiment was stressed is the difference with other embodiment.
For especially for device embodiment, because it is substantially similar to embodiment of the method, so describing to compare
Simply, the relevent part can refer to the partial explaination of embodiments of method.Device embodiment described above is only
It is only illustrative, wherein the module illustrated as separating component can be or may not be physics
It is upper separate, when application scheme is implemented can the function of each module in same or multiple softwares and/or
Realized in hardware.Some or all of module therein can also be according to the actual needs selected to realize this reality
Apply the purpose of a scheme.Those of ordinary skill in the art are without creative efforts, you can with
Understand and implement.
The above is only the specific embodiment of the application, it is noted that common for the art
For technical staff, on the premise of the application principle is not departed from, some improvements and modifications can also be made,
These improvements and modifications also should be regarded as the protection domain of the application.