The present invention relates to computer systems. The invention more particularly relates to a method, computing device, data processing system and computer program code for ensuring correct processing of data according to various system states.
In complex computer systems, such as in trading systems, it is known that different data processing modules providing different functionalities process data and deliver such processed data to each other. Such modules may then process data and deliver to another module, as well as receive further data processed by other modules
In such systems it is also known to provide various states, because of changes either in the way the system is to be operated or because of a change in configuration of one or more of the modules. In a trading system one state can signal the closing of trading and another state may be a state signalling a change in configuration. As a new state is introduced it is important that the new state is applied to new data and not on old data that has its origin in a state preceding the new state. If this is not considered the operability of the system may be disturbed. The state updating should at the same time be fast and no data lost.
This is not so simple to implement in a data processing system, especially if the system is complex and has a number of interconnected modules that provide processed data to each other.
A first aspect of the present invention concerns a method for ensuring correct processing of data according to various system states in a first data processing module being able to communicate with a number of other data processing modules in a data processing system using a number of input and output channels, comprising the steps of:
receiving a state message indicating a change from an old state to a new state on at least one input channel,
blocking reception of data on all input channels having the new state, sending at least one loop check message into each loop in a set of data processing loops, wherein the set includes all loops that the first data processing module is connected in via associated input and output channels and for which associated input channels the old state applies, and
removing the blocking when for each loop in the set either the loop check message is received in the first data processing module or the associated input channel has received a state message indicating the new state and all other input channels of the first data processing module have received a state message indicating the new state.
A second aspect of the present invention concerns a computing device for ensuring correct processing of data according to various system states and including a first data processing module for provision in a data processing system, the first data processing module comprising:
access to a number of input channels,
access to a number of output channels, and
a state control unit arranged to
A third aspect of the present invention is directed towards a data processing system including a computing device according to the second aspect.
A fourth aspect of the present invention concerns a computer program product for ensuring correct processing of data according to various system states through providing a state control unit of a first data processing module in a data processing system, comprising computer program code on a data carrier arranged to, when the data carrier is being loaded into a computer,
block reception of data on all input channels on which a state message indicating a change from an old state to a new state has been received,
send at least one loop check message into each loop in a set of data processing loops, wherein the set includes all loops that the first data processing module is connected in via associated input and output channels and for which associated input channels the old state applies, and
remove the blocking when for each loop in the set either the loop check message is received in the first data processing module or the associated input channel has received a state message indicating the new state and all other input channels of the first data processing module have received a state message indicating the new state.
The expression data processing path is intended to cover a path including a number of nodes where data is being processed in a node and sent to a following node in the path for being processed. Such a node is furthermore provided in the form of a data processing module.
The expression data processing loop is intended to cover a path of the above mentioned type, which forms a loop.
One advantage of the present invention is that state changes propagate in a deterministic and controlled way through data processing modules. According to the invention it is ensured that no data is lost or handled in a wrong state. State updating is furthermore fast. The invention also allows the system to be designed for non-linear data processing without risking race conditions to occur during operation.
It should be emphasized that the term “comprises/comprising” when used in this specification is taken to specify the presence of stated features, steps or components, but does not preclude the presence or addition of one or more other features, steps, components or groups thereof.
The present invention will now be described in more detail in relation to the enclosed drawings, in which:
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular architectures, interfaces, techniques, etc. in order to provide a thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well known devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In the system 10 there are a number of data processing modules 12, 14 and 16. Each of the modules is of a different type that provides a number of processing activities for a number of participants related to the system. Participants in a trading system can be such entities such as trading agents, stock exchanges, companies for which trading instruments are provided, authorities, information vendors etc. In
It should be realised that these modules are mere examples of modules that can be provided according to the present invention and that there can be many more modules. When performing activities for the various actors, these modules process data and also forward such processed data for further processing.
The first module 12 has access to a number of input channels 26, 28 and 30. Here a first and a second input channel 26, 28 are connected to a message router 18. These channels are provided for receiving data from outside of the system 10, which data may be various trading instructions and other financial business instructions. Data originating outside of the system thus passes in this variation of the invention through the message router 18. There is furthermore a third channel 30 on which the first module 12 receives processed data from the third module 16. The first module 12 also has access to a number of output channels 32 and 34, where a first leads to the second processing module 14 and a second 34 may lead to another module or another entity where no processing is made or where no state dependent processing is made. It should here be realised that also the second and third modules 14 and 16 may in a similar way be provided with input and output channels. However, most of these have here been omitted in order to better explain the present invention. In
The first module 12 furthermore includes a data processing unit 20 connected to the input channels 26, 28 and 30 and arranged to process data for output on for instance the first and second output channels 32 and 34. The first module 12 furthermore includes a state control unit 22 being connected to the data processing unit 20. This state control unit 22 is also connected to a system configuration data store 24, which includes system configuration data for all of the system and thus system configuration data for the various modules. It should here be realised that also the second and third modules 14 and 16 normally would include such a state control unit that can receive data from the system configuration data store 24. There is also a loop determining unit 23 provided in the first data processing module 12, which unit 23 is also connected to the system configuration data store 24.
A module is provided in a computing device, like a computer, a server or some other computing device. Depending on the size of the system there can be one or more modules in the same computer as well as provided in different computers.
In
A system 10, like a trading system can have various states, where one state may be a state indicating that trading is ongoing and another may be a state indicating that trading is closing. Yet another state may indicate that reference data used by the different modules has been updated where such reference data may be definition of instruments traded, definitions of specific instruments, various limits for instruments etc. All these states have different implications for the processing of data. This means that processing of data in one state normally differs from processing of data in another state. As is indicated by the loop L in
There are a number of various types of data processing loops that can be provided in a system such as a trading system, where the data processing modules act as nodes in such loops.
One type of loop is a strong loop in the data flow (SLDF). In such a loop data leaves a first node on an output channel, passes through several nodes, where it may be processed and re-enters the first node, where it may be processed again and finally leaves the node on the same output channel.
A weak loop in the data flow (WLDF) is a loop where data leaves a first node on an output channel, passes through several nodes, where it may be processed and re-enters the first node. However, here the data does not have to leave the first node on the same output channel.
It will in the following be assumed that SLDF does not exist in the system of
The general functioning of the system 10 according to the principles of the present invention will now be described also with reference being made to
It is first assumed that the whole system is processing data according to an old state S0. Then processing is performed in the various modules 12, 14, 16 according to well known principles. However, at a certain point in time a new state, state S1, is introduced by the message router 18. This state is signaled through the use of a new state message S1 that is being sent to all data processing modules that receive data from outside of the system 10. As can be seen in the example in
If a module that has started its checking receives a state message indicating the new state on an input channel, it should not start a new checking procedure, even though it may not be ready to change state. It just has to wait until enough checking messages have been received from the loops in order to ensure that no more old data can reach it. This same procedure is then also carried out by the other modules in the system.
A module that has the new state and receives a loop check message on an input channel from another node, which message originates in another node, should delete this message.
According to a second variation of the present invention, which is applied when WLDFs are possible, the state control unit waits with sending loop check messages until a state message indicating the new state is present on all input channels coming from modules with which the first module does not share any loop. After this it empties itself of old data and sends the loop check messages. In the example of
As an alternative to the loop message including data of the nodes in the loop that are to be passed, it is possible that all nodes, i.e. data processing modules in a node, has knowledge of the loops the other nodes in this loop are a part of. Then the loop check message discussed above will not need to include any information of the nodes it has to pass. Instead a receiving node determines the next node in the loop based on this pre-stored information. This determination may furthermore only be made once, when the system is being set up and the results of it used later when state changes actually occur.
How the determination of which other data processing modules that are present as nodes in a loop can be determined will now be described in relation to
The loop determination may with advantage be provided when the system is being set up. Actual loop determination may start with the loop determining unit 23 reading system configuration data of the first module 12, step 48. Such system configuration data is with advantage provided in a system configuration store 24. Normally all modules would have access to this store 24 and it would then include system configuration data of all modules. The system configuration data here includes data about all the input channels to the first module and all the output channels from the first module and to which other entities, such as to which other data processing modules they are connected. From this data loop determining unit 23 first determines what connections exist to other data processing modules, step 50. Such data may be provided in a so-called adjacency matrix A including a number of elements indicating the connections between nodes. Both columns and rows of such a matrix would then indicate the nodes in the system and if there is a connection between two nodes. An element a(i,j)=0 if such a connection does not exist and a(i,j)=1 if it does. In order to find out the loops the loop determining unit 23 then finds out all the other modules the first module is connected to through investigating the connection matrix A, step 50. These connections then make up a number of paths that may be loops, but may also be other types of paths like paths with an end. For each such path that is created, step 52, the loop determining unit 23 then reads system configuration data of the following module in the path, step 54. If then this path has no more data processing modules, the path is ended, step 56, and the path determined as being no loop, step 58. If however there is a connection in the path to a following module after the next module, i.e. the path is not ended, step 56, the loop determining unit 23 then investigates this following module. If this following module is the first module, step 60, then the loop determining unit 23 determines that the path is in fact a loop, step 64, and stores loop data, step 66, where loop data typically includes data about the data processing modules and their channels that are involved in such a loop and in which module the loop originates. This data may with advantage be stored in the system configuration data store 24. It may also be stored locally in the first data processing module. In case the following module was not the first module, step 60, the next module is made into the following module, step 62, whereupon system configuration data of this module is checked, step 54. This is repeated until the path is either determined to be a loop or no loop. A state control unit that sends loop check messages would therefore locate the applicable loop data identifying the loops of the corresponding data processing module via the system configuration data store 24 in order to learn about which loops this module is connected in.
It should here be realised that it is furthermore possible that there may be branches, i.e. that one node may connect to two or more other nodes. A path may thus include a part that is branched from another path at a branching point
An example illustrating the need for several loop check messages per loop will now be described with reference being made to
In
In the general case if WLDF cannot be excluded the number of checks being made is as described earlier N times, where N=min (L, M+1) as described earlier. This is because the first time the loops are checked, old data can come from either of the loops and can leave the first node, the initiating node, through the same output channel it used the last time it passed the node. The second time around it can not leave the first node through the same output channel. Thus after M passes the old data can only leave the first node through one output channel and a further check is needed to ensure that it will not come back into the first node again. If the number of input channels L is less than M+1, then it will be enough to do the checking L times through a similar reasoning, because if old data arrives through one input channel when the first check is made, it cannot enter through the same channel the other times.
The reason that so many checks are necessary is that there is no way in knowing which paths through the network individual messages will take. However, in a specific case it may be possible to decrease the number of times a set of checks are set to be performed through identifying a “bottleneck”, a minimal critical set comprising one or a few links. In this case it is necessary to check the critical set one more time than there are links K in the set. However with a network having few connections, the first approach is generally preferred.
Now an example of how loops can be identified will be described with reference being made to
The nodes interconnected in
The adjacency matrix A for the nodes in
Here the first row indicates the other nodes that the first node sends data to, the second row indicates the other nodes that the second node sends data to, the third row indicates the other nodes that the third node sends data to, the fourth row indicates the other nodes the fourth node sends data to and the fifth row indicates the other nodes that the fifth node sends data to. The first column indicates from which other nodes the first node receives data, the second column indicates from which other nodes the second node receives data, the second column indicates from which other nodes the second node receives data, the third column indicates from which other nodes the third node receives data, the fourth column indicates from which other nodes the fourth node receives data and the fifth column indicates from which other nodes the fifth node receives data. This means that for the nodes in
The loop finding method is here first applied for finding all nodes starting from the first node 68. From the nodes of
The same loop finding method is then applied on all loops starting from the fourth node 74, through which the tree in
It is furthermore noted that in the larger loop, the fourth loop, there are links constituting a sub-loop identical with the third loop made of the fourth node 74, the first node 68, the third node 72 and the fourth node 74 and hence the smaller third loop does not have to be checked separately, since it is checked when the larger fourth loop made up the fourth node 74, the first node 68, the third node 72, the second node 70, the first node 68, the third node 72 and the fourth node 74 is checked.
The same loop checking principle is then applied on all the other nodes in the same way, but will not be described in more detail here.
What then happens when a new state is introduced will be described in relation to
Thereafter no more messages are sent and the network has been updated.
As an alternative it is necessary for a node to wait for all input channels that are not a part of a loop to receive the new state. This is the case if there are no WLDF. It can then immediately proceed and empty itself of old data and send a loop check message. In this case there is furthermore only one loop check message sent into each loop.
The present invention has a number of advantages. According to the present invention state changes propagate in a deterministic and controlled way through data processing modules. According to the invention it is ensured that no data is lost or handled in a wrong state. State updating is furthermore fast. The invention furthermore allows the system to be designed for non-linear data processing without taking the risk of getting race conditions during operation.
The data handling modules of the present invention including the data processing units state control units and loop determining units are, as has been described above, implemented using computer technology. They may therefore be implemented through one or more processors together with computer program code for performing their functions.
While the invention has been described in connection with what is presently considered to be most practical and preferred embodiments, it is to be understood that the invention is not to be limited to the disclosed embodiments, but on the contrary, is intended to cover various modifications and equivalent arrangements. The message router is for instance not limited to being provided in an input channel, but other ways of signalling state changes may be provided. Loop checking and loop determining units may furthermore be provided in the same unit. As mentioned before there may as an alternative be one loop determining unit provided for the whole system, which is responsible for the loop determination of the whole system. Therefore the present invention is only to be limited by the following claims.