CN101676933B - Message subscription and distribution method based on change of state in flow control - Google Patents

Message subscription and distribution method based on change of state in flow control Download PDF

Info

Publication number
CN101676933B
CN101676933B CN200810222436XA CN200810222436A CN101676933B CN 101676933 B CN101676933 B CN 101676933B CN 200810222436X A CN200810222436X A CN 200810222436XA CN 200810222436 A CN200810222436 A CN 200810222436A CN 101676933 B CN101676933 B CN 101676933B
Authority
CN
China
Prior art keywords
message
flow
subscription
state
subscribing
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.)
Expired - Fee Related
Application number
CN200810222436XA
Other languages
Chinese (zh)
Other versions
CN101676933A (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.)
China Digital Video Beijing Ltd
Original Assignee
China Digital Video Beijing 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 China Digital Video Beijing Ltd filed Critical China Digital Video Beijing Ltd
Priority to CN200810222436XA priority Critical patent/CN101676933B/en
Publication of CN101676933A publication Critical patent/CN101676933A/en
Application granted granted Critical
Publication of CN101676933B publication Critical patent/CN101676933B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a message subscription and distribution method, and particularly discloses a message subscription and distribution method based on change of state in process control. In the prior art, the method that an application system taking part in the flow acquires information showing the changing occurrence of the process state has the defects of low efficiency, redundant data and the like. In the method of the invention, firstly, a message subscriber subscribes the message generated in the process execution course; the message subscribed by the message subscriber is generated when the state of process instances or the state of process tasks changes; and then the generated message is put in a message queue, the message subscriber acquires self-subscribing message from the message queue regularly or occasionally. By adopting the method of the invention, the efficiency is increased and data redundancy is lowered.

Description

