The present invention relates to an information processing apparatus comprising plural devices for executing processing mutually independently and an information processing method, and particularly to an information processing apparatus capable of synchronizing and operating plural devices and an information processing method.
It becomes necessary to exchange data between CPUs in the case of performing processing mutually related to plural CPUs.
JP-A-8-221290 is seen as a related art.
A method using RAM (random access memory) is generally contemplated as a method for exchanging data between plural CPUs.
However, in such a method, it is necessary to prepare the RAM as hardware. Also, hardware resources such as an address bus or a data bus are required as an interface and the interface becomes complicated, so that failure factors also increase. Particularly, in the case of wanting to insulate the portion between the CPUs, an insulating element is required in the interface, and complication and cost increase are inevitable.
However, the information about each of the CPUs is information generated by asynchronous processing in each of the CPUs, so that a time lag occurs in the collated information and a mismatch between the pieces of information caused by its time lag tends to occur. Also, it is necessary to implement an arbitration function of being accessed from the two CPUs by external hardware. Also, it is necessary to adjust timing of reading from the shared RAM 203 and writing into the shared RAM 203 in order to synchronize processing between the CPUs, so that processing overhead increases and processing performance decreases.
An object of the invention is to provide an information processing apparatus capable of synchronizing processing in plural devices without reducing a throughput, and an information processing method.
The invention provides an information processing apparatus comprising: a first device and a second device of which each execute a processing independently; a communicating part which executes a communication between the first device and the second device; a first process executing part which executes a processing in the first device by use of the communication as a trigger; and a second process executing part which executes a processing in the second device by use of the communication as a trigger.
According to this information processing apparatus, a first process executing part and a second process executing part execute processing in the first device and the second device using communication as a trigger, so that the processing in the first device and the second device is synchronized.
In the information processing apparatus, the communicating part may comprise: a trigger signal sending part which sends a trigger signal from the first device to the second device; and a response signal replying part which replies a response signal from the second device to the first device when the second device receives the trigger signal.
In this case, the first device may synchronize processing in the first device and the second device using a reception state etc. of the response signal.
In the information processing apparatus, the second process executing part may execute the processing in the second device by use of the reception of the trigger signal in the second device as a trigger.
In the information processing apparatus, an information for identifying a processing phase may be included in the trigger signal, and the second process executing part may execute a processing of a processing phase identified by the trigger signal after the second device receives the trigger signal.
In the information processing apparatus, the communicating part may execute an asynchronous communication.
The invention also provides an information processing apparatus comprising: a first device and a second device which send and receive a data each other and of which each executes a processing independently; a synchronizing part which synchronizes a processing in the first device and a processing in the second device by executing a communication between the first device and the second device; and a data communicating part which executes sending and receiving of the data by executing a communication between the first device and the second device after the processings are synchronized by the synchronizing part.
According to this information processing apparatus, it is unnecessary to execute processing for synchronization during sending and receiving of the data since communication is executed between the first device and the second device after processing is synchronized by the synchronizing part.
In the information processing apparatus, the synchronizing part and the data communicating part may execute a communication by use of the same communication path.
The information processing apparatus may comprise a determining part which determines whether or not the synchronization by the synchronizing part succeeds, and the data communicating part may execute sending and receiving of the data when the determining part determines that the synchronization succeeds.
In this case, sending and receiving of the data may be stopped when synchronization fails, and in that case, it can specialize in an operation of synchronization and return to a synchronized state can be made easily.
In the information processing apparatus, the synchronizing part and the data communicating part may execute an asynchronous communication.
The invention also provides an information processing apparatus comprising a first device and a second device of which executes a processing independently, and the first device comprises: a first notifying part which notifies the second device of the present processing stage of the first device; and a first monitoring part which monitors a processing timing of the second device based on a reception of the notification from the second device, and the second device comprises: a second notifying part which notifies the first device of the present processing stage of the second device; and a second monitoring part which monitors a processing timing of the first device based on the reception of the notification from the first device.
According to this information processing apparatus, the first device and the second device can respectively monitor mutual processing timing by the notifying parts and the monitoring part and both the devices can be synchronized.
In the information processing apparatus, the first monitoring part and the second monitoring part may determine whether or not a processing timing of each of the devices is normal based on a timing at which a notification indicating a predetermined processing stage is received.
In the information processing apparatus, the first device and the second device may be separate CPUs.
The invention also provides an information processing method which uses a first device and a second device of which each executes a processing independently, comprising: a step of executing a communication between the first device and the second device; a step of executing a processing in the first device by use of the communication as a trigger; and a step of executing a processing in the second device by use of the communication as a trigger.
According to this information processing method, processing in the first device and the second device is executed using communication as a trigger, so that the processing in the first device and the second device is synchronized.
In the information processing method, the step of executing the communication may comprise: a step of sending a trigger signal from the first device to the second device; and a step of replying a response signal from the second device to the first device when the second device receives the trigger signal.
In the information processing method, in the step of executing the processing in the second device, the processing in the second device may be executed by use of the reception of the trigger signal in the second device as a trigger.
In the information processing method, an information for identifying a processing phase may be included in the trigger signal, and a processing of a processing phase identified by the trigger signal may be executed after the second device receives the trigger signal in the step of the executing processing in the second device.
In the information processing method, the step of executing the communication may execute an asynchronous communication.
The invention also provides an information processing method which uses a first device and a second device which send and receive a data each other and of which each executes a processing independently, comprising: a step of synchronizing a processing in the first device and a processing in the second device by executing a communication between the first device and the second device; and a step of executing sending and receiving of the data by executing a communication between the first device and the second device after the processing is synchronized.
According to this information processing apparatus, it is unnecessary to execute processing for synchronization during sending and receiving of the data since communication is executed between the first device and the second device after processing is synchronized by the synchronizing step.
In the information processing method, in the step of synchronizing and the step of executing sending and receiving of the data, a communication may be executed by use of the same communication path.
The information processing method may comprise a step of determining whether or not the synchronization succeeds, and, in the step of executing sending and receiving of the data, the sending and receiving of the data may be executed when the determining step determines that the synchronization succeeds.
In this case, sending and receiving of the data may be stopped when synchronization fails, and in that case, it can specialize in an operation of synchronization and return to a synchronized state can be made easily.
In the information processing method, the step of synchronizing and the step of executing sending and receiving of the data may executes asynchronous communication.
[
[
[
[
[
[
[
[
[
[
[
[
a), 1(b) and 2 are block diagrams functionally showing an information processing apparatus according to the invention.
In
In
In
A determining part 107 determines whether or not synchronization by the synchronization part 105 succeeds. The data communicating part 106 executes sending and receiving of data when the determining part 107 determines that the synchronization succeeds.
In
An embodiment of the information processing apparatus according to the invention will be described below with reference to
As shown in
As shown in
As shown in
As shown in
The master CPU 10 and the slave CPU 20 execute the respective processing while obtaining synchronization by communication. A processing procedure of synchronization will be described below.
As shown in
Similarly, the same input value from the field device 1 is inputted to the slave CPU 20 through the input part 71 and an input buffer 73. A peripheral circuit 76 of the periphery of the slave CPU 20 is diagnosed by a diagnostic circuit 77. Also, a signal outputted from the input buffer 73 is inputted to the diagnostic circuit 77 and the presence or absence of abnormality of the signal is diagnosed. The presence or absence of abnormality of the peripheral circuit 76 and the presence or absence of abnormality of the signal outputted from the input buffer 73 are inputted to the slave CPU 20 as diagnostic information from the diagnostic circuit 77.
As shown in
Also, the master CPU 10 comprises the communication block 13 for executing communication with the slave CPU 20, and a code generation part 14 for adding a CRC (Cyclic Redundancy Check) code and an update counter to a PV value and a status.
Also, the slave CPU 20 comprises a PV value processing part 21 for executing arithmetic processing with respect to an input value inputted via the input buffer 73 and making conversion into a PV value (process value) of a format capable of processing in the upstream process which is the side of the controller 2, and a diagnostic part 22 for receiving diagnostic information from the diagnostic circuit 77 and executing abnormal detection and determination and generating a status which is a diagnostic result.
Also, the slave CPU 20 comprises the communication block 23 for executing communication with the master CPU 10, and a code generation part 24 for adding a CRC (Cyclic Redundancy Check) code and an update counter to a PV value and a status.
Next, an operation of the present unit will be described.
In the master CPU 10, a status generated by the diagnostic part 12 and a status which is generated by the diagnostic part 24 of the slave CPU 20 and is acquired through communication by the communication block 23 and the communication block 13 are compared and equalized in an equalization part 15. Equalization is processing for equalizing a status handled by the master CPU 10 and a status handled by the slave CPU 20. In the equalization part 15, OR information about the statuses is generated. That is, when either status indicates abnormality in the equalization part 15, its abnormality is changed to the captured status and is passed to the code generation part 14. As described below, the statuses handled by the master CPU 10 and the slave CPU 20 are shared by performing similar processing also in the slave CPU 20.
A PV value generated by the PV value processing part 11 is given to the code generation part 14. However, when abnormality of a status is detected based on processing in the equalization part 15, an input of the PV value to the code generation part 14 is broken by a breaking part 16.
In the code generation part 14, a CRC code is generated based on the status generated by the equalization part 15 and the inputted PV value. Also, every time new PV value and status are inputted, a count number is updated and a code added to a CRC code is generated. In the code generation part 14, a frame made of the PV value, the status, the CRC code and the count number is generated by adding the code generated thus to the PV value and the status. The count number is incremented every update of the PV value and the status.
A frame similar to the frame created by the code generation part 14 is similarly generated by the code generation part 24 of the slave CPU 20 and is acquired through communication by the communication block 23 and the communication block 13. The frame created by the code generation part 14 and the frame created by the code generation part 24 are collated in a comparison part 17. The comparison part 17 decides that it is abnormal when a mismatch between both the frames is detected. As described below, by performing similar processing also in the slave CPU 20, the master CPU 10 and the slave CPU 20 mutually collate the other processing result with my processing result and decide that it is abnormal when a mismatch occurs. When all the processing in the master CPU 10 and the slave CPU 20 is normal, both the frames match as a result of collation in the comparison part 17.
The frame generated by the code generation part 14 is outputted to an output part 78 which is an upstream process. However, a mismatch between both the frames is detected in the comparison part 17 and in the case of deciding that it is abnormal, an output of the frame is broken by a breaking part 18. Also, as described below, when a mismatch between the frames is detected in a comparison part 27 of the slave CPU 20, an output of the frame is broken in a fail-safe part 79.
On the other hand, in the slave CPU 20, a status generated by the diagnostic part 22 and a status which is generated by the diagnostic part 14 of the master CPU 10 and is acquired through communication by the communication block 13 and the communication block 23 are compared and equalized in an equalization part 25. In the equalization part 25, OR information about the statuses is generated. That is, when either status indicates abnormality in the equalization part 25, its abnormality is changed to the captured status and is passed to the code generation part 24.
A PV value generated by the PV value processing part 21 is given to the code generation part 24. However, when abnormality of a status is detected based on processing in the equalization part 25, an input of the PV value to the code generation part 24 is broken by a breaking part 26.
In the code generation part 24, a CRC code is generated based on the status generated by the equalization part 25 and the inputted PV value. Also, every time new PV value and status are inputted, a count number is updated and a code added to a CRC code is generated. In the code generation part 24, a frame made of the PV value, the status, the CRC code and the count number is generated by adding the code generated thus to the PV value and the status. The count number is incremented every update of the PV value and the status.
The frame created by the code generation part 24 is collated with a frame which is similarly generated by the code generation part 14 of the master CPU 10 and is acquired through communication by the communication block 13 and the communication block 23 in a comparison part 27. It is decided that it is abnormal when a mismatch between both the frames is detected in the comparison part 27.
When the mismatch between the frames is detected in the comparison part 27, a reset signal is outputted from the comparison part 27 and is given to the master CPU 10. In this case, the master CPU 10 is forcedly reset and an output of a new frame to the output part 78 is inhibited.
When the output to the output part 78 is inhibited, update of the count number is stopped, so that it can be recognized that an output of information is stopped by only referring to the count number in an upstream process of a subsequent stage after the output part 78.
Next, a processing procedure of synchronization between the master CPU 10 and the slave CPU 20 will be described. As described above, in the master CPU 10 and the slave CPU 20, data is exchanged in real time and the data is collated. As a result of this, when timing of processing in both the CPUs is off, separate processing results different in a time axis direction are compared and a mismatch of collation occurs. As a result of this, it is necessary for both the CPUs to always execute the same operation in the apparatus of the embodiment. Therefore, control is performed so that a command is sent from the side of the master CPU 10 in a constant cycle using asynchronous communication (UART) and the slave CPU 20 can execute processing in the same sequence in synchronization.
As shown in
a) and 7(b) show procedures of synchronization processing in the master CPU 10 and the slave CPU 20. These procedures are executed based on control of the synchronization processing part 19 of the master CPU 10 and the synchronization processing part 29 of the slave CPU 20.
In the master CPU 10, a command is sent to the slave CPU 20 in step S1 of
Next, step S2 waits a reply of response from the slave CPU 20 and when the response is replied, the flow proceeds to step S3. In step S3, a processing phase of the slave CPU 20 is monitored. That is, it is decided whether or not the phase information indicates a correct phase shown in the command by referring to the phase information included in the response. When this decision is affirmed, the flow proceeds to step S4 and when this decision is denied, the flow returns to step S1.
In step S4, processing timing of the slave CPU 20 is monitored. That is, it is decided whether or not processing in the slave CPU 20 can be executed at proper timing based on a reception interval (interval from a point in time of the previous reception to a point in time of this reception) of the responses in step S2. When the decision of step S4 is affirmed, the flow proceeds to step S5 and when the decision is denied, the flow returns to step S1.
In step S5, a predetermined processing phase (processing phase indicated by phase information about the command sent in step S1) is executed. Execution of full-duplexing communication is included in execution of the processing phase. The fill-duplexing communication is processing for simultaneously conducting two-way communication between the master CPU 10 and the slave CPU 20 using asynchronous communication (UART). Processing of the full-duplexing communication in the master CPU 10 includes processing for sending the frame (frame made of a PV value, a status, a CRC code and a count number) and the status described above to the slave CPU 20 through the communication block 13 and processing for receiving the frame and the status described above sent from the slave CPU 20 through the communication block 13.
After the end of the processing phase including the full-duplexing communication, the flow returns to step S1 and processing from step S1 to step S5 is repeated with respect to the next processing phase.
On the other hand, in the slave CPU 20, step S11 of
Next, it is decided whether or not communication data abnormality of the received command or communication abnormality such as parity abnormality or overrun abnormality occurs in step S12. When this decision is affirmed, the flow returns to step S11 and when this decision is denied, the flow proceeds to step S13.
In step S13, a processing phase of the master CPU 10 is monitored. That is, it is decided whether or not phase information indicates a correct phase by referring to the phase information included in the command. When this decision is affirmed, the flow proceeds to step S14 and when this decision is denied, the flow returns to step S11.
In step S14, processing timing of the master CPU 10 is monitored. That is, it is decided whether or not processing in the master CPU 10 can be executed at proper timing based on a reception interval (interval from a point in time of the previous reception to a point in time of this reception) of the commands in step S11. When the decision of step S14 is affirmed, the flow proceeds to step S15 and when the decision is denied, the flow returns to step S11.
In step S15, a response is replied to the master CPU 10. The response is sent through the communication block 23 by asynchronous communication (UART). Phase information about a processing phase immediately executed by the slave CPU 20, that is, a processing phase instructed by the received command is added to the response. This response corresponds to the response received in step S2.
Then, in step S16, a processing phase indicated by phase information about the command received in step S11 is executed. Execution of full-duplexing communication is included in execution of the processing phase. Processing of the full-duplexing communication in the slave CPU 20 includes processing for sending the frame (frame made of a PV value, a status, a CRC code and a count number) and the status described above to the master CPU 10 through the communication block 23 and processing for receiving the frame and the status described above sent from the master CPU 10 through the communication block 23.
After the end of the processing phase including the full-duplexing communication, the flow returns to step S11 and processing from step S11 to step S16 is repeated with respect to the next processing phase.
By the above processing procedure, the synchronization processing and the full-duplexing communication processing are repeatedly executed in processing phase units.
a) to 9(c) are time charts showing configurations of communication frames, and
For a command trigger period shown in
When a communication state is normal, processing of exchange between the response and the command for synchronization disposed in processing phase units and processing of subsequent duplexing communication are alternately repeated as shown in
When abnormality (communication abnormality) occurs in sending and receiving of the command and response, a decision of step S11, step S13 or step S14 of
As a result of this, while communication abnormality is found as shown in
Thus, the present embodiment is constructed so that when synchronization processing does not succeed due to communication abnormality, exchange of data by full-duplexing communication is stopped and synchronization processing of the processing phase is prepared. As a result of this, return from an abnormal state can be made easily.
Next, processing of the case where communication abnormality continues will be described.
a) and 8(b) show processing procedures of the case where communication abnormality continues in synchronization processing, for example, the case where a command and a response cannot be exchanged over a predetermined number or more of processing phases.
The master CPU 10 decides whether or not it is in a state of communication abnormality in step S21. When the decision is affirmed, the flow proceeds to step S22 and when the decision is denied, the processing of step S21 is repeated. It is decided whether or not the communication abnormality continues for a predetermined time or longer in step S22. When this decision is affirmed, the flow proceeds to step S23 and when the decision is denied, the flow returns to step S21.
In step S23, an upstream process is notified of the abnormality (
On the other hand, the slave CPU 20 decides whether or not it is in a state of communication abnormality in step S21. When the decision is affirmed, the flow proceeds to step S22 and when the decision is denied, the processing of step S21 is repeated. It is decided whether or not the communication abnormality continues for a predetermined time or longer in step S22. When this decision is affirmed, the flow proceeds to step S23 and when the decision is denied, the flow returns to step S21.
In step S23, an upstream process is notified of the abnormality. Then, a reset signal is outputted in step S24 (
As described above, in the present embodiment, the master CPU and the slave CPU 20 are synchronized every processing phase, so that the same processing phase can always be executed between the two CPUs. That is, the processing phase is executed in the slave CPU 20 using reception of a command sent from the master CPU 10 in a constant cycle as a trigger, so that the slave CPU 20 can be made to execute the processing phase in the constant cycle. Also, synchronization is obtained by conducting communication using asynchronous communication (UART), so that it is unnecessary to add other hardware etc. for synchronization.
Also, the slave CPU 20 always executes a predetermined processing phase according to a command sent from the master CPU 10, so that, for example, even in the case where abnormal data is temporarily sent from the master CPU 10 or execution timing of the processing phase in the slave CPU 20 is off, return can be made speedily when a communication state becomes normal. Further, at the time of communication abnormality, it shifts to a processing state specialized in receiving of a command in the slave CPU and sending a command from the master CPU 10, so that return from an abnormal state can be made easily.
In addition, processing phases may be executed continuously before deciding the presence or absence of communication abnormality. In this case, execution may be stopped from the next processing phase when the communication abnormality is not solved.
In the present embodiment, data communication necessary for phase processing is executed in the master CPU 10 and the slave CPU 20 using sending and receiving of a command and a response for synchronization as a trigger. As a result of this, the need for processing for synchronization during the data communication is eliminated and data communication by full-duplexing communication can be conducted. Also, synchronization and data communication are arranged in a time series manner, so that the full-duplexing communication can be conducted while using a common communication path.
In the present embodiment, synchronization is executed using asynchronous communication (UART), so that it can be implemented by serial communication of only two signal lines in a hardware manner and complicated mounting is not supplied. Particularly, even for a system in which two CPUs are mutually insulated, the number of connection lines is small, so that cost is low and there is no difficulty in mounting. For example, a situation in which two CPUs are distributed to the side of a controller and the side of field devices mutually insulated in a plant control system can also be implemented easily.
In the embodiment described above, the example of executing the same processing in two CPUs has been shown, but the synchronization processing described above can similarly be applied to the case of synchronizing plural CPUs and executing separate processing. Also, synchronization can be executed with respect to two or more slave CPUs.
In this example, as shown in
In this case, synchronization between the slave CPUs is also achieved by obtaining synchronization between the master CPU 10A and the respective slave CPUs. Therefore, the need for processing of synchronization between the slave CPUs is eliminated and synchronization between all the CPUs can be implemented easily by the minimum hardware.
Real time port-based input-output processing synchronously executed by plural CPUs can be performed by the synchronization between all the CPUs.
The scope of application of the invention is not limited to the embodiment described above. Also, the invention can be widely applied to an information processing system for handling various information as well as a safety system.
In addition, in the explanation described above, the case of implementing communication executed between the first device and the second device by asynchronous communication has been illustrated, but a form of communication is not limited to the asynchronous communication.
The present application is based on Japanese Patent Application (No. 2005-022945) filed on Jan. 31, 2005, the contents of which are incorporated herein by reference.
Number | Date | Country | Kind |
---|---|---|---|
2005-022945 | Jan 2005 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2006/301305 | 1/27/2006 | WO | 00 | 7/31/2007 |