STATE SYNCHRONIZATION APPARATUSES AND METHODS
A method for state synchronization, performed by a first electronic apparatus, comprises the following steps. A first service state version identification (ID) is acquired from a local cache of the first electronic apparatus. Multiple second service state version IDs stored in local caches of second electronic apparatuses are acquired by querying the second electronic apparatuses. It is determined whether each second service state version ID is older than the first service state version ID. A forward update request is transmitted to at least one second electronic apparatus owning the older second service state version ID, enabling the second electronic apparatus owning the older second service state version ID to activate an upward check procedure to update the older second service state version ID.
Latest BENQ CORPORATION Patents:
The invention relates to state synchronization, and more particularly, to state synchronization apparatuses and methods for very large-scale distributed network environments.
Devices in distributed environments may share common states for service coordination and collaboration, particularly in event-driven service management systems. Typically, in service management systems, service state change notifications may be processed asynchronously: a service (or an administration console) sequentially notifies all devices of all changed common states. The values of the common state are stored (or cached) in the devices. The devices, however, maintain cached common states in different ways, and thus, may have inconsistent common state values, thereby causing failure of service coordination.
SUMMARYMethods for state synchronization, performed by a first electronic apparatus, are provided. An embodiment of a method for state synchronization, performed by a first electronic apparatus, comprises the following steps. A first service state version identification (ID) is acquired from a local cache of the first electronic apparatus. Multiple second service state version IDs stored in local caches of second electronic apparatuses are acquired by querying the second electronic apparatuses. It is determined whether each second service state version ID is older than the first service state version ID. A forward update request is transmitted to at least one second electronic apparatus owning the older second service state version ID, enabling the second electronic apparatus owning the older second service state version ID to activate an upward check procedure to update the older second service state version ID. The first and second service state version IDs are generated by a service resident on a third electronic apparatus. The first, second and third electronic apparatuses are organized in an event casting tree, the third electronic apparatus is a root node of the event casting tree, and the first and second electronic apparatuses are leaf nodes of the event casting tree.
An embodiment of a method for state synchronization, performed by a first electronic apparatus, comprises the following steps. An upward check request is received from a second electronic apparatus, the upward check request comprises a first service state version ID and a first service state value corresponding to the first service state version ID. A second service state version ID stored in a local cache of the first electronic apparatus is acquired. The upward check request is transmitted to a third electronic apparatus to activate an upward check procedure when the second service state version ID is older than the first service state version ID. The upward check procedure transmits the upward check request to an electronic device causing inconsistency between the first and second service state version IDs. It is determined whether the third electronic apparatus is available. If the third electronic apparatus is unavailable the second service state version ID and the second service state value stored in the local cache of the first electronic apparatus are replaced with the first service state version ID and the first service state value. A downward update request is transmitted to the second electronic apparatus to activate a downward update procedure downwardly notifying all nodes directly or indirectly connecting to the first electronic apparatus of information instructing a notified node to store the first service state value corresponding to the first service state version ID. The first, second and third electronic apparatuses are organized in an event casting tree, the first electronic apparatus is a parent node of the second electronic apparatus, and the third electronic apparatus is a parent node of the first electronic apparatus.
An embodiment of a method for state synchronization, performed by a first electronic apparatus comprising a local cache storing a first service state version ID and a first service state value corresponding to the first service state version ID, comprises the following steps. A forward update request comprising a second service state version ID and a second service state value corresponding to the second service state version ID is received from a second electronic apparatus, the second service state version ID being newer than the first service state version ID. A downward update request comprising a third service state version ID and a third service state value corresponding to the third service state version ID is received from a third electronic apparatus after receiving the forward update request. The first service state version ID and the first service state value in the local cache of the first electronic apparatus are respectively replaced with the third service state version ID and the third service state value. It is determined whether the third service state version ID is newer than the second service state version ID. A backward update request is transmitted to the second electronic apparatus in order to activate a master node transition procedure when the third service state version ID is newer than the second service state version ID. The master node transition procedure transfers tasks for transmitting forward update requests from the second electronic apparatus to the first electronic apparatus. The first, second and third electronic apparatuses are organized in an event casting tree, the first and second electronic apparatuses are leaf nodes of the event casting tree, and the third electronic apparatus is a parent node of the first electronic apparatus.
Systems for state synchronization are provided. An embodiment of a system for state synchronization comprises a first, a second, a third and a fourth electronic apparatuses. The first electronic apparatus comprises a service. The first, second, third and fourth electronic apparatuses are organized in an event casting tree. The first electronic apparatus represents a root node of the event casting tree, the second electronic apparatus represents a relay node of the event casting tree, and the third and fourth electronic apparatuses represent leaf nodes of the event casting tree. The third and fourth electronic apparatuses subscribe multiple event notifications to the service. The first electronic apparatus transmits the event notifications hierarchically and sequentially to the third and fourth electronic apparatuses via the second electronic apparatus. The fourth electronic apparatus acquires a first service state version ID from a local cache thereof, acquires a second service state version ID stored in a local cache of the third electronic apparatuses by querying the third electronic apparatus, determines whether the second service state version ID is older than the first service state version ID, and transmits a forward update request to the third electronic apparatus when the second service state version ID is older than the first service state version ID, enabling the third electronic apparatus to activate an upward check procedure to update the older second service state version ID.
The invention will become more fully understood by referring to the following detailed description with reference to the accompanying drawings, wherein:
A distributed event dissemination mechanism is employed for efficiently transmitting event notifications to personal computers and electronic devices when the subscribing personal computers and electronic devices are part of a very large-scale distributed network environment.
An event notification may be organized by the following format:
An event notification includes several data fields such as a service identifier (sid), a service location reference (slr), a relay node identifier (rid), a service state value (sValue), a version identifier (dValue), a time at which the event notification is generated (tValue) and a valid duration (dValue). The version identifier (ID) differentiates an individual event (i.e. service state value) from multiple events. The version ID may be represented in a form of a service ID hyphenated by an event ID, organized in the following format:
version ID:=“service ID”−“event ID”.
The relay node identifier initiated as “null” is encapsulated in the first event notification sent by the root node to its child relay nodes. When receiving an event notification, a relay node appends its identifier to the relay node identifier of the received event notification and transmits the revised event notification to its child relay nodes or leaf nodes. In addition, the relay node records a tuple of parent node identifier and sid, vValue and sValue of the received event notification in a local database, denoted as <sid, parent's rid, vValue, sValue>. When receiving an event notification, a leaf node records a tuple of sid, slr, parent node rid (or the root node), vValue and sValue of the received event notification, denoted as <sid, slr, parent's rid, vValue, sValue>.
Two leaf nodes may have different versions of service state values corresponding to an identical service in course of service coordination. Inconsistent states among leaf nodes can be induced by many causes. For example, a broken relay node may temporarily interrupt event notification transfer or a data transmission jam may occur between two nodes, such as two relay nodes, a root node and a relay node, or a relay node and a leaf node.
Let a collaborative group comprise m leaf nodes L1, L2 to Lm. All leaf nodes in the collaborative group store service state values corresponding to the same service in their local caches. All leaf nodes in the same collaborative group ideally have the same service state version ID of the cached service state values, i.e., vi=vj for any two leaf nodes Li and Lj in the same collaborative group. Prior to service coordination, leaf nodes L1, L2 to Lm compare their versions of the specific service state. To facilitate synchronizing states among leaf nodes, one node in the collaborative group serves as a master node. The master node collects service state version IDs from the other leaf nodes and then forwards newer service state values to those nodes with older states. Detailed descriptions for determining the master node are provided in the following.
Detailed descriptions of state synchronization methods as shown in
Also disclosed is a storage medium as shown in
Systems and methods, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMS, hard drives, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer system and the like, the machine becomes an apparatus for practicing the invention. The disclosed methods and apparatuses may also be embodied in the form of program code transmitted over some transmission medium, such as electrical wiring or cabling, through fiber optics, or via any other form of transmission, wherein, when the program code is received and loaded into and executed by a machine, such as a computer or an optical storage device, the machine becomes an apparatus for practicing the invention. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique apparatus that operates analogously to specific logic circuits.
Certain terms are used throughout the description and claims to refer to particular system components. As one skilled in the art will appreciate, consumer electronic equipment manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function.
Although the invention has been described in terms of preferred embodiment, it is not limited thereto. Those skilled in this technology can make various alterations and modifications without departing from the scope and spirit of the invention. Therefore, the scope of the invention shall be defined and protected by the following claims and their equivalents.
Claims
1. A method for state synchronization, performed by a first electronic apparatus, comprising:
- acquiring a first service state version identification (ID) from a local cache of the first electronic apparatus;
- acquiring a plurality of second service state version ID stored in a plurality of local caches of a plurality of second electronic apparatuses by querying the second electronic apparatuses;
- determining whether each second service state version ID is older than the first service state version ID; and
- transmitting a forward update request to at least one second electronic apparatus owning the older second service state version ID,
- enabling the second electronic apparatus owning the older second service state version ID to activate an upward check procedure to update the older second service state version ID,
- wherein the first and second service state version IDs are generated by a service resident on a third electronic apparatus, the first, second and third electronic apparatuses are organized in an event casting tree, the third electronic apparatus is a root node of the event casting tree, and the first and second electronic apparatuses are leaf nodes of the event casting tree.
2. The method as claimed in claim 1 further comprising:
- receiving a backward update request comprising a third service state version ID newer than the first service state version ID from the second electronic apparatus owning the older second service state version ID after transmitting the forward update request to the second electronic apparatus owning the older second service state version ID;
- transmitting a transfer request to the second electronic apparatus generating the backward update request, the transfer request comprising information indicating that the takes for transmitting forward update requests are to be transferred to the second electronic apparatus generating the backward update request; and
- transmitting a plurality of transfer announcements to the second electronic apparatuses after receiving an acknowledgement corresponding to the transfer request from the second electronic apparatus generating the backward update request, each transfer announcement comprising information indicating that the takes for transmitting forward update requests have transited to the second electronic apparatus generating the backward update request.
3. The method as claimed in claim 2 further comprising:
- transmitting an ordered list to the second electronic apparatus generating the backward update request after receiving an acknowledgement corresponding to the transfer request from the second electronic apparatus generating the backward update request,
- wherein the ordered list comprises a plurality of leaf node identifiers (IDs) in sequence respectively corresponding to the first and second electronic apparatuses, any two adjacent leaf node IDs satisfy a first or a second rule, the first rule indicates that the former leaf node ID for a leaf node owning a service state version ID is newer than a service state version ID owned by a leaf node corresponding to the later leaf node ID, and the second rule indicates that, when two adjacent leaf node IDs correspond to leaf nodes owning the same service state version ID, a leaf node corresponding to the former leaf node ID locates on the left or right side of a leaf node corresponding to the later leaf node ID.
4. A method for state synchronization, performed by a first electronic apparatus, comprising:
- receiving an upward check request from a second electronic apparatus, the upward check request comprising a first service state version identification (ID) and a first service state value corresponding to the first service state version ID;
- acquiring a second service state version ID stored in a local cache of the first electronic apparatus; and
- transmitting the upward check request to a third electronic apparatus to activate an upward check procedure when the second service state version ID is older than the first service state version ID, the upward check procedure transmitting the upward check request to an electronic device causing inconsistency between the first and second service state version IDs;
- determining whether the third electronic apparatus is unavailable;
- replacing the second service state version ID and the second service state value stored in the local cache of the first electronic apparatus with the first service state version ID and the first service state value when the third electronic apparatus is unavailable; and
- transmitting a downward update request to the second electronic apparatus to activate a downward update procedure, the downward update procedure downwardly notifying all nodes directly or indirectly connecting to the first electronic apparatus of information instructing the notified nodes to store the first service state value corresponding to the first service state version ID,
- wherein the first, second and third electronic apparatuses are organized in an event casting tree, the first electronic apparatus is a parent node of the second electronic apparatus, and the third electronic apparatus is a parent node of the first electronic apparatus.
5. The method as claimed in claim 4 wherein the step for determining whether the third electronic apparatus is unavailable further comprises:
- determining that the third electronic apparatus is unavailable when receiving no upward check acknowledgement as the upward check request expires,
- wherein the upward check acknowledgement indicates that the third electronic apparatus has received the upward check request.
6. The method as claimed in claim 4 wherein the first and second service state version IDs, and the first and second service state values are generated by a fourth electronic apparatus, and the fourth electronic apparatus locates on the root node of the event casting tree.
7. A method for state synchronization, performed by a first electronic apparatus comprising a local cache storing a first service state version identification (ID) and a first service state value corresponding to the first service state version ID, comprising:
- receiving a forward update request comprising a second service state version ID and a second service state value corresponding to the second service state version ID from a second electronic apparatus, the second service state version ID being newer than the first service state version ID;
- receiving a downward update request comprising a third service state version ID and a third service state value corresponding to the third service state version ID from a third electronic apparatus after receiving the forward update request;
- respectively replacing the first service state version ID and the first service state value in the local cache of the first electronic apparatus with the third service state version ID and the third service state value;
- determining whether the third service state version ID is newer than the second service state version ID;
- transmitting a backward update request to the second electronic apparatus in order to activate a master node transition procedure when the third service state version ID is newer than the second service state version ID,
- wherein the master node transition procedure transfers tasks for transmitting forward update requests from the second electronic apparatus to the first electronic apparatus, the first, second and third electronic apparatuses are organized in an event casting tree, the first and second electronic apparatuses are leaf nodes of the event casting tree, and the third electronic apparatus is a parent node of the first electronic apparatus.
8. The method as claimed in claim 7 wherein the first, second and third service state version IDs, and the first, second and third service state values are generated by a service resident on a fourth electronic apparatus, and the fourth electronic apparatus is the root node of the event casting tree.
9. The method as claimed in claim 7, after receiving the forward update request and before receiving the downward update request, further comprising:
- transmitting a upward check request to the third electronic apparatus in order to activate a upward check procedure transmitting the upward check request to an electronic device causing inconsistency between the service state version IDs.
10. A system for state synchronization, comprising:
- a first electronic apparatus comprising a service;
- a second electronic apparatus;
- a third electronic apparatus; and
- a fourth electronic apparatus,
- wherein the first, second, third and fourth electronic apparatuses are organized in an event casting tree, the first electronic apparatus represents a root node of the event casting tree, the second electronic apparatus represents a relay node of the event casting tree, the third and fourth electronic apparatuses represent leaf nodes of the event casting tree, the third and fourth electronic apparatuses subscribe to a plurality of event notifications from the service, the first electronic apparatus hierarchically transmits the event notifications in sequence to the third and fourth electronic apparatuses via the second electronic apparatus, and the fourth electronic apparatus acquires a first service state version identification (ID) from a local cache of the fourth electronic apparatus, acquires a second service state version ID stored in a local cache of the third electronic apparatuses by querying the third electronic apparatus, determines whether the second service state version ID is older than the first service state version ID, and transmits a forward update request to the third electronic apparatus when the second service state version ID is older than the first service state version ID, enabling the third electronic apparatus to activate an upward check procedure to update the older second service state version ID.
11. The system as claimed in claim 10 wherein the fourth electronic apparatus receives a backward update request comprising a third service state version ID newer than the first service state version ID from the third electronic apparatus after transmitting the forward update request to the third electronic apparatus, transmits a transfer request comprising information indicating that takes for transmitting forward update requests are to be transferred to the third electronic apparatus to the third electronic apparatus, and transmits a transfer announcement comprising information indicating that the takes for transmitting forward update requests have transited to the third electronic apparatus to a fifth electronic apparatus after receiving an acknowledgement corresponding to the transfer request from the third electronic apparatus, the fifth electronic apparatus is a leaf node of the event casting tree, the fifth electronic apparatus subscribe to a plurality of event notifications from the service, and the first electronic apparatus hierarchically transmits the event notifications in sequence to the fifth electronic apparatus via the second electronic apparatus.
12. The system as claimed in claim 11 wherein the fourth electronic apparatus transmits an ordered list to the third electronic apparatus after receiving an acknowledgement corresponding to the transfer request from the third electronic apparatus, the ordered list comprises a plurality of leaf node identifiers (IDs) in sequence respectively corresponding to the first and second electronic apparatuses, any two adjacent leaf nod IDs satisfy a first or a second rule, the first rule indicates that the former leaf node ID for a leaf node owning a service state version ID is newer than a service state version ID owned by a leaf node corresponding to the later leaf node ID, and the second rule indicates that, when two adjacent leaf node IDs correspond to leaf nodes owning the same service state version ID, a leaf node corresponding to the former leaf node ID locates on the left or right side of a leaf node corresponding to the later leaf node ID.
13. The system as claimed in claim 10 wherein the second electronic apparatus receives an upward check request comprising the first service state version ID and the first service state value corresponding to the first service state version ID from the third electronic apparatus, acquires a third service state version ID stored in a local cache of the second electronic apparatus, and transmits the upward check request to a fifth electronic apparatus to activate an upward check procedure when the third service state version ID is older than the first service state version ID, the upward check procedure transmits the upward check request to an electronic device causing inconsistency between the service state version IDs, the fifth electronic apparatus is a relay node of the event casting tree and a parent node of the second electronic apparatus, the second electronic apparatus determines whether the fifth electronic apparatus is unavailable, updates the third service state version ID and the third service state value stored in the local cache of the second electronic apparatus with the first service state version ID and the first service state value when the fifth electronic apparatus is unavailable, and transmits a downward update request to the third electronic apparatus to activate a downward update procedure, the downward update procedure downwardly notifies the third electronic apparatus of information instructing the third electronic apparatus to store the first service state value corresponding to the first service state version ID.
14. The system as claimed in claim 13 wherein the second electronic apparatus determines that the fifth electronic apparatus is unavailable when receiving no upward check acknowledgement as the upward check request expires, and the upward check acknowledgement indicates that the fifth electronic apparatus has received the upward check request.
15. The system as claimed in claim 10 wherein the third electronic apparatus receives the forward update request comprising the first service state version ID and a first service state value corresponding to the first service state version ID from the fourth electronic apparatus, the first service state version ID is newer than the second service state version ID, the third electronic apparatus receives a downward update request comprising a third service state version ID and a third service state value corresponding to the third service state version ID from the second electronic apparatus after receiving the forward update request, respectively replaces the second service state version ID and the second service state value in the local cache of the third electronic apparatus with the third service state version ID and the third service state value, determines whether the third service state version ID is newer than the first service state version ID, and transmits a backward update request to the fourth electronic apparatus in order to activate a master node transition procedure when the third service state version ID is newer than the first service state version ID, and the master node transition procedure transfers tasks for transmitting forward update requests from the fourth electronic apparatus to the third electronic apparatus.
16. The system as claimed in claim 15 wherein the third electronic apparatus transmits a upward check request to the second electronic apparatus in order to activate a upward check procedure transmitting the upward check request to an electronic device causing inconsistency between the service state version IDs after receiving the forward update request and before receiving the downward update request.
Type: Application
Filed: Jun 22, 2007
Publication Date: Dec 27, 2007
Applicant: BENQ CORPORATION (TAOYUAN)
Inventor: Chih-Lin Hu (Tainan City)
Application Number: 11/767,395
International Classification: G06F 15/173 (20060101);