Message subscribing and distribution method in the flow process control that a kind of state-based changes
Technical field
The present invention relates to a kind of message subscribing distribution method, especially relate to message subscribing and distribution method in the flow process control that a kind of state-based changes.
Background technology
At present, common flow engine main manifestations is two kinds of forms: a kind of order that is based on, another kind is based on state.The flow process control of state-based, as its name suggests, its core is state.The state had here both comprised the state of flow instance, comprised again the state of flow tasks.The flow process that it is different from based on order is embodied in: do not limit the flow direction of flow process, the place one's entire reliance upon state variation of node of the processing sequence of node, and the configuration that state variation is done.The subsequent action of other nodes when these configurations will determine that node state changes.
The definitional part of the flow process control of state-based mainly comprises flow definition, flow nodes, flow instance and flow tasks.Flow definition is the description to a kind of mode of operation of flow engine, and its entity is an XML, described requirements of process and experienced which node, and which kind of adopts sequentially experience these nodes, and some other necessary configuration attribute of this flow process of finishing.Flow nodes is the subobject of flow definition, and each needs part to be processed in the description flow process.Flow instance is an objectification to flow definition, namely begins to a self-contained process of flow process end from flow process.Flow tasks is the subobject of flow instance, is an objectification of flow nodes.
Fig. 1 has shown the process flow operation synoptic diagram of state-based, and the node flow arrows of wherein describing no longer has effect of contraction, and what play a decisive role is the node state dependence that disposes in flow definition, and State-dependence concerns that allocation list is as shown in the table.
Figure G200810222436XD00011
Flow definition has defined the basic working modes of flow engine, if but allow real the getting into smooth of flow process, need outer application system to participate in the processing procedure of flow process, comprise initiation, carry out, interrupt and close etc.It is inadequate that yet the processing procedure that allows outer application system participate in flow process only relies on the setting to state, application system must know in time the current execution of flow process to the state of which node, this node how, when state changes and the information such as progress of flow process.Current, the information spinner that application system obtains the flow state variation will pass through polling mode or readjustment mode.Polling mode is that application system inquires constantly whether the state of flow process changes, and the efficient of this mode is lower.The readjustment mode is that flow engine initiatively calls the application system that participates in flow process, the situation of change of notice flow state, and the coupling of this mode flow engine and participant is larger, blocks or failure if call, and can the execution of flow process be exerted an influence.And the state of the flow process system that in a single day changes just can produce message, and some message are useless information, thereby has caused the redundancy of system data.
Summary of the invention
For the defective that exists in the prior art, the purpose of this invention is to provide message subscribing and distribution method in the flow process control that a kind of state-based changes, the method can improve the efficient that the application system that participates in flow process obtains the flow state change message, and reduces data redundancy.
To achieve these goals, the technical solution used in the present invention is that message subscribing and distribution method in the flow process control that a kind of state-based changes comprise the steps:
(1) message that produces in the flow performing process is subscribed to by message subscribing side;
(2) when the state of the state of flow instance or flow tasks changes, the message that the generating messages subscriber subscribes to;
(3) message that generates in the step (2) is put into a message queue, the regular or irregular message of oneself subscribing to of from this message queue, obtaining in message subscribing side.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, the mode of the middle subscribe message of step (1) are divided into static the subscription and dynamically subscription; Described static the subscription refers to define message subscribing side in flow definition, the message that meets this flow definition that produces in the implementation of the flow instance of at every turn using this flow definition all sends to this message subscribing side; Described dynamic subscription refers to arbitrarily subscribe message in any one flow instance of message subscribing side.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, wherein, described static the subscription comprises the subscription of flow instance and the subscription of flow tasks; The subscription of described flow instance refers to subscribe to the message that generates when free position in the flow process changes; The message that generates when the state that the subscription of described flow tasks refers to subscribe to the corresponding flow tasks of node in the flow process changes.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, wherein, described dynamic subscription realizes that by the mode of calling interface described interface comprises that all example message subscribing interface, instantiation message subscribing interface, subscribe message are cancelled interface and subscribe message is obtained interface.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, wherein, described dynamic subscription is divided into flow process initiator's subscription and the subscription of flow process participant.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, wherein, flow process initiator's subscription procedure is: after flow process was initiated successfully, the initiator obtained the ID of this time flow instance, all message of then utilizing the ID of this time flow instance to subscribe to this time flow instance.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, wherein, the subscription procedure of flow process participant is: the message subscribing side that at first defines certain node in flow definition, when flow performing arrives this node, the state variation message that produces is sent to the message subscribing side of this node, message subscribing side obtains the ID of this flow instance from the message of obtaining, and then utilizes the ID of this flow instance to subscribe to all message that generate in the flow performing process behind this node.
Message subscribing and distribution method in the flow process control that aforesaid state-based changes, message has the lifetime in message queue in the step (3), do not have removedly if surpass after the lifetime this message, then be regarded as " expired " and cancel, it is deleted from message queue.
Method of the present invention, the application system that participates in flow process is known the information that the state of flow process changes by the mode of subscribe message, compares with the mode of poll, has improved efficient.In the implementation of flow process, only produce subscribed message, thereby reduced the redundancy of data.In addition, adopt the mode of message queue during message distribution, can reduce to greatest extent system pressure, make the utilization of resources reach balanced.
Description of drawings
Fig. 1 is based on the process flow operation synoptic diagram of state;
Fig. 2 is method flow diagram of the present invention;
Fig. 3 is the process flow diagram of the dynamic subscribe message of initiator in the specific embodiment of the invention;
Fig. 4 is the process flow diagram of the dynamic subscribe message of participant in the specific embodiment of the invention.
Embodiment
Describe the present invention below in conjunction with embodiment and accompanying drawing.
Method of the present invention is mainly used in the flow process hierarchy of control of state-based variation, and namely the major impetus of Flow driving is the variation of node state.Participate in the outer application system of flow processing process or the application program in the application system (following common name message subscribing side) and must know in real time when the current execution of flow process changes and the information such as progress of flow process to state, the state of which node, this node.For this reason, the present invention has introduced the concept of message, and the message subscribing square tube is crossed the message of its subscription and understood above-mentioned status information.So, how to subscribe to and how to distribute be problem to be solved by this invention to message.
Fig. 2 has shown the flow process of message subscribing and distribution method in the flow process control that state-based of the present invention changes, and may further comprise the steps.
(1) message that produces in the flow performing process is subscribed to by message subscribing side.
The mode of subscribe message is divided into static the subscription and dynamically subscription.
Static realization of subscribing to is inseparable with flow definition, and in fact a flow definition is exactly the template of idiographic flow example, and the content of describing in flow definition will be applied in all flow instances that use this flow definition and go.Transfer process for example if defined the subscriber of message in the transfer process definition, is used the message that the transfer process of this definition produces so at every turn and all can be sent to this subscriber.
Therefore, so-called static the subscription refers to define message subscribing side in flow definition, and the message that produces in the implementation of the flow instance of at every turn using this flow definition all sends to this message subscribing side.
Static subscription can be subscribed to two parts content: the subscription of flow instance and the subscription of flow tasks.The subscription of so-called flow instance refers to subscribe to the message that generates when free position in the flow process changes.And the message that the subscription of flow tasks produces when referring to subscribe to the state of the corresponding flow tasks of node in the flow process and changing.
The subscription of flow instance being described below in flow definition:
The subscription of flow tasks is positioned in flow definition under the node Action, and it thes contents are as follows:
Figure G200810222436XD00052
Superincumbent XML describes the inside, and Receiver (recipient) can have a plurality of, can think a plurality of message subscribing sides of message arrangement, for each message subscribing side produces a message.Lifecycle represents the lifetime of message, because message is that " waits " message subscribing side obtains in message queue, does not have removedly if therefore surpass after the lifetime message, then is regarded as " expired " calcellation, and it is deleted from message queue.In addition, the Listener node also can be a plurality of, can think that message specifies many group recipients, and every group of message lifetime that produces is identical, but can be not different between on the same group.
Dynamically subscribe to and refer to that message subscribing can reach arbitrarily subscribe message in any one flow instance.Dynamically subscription is different from static subscription, and it is more flexible.The flow instance that message subscribing side only selects it to be concerned about is subscribed to, and unnecessary reception all use the message of all flow instances of same flow definition, this point is it and the static key distinction of subscribing to.Dynamically subscription also is divided into two types: a kind of is flow process initiator's subscription, and a kind of is the subscription of flow process participant.
Fig. 3 has shown the flow process of flow process initiator's subscribe message.For the initiator, after initiating successfully, flow process can obtain the id information of this time flow instance, and by the ID of flow instance, flow process initiator just can dynamically subscribe to all message of this example.
Fig. 4 has shown the flow process of flow process participant subscribe message.For the participant of flow process, they also do not know own to the flow instance that participates in.Therefore their dynamic subscription is from static state is subscribed to.For example, message subscribing side B is a participant of " transfer process ", and having defined B in flow definition is the message recipient of node 2.When flow process proceeds to node 2, can produce the message of the state variation of node 2 so, after B obtains this message, just can from this message, obtain the id information of flow instance.So message subscribing side B begins to participate in flow process in the centre position of " transfer process ", it just can dynamically subscribe to this flow instance all message after this constantly from this so.
The specific implementation of dynamically subscribing to is to realize by the interface that the call flow engine provides, and the interface relevant with dynamic subscription comprises: all example message subscribing interface, instantiation message subscribing interface, cancellation message subscribing interface and subscribe message are obtained interface.
Figure G200810222436XD00062
(2) when the state of flow instance or flow tasks changes, the message that the generating messages subscriber subscribes to.
The condition of generating messages mainly contains two: variation has occured in the state that 1. is flow instance or flow tasks, 2. is that this example or task are subscribed to by message subscribing side.1. condition has indicated the content of message, and 2. condition then defines the recipient of message, and two conditions are indispensable.
(3) give the subscriber of this message with the middle message distribution that generates of step (2).
Message is divided into two types usually: the message of designated recipient is called notice, and the message of designated recipient is not called bulletin (broadcasting).In the present embodiment, main what use is to notify this pattern, but not exclusively is traditional notice, flow engine not initiatively go the notification message subscriber, but realize a message queue by built-in database.Behind generating messages, this message is put into message queue, message subscribing side is regular or irregularly obtain one's own message from formation.
In addition, the dynamic subscription of message need to be specified the ID of the flow instance that will subscribe to, and still, during the dynamic message distribution of subscribing to, message subscribing side does not need to indicate the flow instance ID that will obtain.Message subscribing side is each all with disposable the fetching of message of all flow instances of its current subscription, and this has greatly improved the efficient that message transmits and has effectively reduced system loading.
Method of the present invention is not limited to above-mentioned embodiment, and those skilled in the art's technical scheme according to the present invention draws other embodiment, belongs to equally technological innovation scope of the present invention.

Claims (4)

1. message subscribing and distribution method during the flow process of a state-based variation is controlled may further comprise the steps:
(1) message that produces in the flow performing process is subscribed to by message subscribing side; The mode of subscribe message is divided into static the subscription and dynamically subscription; Described static the subscription refers to define message subscribing side in flow definition, the message that meets this flow definition that produces in the implementation of the flow instance of at every turn using this flow definition all sends to this message subscribing side; Described dynamic subscription refers to arbitrarily subscribe message in any one flow instance of message subscribing side, dynamically subscribes to be divided into flow process initiator's subscription and the subscription of flow process participant;
Flow process initiator's subscription procedure is: after flow process was initiated successfully, the initiator obtained the ID of this time flow instance, all message of then utilizing the ID of this time flow instance to subscribe to this time flow instance;
The subscription procedure of flow process participant is: the message subscribing side that at first defines certain node in flow definition, when flow performing arrives this node, the state variation message that produces is sent to the message subscribing side of this node, message subscribing side obtains the ID of this flow instance from the message of obtaining, and then utilizes the ID of this flow instance to subscribe to all message that generate in the flow performing process behind this node;
(2) when the state of the state of flow instance or flow tasks changes, the message that the generating messages subscriber subscribes to;
(3) message that generates in the step (2) is put into a message queue, the regular or irregular message of oneself subscribing to of from this message queue, obtaining in message subscribing side.
2. message subscribing and distribution method during the flow process of state-based variation as claimed in claim 1 is controlled is characterized in that: described static the subscription comprises the subscription of flow instance and the subscription of flow tasks; The subscription of described flow instance refers to subscribe to the message that generates when free position in the flow process changes; The message that generates when the state that the subscription of described flow tasks refers to subscribe to the corresponding flow tasks of node in the flow process changes.
3. message subscribing and distribution method during the flow process of state-based variation as claimed in claim 1 is controlled, it is characterized in that: described dynamic subscription realizes that by the mode of calling interface described interface comprises that all example message subscribing interface, instantiation message subscribing interface, subscribe message are cancelled interface and subscribe message is obtained interface.
4. message subscribing and distribution method during the flow process that changes such as the described state-based of one of claims 1 to 3 is controlled, it is characterized in that: message has the lifetime in message queue in the step (3), if this message does not have removed after surpassing the lifetime, then be regarded as " expired " and cancel, it is deleted from message queue.
CN200810222436XA 2008-09-17 2008-09-17 Message subscription and distribution method based on change of state in flow control Expired - Fee Related CN101676933B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810222436XA CN101676933B (en) 2008-09-17 2008-09-17 Message subscription and distribution method based on change of state in flow control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810222436XA CN101676933B (en) 2008-09-17 2008-09-17 Message subscription and distribution method based on change of state in flow control

Publications (2)

Publication Number Publication Date
CN101676933A CN101676933A (en) 2010-03-24
CN101676933B true CN101676933B (en) 2013-01-02

Family

ID=42029491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810222436XA Expired - Fee Related CN101676933B (en) 2008-09-17 2008-09-17 Message subscription and distribution method based on change of state in flow control

Country Status (1)

Country Link
CN (1) CN101676933B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281605B (en) * 2013-07-08 2017-12-26 北京齐尔布莱特科技有限公司 A kind of social network sites Feed flows method for pushing
CN107610748A (en) * 2016-07-08 2018-01-19 学透通医疗科技(上海)有限公司 A kind of haemodialysis data flow processing method
CN115454683A (en) * 2022-11-14 2022-12-09 电子科大科园股份有限公司 Message processing method, system, electronic device and computer readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100341347C (en) * 2004-04-30 2007-10-03 华为技术有限公司 Subscribing, cancelling and state updating method for attendance service
CN101051922A (en) * 2007-04-06 2007-10-10 中国科学院计算技术研究所 Subscribing, publishing and updating method for existing information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100341347C (en) * 2004-04-30 2007-10-03 华为技术有限公司 Subscribing, cancelling and state updating method for attendance service
CN101051922A (en) * 2007-04-06 2007-10-10 中国科学院计算技术研究所 Subscribing, publishing and updating method for existing information

Also Published As

Publication number Publication date
CN101676933A (en) 2010-03-24

Similar Documents

Publication Publication Date Title
CN102377686B (en) Message subscription system, method and device
US8606859B2 (en) Method and system to communicate messages in a computer network
CN100396055C (en) Multicasting source filtering treatment method
CN102035893A (en) Method and system for pushing data actively by server
WO2007081523A2 (en) Optimizing communication using scaleable peer groups
CN101668031A (en) Message processing method and message processing system
CN101252602B (en) System and method for downloading and distributing files
CN105959395A (en) Cluster self-feedback type load balancing scheduling system and method
CN107623731B (en) Task scheduling method, client, service cluster and system
CN101622587A (en) Be used to wake up the centralized service of computing equipment
CN101676933B (en) Message subscription and distribution method based on change of state in flow control
CN103312528A (en) Heartbeat message sending method and user terminal
CN106302817A (en) A kind of data/address bus implementation method based on Distributed Message Queue and device
CN102664947A (en) Notification distribution method for distributed system
CN101286866B (en) Multicast implementing method and system based on switching network of high-speed peripheral extended interface
CN103037000B (en) Publish-subscribe system and notification message processing method thereof
CN114172792B (en) Method and device for realizing sequence number generation method for ensuring high availability of service
WO2022170791A1 (en) State reporting method and apparatus, device, and computer-readable storage medium
CN102571595A (en) Route forwarding information synchronizing method and device of stack system
CN101677303B (en) Message subscription and distribution method in flow control based on change of state
CN101047691B (en) Method for integral controlling subscribe
CN103209213A (en) Data transmission method and system for data subscription
CN102413433A (en) Group management method by taking short messages as communication means and mobile terminal
CN100531217C (en) Exceptional processing method in mobile multicast broadcast service
CN101309286B (en) Forced node exit method and application layer multicast system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130102

Termination date: 20160917

CF01 Termination of patent right due to non-payment of annual fee