Flow generation program, flow generation device, and flow generation method

JPWO2024189778A5Active Publication Date: 2025-02-19MITSUBISHI ELECTRIC CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023547177
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2025-02-19
Estimated Expiration
2043-03-14

AI Technical Summary

Technical Problem

The verification of control programs executed by programmable controllers becomes burdensome due to the complex relationships between numerous variables, leading to an overwhelming number of extracted dependency sets, making it difficult for users to perform verification work effectively.

Method used

A flow generation program and device that analyze changes in variable values within control programs, acquire log information to identify highly associated events, and generate a serially connected event flow diagram by excluding initial and directly or indirectly connected events from selection targets, thereby reducing the complexity of verification work.

Benefits of technology

The solution reduces the burden of verification work by preventing excessive combinations of variables in the flow, allowing for easier understanding and management of control program relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000015_0000
    Figure 00000015_0000
  • Figure 00000015_0001
    Figure 00000015_0001
  • Figure 00000015_0002
    Figure 00000015_0002
Patent Text Reader

Abstract

The program causes the flow generation device (10) to function as a generation unit (12). The generation unit (12) executes a connection operation in which a second event having the highest degree of association, indicating the degree of association with a first event that has occurred in a first variable among a plurality of variables included in the control program, is selected from events that have occurred in a second variable different from the first variable based on log information, and is connected to the first event, by performing the connection operation using an initial event that has occurred in an initial variable among the plurality of variables as the first event, and then repeats the connection operation while excluding the initial event and events directly or indirectly connected to the initial event from the selection targets for the new second event, thereby generating a flow in which two or more events are connected in series.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a flow generation program, a flow generation device, and a flow generation method.

Background Art

[0002] In the field of FA (Factory Automation), various processing steps are realized by a programmable controller controlling devices. The control of devices by a programmable controller follows the content specified in a control program executed by the programmable controller.

[0003] This control program may be a subject of verification to confirm whether the programmable controller operates as expected by the user. In the verification of the control program, attention is paid to the relationships between variables included in the control program, and how a specific event spreads in the control process is examined, or the cause of the occurrence of a specific event is investigated. Therefore, a technique for extracting the relationships between variables from a control program and its execution log has been proposed (for example, see Patent Document 1). Patent Document 1 describes a technique for extracting pairs of variables having a dependency relationship by analyzing the source code of a control program and correcting the extracted dependency relationship based on the analysis result of an execution log.

Prior Art Documents

Patent Documents

[0004]

Patent Document 1

Summary of the Invention

Problems to be Solved by the Invention

[0005] For control programs containing many variables, the number of variables that depend on one variable can become enormous. As a result, the number of variable pairs extracted by the technology described in Patent Document 1 will also be large. Even if dependencies are corrected based on the analysis results of the execution log, the user may be presented with an excessively complex set of variable relationships, potentially making verification difficult. Therefore, there is room to reduce the burden of verification work related to control programs executed by programmable controllers.

[0006] This disclosure is made under the circumstances described above and aims to reduce the burden of verification work related to control programs executed by programmable controllers. [Means for solving the problem]

[0007] To achieve the above objective, the flow generation program of this disclosure functions as a computer, a log information acquisition means that acquires log information showing the changes in the values ​​of each of the multiple variables included in a control program when the control program for controlling a device is executed by a programmable controller; a connection operation that selects the second event with the highest degree of relevance, which indicates the degree of relevance, from events occurring in a second variable different from the first variable, based on log information, and connects it to the first event, starting with the initial event occurring in the initial variable among the multiple variables as the first event, then using the second event connected by the previous connection operation as a new first event, and repeating the connection operation while excluding the initial event and events directly or indirectly connected to the initial event from the selection of the new second event, thereby generating a flow in which two or more events are connected in series, and generating an event flow diagram showing the generated flow. [Effects of the Invention]

[0008] According to this disclosure, the generation means generates a flow in which two or more events are connected in series by repeatedly performing a connection operation while excluding the initial event and events directly or indirectly connected to the initial event from the selection of a new second event. This avoids the appearance of a vast number of combinations of variables included in the control program in the flow. Therefore, the burden of verification work related to the control program executed by the programmable controller can be reduced. [Brief explanation of the drawing]

[0009] [Figure 1] This diagram shows the relationship between the flow generation device, PLC (Programmable Logic Controller), and equipment according to Embodiment 1. [Figure 2] A diagram showing an example of a control program according to Embodiment 1. [Figure 3] This figure shows the hardware configuration of the flow generation device according to Embodiment 1. [Figure 4] A diagram showing the functional configuration of the flow generation device according to Embodiment 1. [Figure 5] A diagram showing an example of log information according to Embodiment 1. [Figure 6] Flowchart showing the flow generation process according to Embodiment 1 [Figure 7] Flowchart showing the preparation process according to Embodiment 1 [Figure 8] A diagram showing an example of representative values ​​and index values ​​calculated in the preparation process according to Embodiment 1. [Figure 9] A diagram showing an example of specifying the initial event according to Embodiment 1. [Figure 10] Figure 1 shows an example of event connection according to Embodiment 1. [Figure 11] Figure 2 shows an example of event connection according to Embodiment 1. [Figure 12] Figure 3 shows an example of event connection according to Embodiment 1. [Figure 13]Figure showing an example of an event flow diagram displayed on the UI (User Interface) section according to Embodiment 1 [Figure 14] Figure for explaining the exclusion of outliers according to Embodiment 2 [Figure 15] Figure for explaining clustering according to Embodiment 2 [Figure 16] Figure showing an example of log information according to Embodiment 3 [Figure 17] Figure showing an example of the frequency counted in the preparation process according to Embodiment 3

Mode for Carrying Out the Invention

[0010] Hereinafter, the flow generation device according to the embodiment of the present disclosure will be described in detail with reference to the drawings.

[0011] Embodiment 1. As shown in FIG. 1, the flow generation device 10 according to the present embodiment is connected to a programmable controller, a PLC 21, and corresponds to a management terminal used for a user to manage the PLC 21. Specifically, the flow generation device 10 generates a flow representing the relationship between a large number of variables included in the control program 211 executed by the PLC 21, thereby assisting the user in debugging the control program 211. The flow generation device 10 may be connected to the PLC 21 via a communication line such as a USB (Universal Serial Bus) cable, or may be connected to the PLC 21 via a field network.

[0012] The PLC 21 is a control device that controls the device 22 by executing a pre-written control program 211 in the factory. In FIG. 1, one device 22 is typically shown, but the PLC 21 may be connected to a plurality of devices 22 and control these plurality of devices 22. For example, the PLC 21 may receive a signal from the device 22 indicating that the device 22, which is a sensor, has detected a workpiece being conveyed on the belt conveyor, and based on the received signal, transmit an operation command to another device 22, which is a robot, to process the workpiece. The PLC 21 may be connected to the device 22 by a signal line that transmits a voltage signal or a current signal, or may be connected to the device 22 via a field network.

[0013] The control program 211 is created by a user using the flow generation device 10 as a management terminal and written into the PLC 21. The control program 211 is a sequence program described in ladder language, as exemplified in a simplified manner in FIG. 2. The control process defined in the control program 211 is usually repeatedly executed by the PLC 21 in order to perform equivalent processes on a number of workpieces respectively.

[0014] As shown in Figure 2, the control program 211 includes an input variable named by combining "X," which indicates a signal input to the PLC 21, with a numerical value identifying the input signal, and an output variable named by combining "Y," which indicates a signal output from the PLC 21 to the device 22, with a numerical value identifying the output signal. In the example in Figure 2, the value of the output variable "Y1" is controlled according to the input variable "X1," and the value of the output variable "Y2" is controlled according to the input variable "X2." For example, the value of the input variable "X1" corresponds to a signal input from the device 22, which is a sensor, and the value of the output variable "Y1" corresponds to a signal output to the device 22, which is a robot. The values ​​of the variables are stored in the memory of the PLC 21 in the area corresponding to the name of the variable. Variables handled by the control program 211 are also called devices. Types of these devices include bit devices that indicate a 1-bit value corresponding to either an ON state or an OFF state, and word devices that indicate a word size value.

[0015] In verifying the control program 211, it is necessary to trace the relationships between events that occur to the values ​​of one variable and events that occur to the values ​​of other variables. While the relationships between variables can be understood by referring to the source code of the control program 211, understanding all the relationships shown in the complex source code is difficult, and in tasks such as corrective maintenance, it is not necessary to clarify all relationships. Therefore, the flow generation device 10 estimates the flow of events that are expected to be most closely related from among multiple events that occurred to the variables, based on the history of the variable values ​​when the control program 211 was executed, and provides this to the user.

[0016] Here, the relationships between variables and between events may be causal, dependent, or reciprocal relationships, or they may be correlational, co-occurring, or confounding relationships that are inferred to be related retrospectively, even if they are not involved in the source code of the control program 211.

[0017] The flow generation device 10 is comprised of hardware elements for functioning as a computer. More specifically, as shown in Figure 3, the flow generation device 10 includes a processor 101, a main memory unit 102, an auxiliary memory unit 103, an input unit 104, an output unit 105, and a communication unit 106. The main memory unit 102, the auxiliary memory unit 103, the input unit 104, the output unit 105, and the communication unit 106 are all connected to the processor 101 via an internal bus 107.

[0018] The processor 101 includes a CPU (Central Processing Unit) or MPU (Micro Processing Unit) as a processing circuit. The processor 101 performs various functions and executes the processing described later by executing the program P1 stored in the auxiliary storage unit 103. The program P1 corresponds to a so-called engineering tool and is an example of a flow generation program that makes the flow generation device 10 function as described later.

[0019] The main memory unit 102 includes RAM (Random Access Memory). Program P1 is loaded into the main memory unit 102 from the auxiliary memory unit 103. The main memory unit 102 is then used as a workspace for the processor 101.

[0020] The auxiliary storage unit 103 includes non-volatile memory such as EEPROM (Electrically Erasable Programmable Read-Only Memory) and HDD (Hard Disk Drive). In addition to program P1, the auxiliary storage unit 103 stores various data used in the processing of the processor 101. The auxiliary storage unit 103 supplies data to the processor 101 according to the instructions of the processor 101. The auxiliary storage unit 103 also stores data supplied from the processor 101.

[0021] The input unit 104 includes input devices such as hardware switches, input keys, keyboards, and pointing devices. The input unit 104 acquires information entered by the user and notifies the processor 101 of the acquired information.

[0022] The output unit 105 includes output devices such as an LED (Light Emitting Diode), an LCD (Liquid Crystal Display), and a speaker. The output unit 105 presents various information to the user according to instructions from the processor 101.

[0023] The communication unit 106 includes a communication interface circuit for communicating with an external device. The communication unit 106 receives a signal from an external source and outputs the data indicated by this signal to the processor 101. The communication unit 106 also transmits a signal indicating the data output from the processor 101 to the external device.

[0024] The aforementioned hardware configuration works in cooperation to enable the flow generation device 10 to perform various functions. In detail, as shown in Figure 4, the flow generation device 10 includes a log information acquisition unit 11 that acquires log information showing the changes in the values ​​of variables included in the control program 211, a generation unit 12 that generates a flow of events that have occurred in the variables based on the log information, an output unit 13 that outputs a data file 31 showing the generated flow, and a UI unit 14 that functions as an interface with the user 41.

[0025] The log information acquisition unit 11 is primarily implemented by the communication unit 106. The log information acquisition unit 11 receives log information from the PLC 21, as illustrated in Figure 5. As shown in Figure 5, the log information is a time series of records that associates the date and time, the identifier of a variable that is an input or output variable, and the event that occurred in that variable at that date and time. Below, we will explain an example in which all variables recorded in the log information represent a 1-bit value, and the event is a change in the value of the variable from OFF to ON or from ON to OFF. OFF corresponds to zero, and ON corresponds to 1.

[0026] The generation unit 12 is primarily implemented by the processor 101. The generation unit 12 generates a flow in which events recorded in the log information are connected in series, generates an event flow diagram showing the generated flow, and outputs it to the output unit 13 and the UI unit 14.

[0027] The output unit 13 is primarily realized through the cooperation of the processor 101 and the communication unit 106. The output destination of the data file 31 by the output unit 13 may be a recording medium such as a memory card that can be attached to or detached from the flow generation device 10, or it may be a storage device connected via a field network or LAN (Local Area Network).

[0028] The UI unit 14 is primarily realized through the cooperation of the input unit 104 and the output unit 105. The UI unit 14 acquires information input by the user 41 and provides it to the generation unit 12, causing the generation unit 12 to generate a flow based on this information. The UI unit 14 also presents the event flow diagram generated by the generation unit 12 to the user 41.

[0029] Next, the flow generation process performed by the flow generation device 10 will be described in detail with reference to Figures 6 to 13. The flow generation process shown in Figure 6 is an example of a flow generation method performed by the flow generation device 10.

[0030] In the flow generation process, the log information acquisition unit 11 acquires the control program 211 and log information from the PLC 21 (step S1). The control program 211 may be source code or an object-oriented program. The log information acquisition unit 11 is an example of a log information acquisition means that acquires log information showing the changes in the values ​​of each of the multiple variables included in the control program when the control program for controlling the equipment is executed by a programmable controller. Next, the generation unit 12 performs preparation processing for generating the flow (step S2).

[0031] In the preparation process, as shown in Figure 7, the generation unit 12 extracts logs of variables included in the control program 211 from the log information (step S21). Specifically, the generation unit 12 scans the control program 211 to identify all input and output variables used in the control program 211, and extracts records related to the identified variables from the log information. If the log information contains only records related to input and output variables used in the control program 211, step S21 may be omitted.

[0032] Next, the generation unit 12 calculates the time difference of events that occurred in the variables for all combinations of the two variables (step S22). Specifically, the generation unit 12 calculates the time difference in the log information for all combinations of events in the input variables and events in the output variables. For example, as shown in Figure 8, there are 8 combinations of the preceding event in which the input variable X1 changes from OFF to ON, and the following events for all output variables Y1 to Y4, since there are 2 types of events for each output variable. If there are also 4 input variables, X1 to X4, there are 64 total combinations, since there are 2 types of events for each variable.

[0033] Returning to Figure 7, following step S22, the generation unit 12 calculates a representative value of the calculated difference and an index value of the variation for each combination of events (step S23). As described above, the processing defined in the control program 211 is executed repeatedly. Therefore, since each event can occur repeatedly, the time difference for a particular combination of two events is usually calculated multiple times. For example, in the log information of Figure 5, similar events occur repeatedly with a period of about 15 minutes, so the combination of the event in which input variable X1 turns ON and the subsequent event in which output variable Y1 turns ON is recorded multiple times, and other combinations are also recorded multiple times.

[0034] Note that multiple subsequent events occur after a single preceding event. For example, even if multiple events occur after the event where input variable X1 turns ON at 0:00:00, it is sufficient to calculate the difference between the most recent event and the subsequent event.

[0035] Figure 8 illustrates the representative value and index value of the calculated difference for each combination. Here, the representative value is the mean, and the index value of variability is the standard deviation. However, it is not limited to these; the representative value may be the median or mode, and the index value may be the coefficient of variation.

[0036] Returning to Figure 7, when step S23 is completed, the flow generation device 10 returns from the preparation process to the flow generation process shown in Figure 6. As shown in Figure 6, following the preparation process in step S2, the flow generation device 10 sets the initial event of the flow (step S3). The initial event is the event that marks the start of the flow, and the flow generation device 10 accepts the specification of the initial event from the user. For example, as shown in Figure 9, by clicking on the input variable X1 in the control program displayed on the UI unit 14, the event of this variable is specified as the initial event from the submenu that appears. The initial event may be the first event that occurs with respect to the specified variable as shown in Figure 9, or the user may further specify the type of event that should be the initial event. The variable on which the initial event occurs corresponds to an example of an initial variable.

[0037] Returning to Figure 6, the generation unit 12 selects the initial event as the first event and performs a connection operation to connect the second event, which has the highest degree of relevance to the first event, to the first event by selecting it from events that satisfy the event conditions 1 to 4 (step S4).

[0038] Condition 1 is that the variability index value is below the threshold. For example, if an event that turns on input variable X1 is set as the initial event, and the threshold is 1.0, then for the combination with the event that turns on output variable Y3 shown in Figure 8, the standard deviation is 1.1, which exceeds the threshold, so the event that turns on output variable Y3 is not selected as the second event. Note that the threshold may be specified by the user.

[0039] Condition 2 is that the event is a subsequent event. If the event that turns input variable X1 ON is set as the initial event, then the event that follows this initial event becomes the target for selection as the second event. For this reason, in Figure 8, the eight combinations of subsequent events where the event that turns input variable X1 ON precedes the initial event satisfy condition 2, but the combinations where the event that turns input variable X1 ON follows do not satisfy condition 2.

[0040] Condition 3 is that if the variable in which the first event occurred is an input variable, then the event must have occurred on the output variable; and if the variable in which the first event occurred is an output variable, then the event must have occurred on the input variable. If the event of input variable X1 is set as the initial event, then the events of output variables Y1 to Y4 will be selected as the second event, and other events of input variable X1 and other input variables X2 to X4 will not be selected as the second event. If representative values ​​and index values ​​have been calculated for combinations of input and output variables as in the preparation process described above, condition 3 may be omitted.

[0041] Condition 4 is different from the following exclusions: namely, it is different from the initial event, other events that occur on the variable in which the initial event occurred, connected events that are directly or indirectly connected to the initial event, and other events that occur on the variable in which the connected event occurred. However, for Condition 4 of step S4 when an event that turns input variable X1 ON is set as the initial event, the event of this input variable X1 is excluded.

[0042] Events that satisfy conditions 1 to 4 include, for example, the two events shown in Figure 8: the event in which output variable Y1 turns ON and the event in which output variable Y2 turns ON.

[0043] The generation unit 12 selects the event with the highest degree of relevance to the first event from among the events that satisfy conditions 1 to 4 as the second event. The degree of relevance increases as the representative value decreases. For example, if the degree of relevance is P and the representative value is Q, the degree of relevance can be expressed by the formula P = 1 / (Q + 1), but it is not limited to this and can be expressed by other formulas. Note that since the degree of relevance corresponds one-to-one with the representative value, the generation unit 12 may also treat the representative value as the degree of relevance. The generation unit 12 only needs to select the event with the smallest representative value from the selected events as the second event. In the example in Figure 8, the event in which the output variable Y1 turns ON will be selected as the second event.

[0044] As a result, as shown in Figure 10, node 51, which indicates the first event in which input variable X1 turns ON, is connected to node 52, which indicates the second event in which output variable Y1 turns ON. In Figure 10, nodes 51 and 52 are connected by arrows indicating the temporal relationship, but they may also be connected by lines of a different type. In Figure 10, rectangular nodes correspond to input variables, and elliptical nodes correspond to output variables. The hatching on the nodes corresponds to the event in which they turn ON.

[0045] Returning to Figure 6, following step S4, the generation unit 12 takes the second event connected in the previous connection operation as a new first event, and performs a connection operation (step S5) to select and connect the new second event that has the highest degree of relevance to the new first event from the events that satisfy conditions 1 to 4. For example, in step S5 after an event that turns output variable Y1 ON is connected to the initial event as shown in Figure 10, the event corresponding to node 52 is taken as a new first event, and the same connection operation as in step S4 is repeated. As a result, as illustrated in Figure 11, node 53 corresponding to the event that turns input variable X2 OFF is connected to node 52.

[0046] The connection operation performed in steps S4 and S5 is an example of a connection operation that selects the second event with the highest relevance, which indicates the degree to which it is related to the first event that occurred in the first variable among multiple variables, from events that occurred in a second variable different from the first variable, based on log information, and connects it to the first event.

[0047] Returning to Figure 6, following step S5, the generation unit 12 determines whether there are any remaining events that can be connected to the end of the flow (step S6). That is, it determines whether there are any remaining events that satisfy conditions 1 to 4, when the last connected event is taken as the new first event.

[0048] If it is determined that there are still connectable events remaining (step S6; Yes), the generation unit 12 repeats the connection operation in step S5. As a result, as shown in Figure 11, nodes 54 to 56 are connected in order, and a flow is generated in which events of input variables and events of output variables are connected alternately in series.

[0049] If it is determined in step S6 that there are no remaining connectable events (step S6; No), the generation unit 12 determines whether or not events for all variables have been connected in the flow (step S7). In the example in Figure 11, since the events for input variable X3 and output variable Y2 are not included in the flow, the determination in step S7 is rejected.

[0050] If it is determined that no events are connected for any of the variables (Step S7; No), the generation unit 12 sets the event that occurred for the unconnected variable as the first event, and performs a connection operation to connect the second event, which has the highest degree of relevance to the first event, to the first event by selecting an event that satisfies conditions 1 to 3 and condition 5 (Step S8). For example, the event that turns on input variable X3 is set as the first event. Note that the method for selecting one unconnected variable and the method for selecting the type of event related to the selected variable are arbitrary.

[0051] Condition 5 is that the event constitutes a flow. Therefore, step S8 can be described as a step in searching for a destination to connect an unconnected event to the flow. If the event corresponding to node 54 is selected as the most relevant event from among the events that satisfy conditions 1 to 3 and 5, then node 57, which corresponds to the event that turns input variable X3 ON, is connected to node 54, as shown in Figure 12.

[0052] Subsequently, the generation unit 12 repeats the determination in step S7. As a result, one event is connected to the flow for all variables. For example, as shown in Figure 12, node 58, which corresponds to the event that turns output variable Y2 ON, is connected to node 57.

[0053] If the judgment in step S7 is repeated without any new events being connected, the generation unit 12 may make it easier to connect events to the flow by omitting or changing some of the conditions determined in step S8. For example, the generation unit 12 may increase the threshold for condition 1 or omit condition 2. Furthermore, if no new events are connected even after changing the conditions, the generation unit 12 may determine that all connectable events have already been connected to the flow and affirm the judgment in step S7.

[0054] In step S7, if it is determined that events for all variables have been connected to the flow (step S7; Yes), the generation unit 12 generates an event flow diagram showing the generated flow, displays the event flow diagram on the UI unit 14, and outputs a data file showing the event flow diagram to the output unit 13 (step S9). Specifically, as shown in Figure 13, the UI unit 14 displays arrows connecting nodes with representative values ​​of the time difference between events. This allows the user 41 to easily recognize which events occurred and how much time had passed between them. The output unit 13 is an example of an output means that outputs a data file showing the event flow diagram.

[0055] As explained above, the generation unit 12 generates a flow in which two or more events are connected in series by repeatedly performing connection operations while excluding the initial event and events directly or indirectly connected to the initial event from the selection of a new second event. This avoids the appearance of a vast number of combinations of variables included in the control program 211 in the flow. Therefore, the burden of verification work related to the control program 211 executed by the PLC 21 can be reduced.

[0056] Furthermore, the correlation index, which indicates the degree to which events are related, is higher when the representative value of the difference between the time the first event occurred and the time the second event occurred is small. Generally, it can be assumed that there is some kind of relationship between events that occur with a short time difference. For this reason, it is expected that an appropriate flow of events can be obtained from the log information.

[0057] Furthermore, the connection operation involves selecting a second event from among events whose index value, which indicates the variation in time differences, is smaller than a threshold. If this index value is large, it can be said that the relationship between the events is weak, thus avoiding the connection of inappropriate events.

[0058] Furthermore, after generating a flow in which events are connected in series, the generation unit 12 selects the event with the highest degree of relevance to an unconnected event that occurred in any of the multiple variables but is not included in the flow, from among the events that make up the flow, and modifies the flow by connecting the unconnected event to the selected event. This makes it possible to obtain a flow that represents the relationships of as many variables as possible.

[0059] Furthermore, the connection operation involves connecting an output variable to an input variable and an input variable to an output variable. Generally, since the PLC21 controls the device 22 in response to the input signal, the control program of the PLC21 generates an event for the output variable in response to an event for the input variable. Also, since the PLC21 receives a new signal input as a result of controlling the device 22 and acting on the outside, an event for the input variable is generated in response to an event for the output variable. In this way, the events of the input variables and the events of the output variables influence each other alternately, so a flow that reflects reality can be obtained.

[0060] Furthermore, the first and second events that are the target of the connection operation are an increase or decrease in the value of one bit. Here, an increase corresponds to a change to the ON state, and a decrease corresponds to a change to the OFF state. Since bit devices often correspond to the presence or absence of input or output in the control program 211, it is expected that a flow will be obtained that appropriately represents the order in which the presence or absence of input and output is determined.

[0061] Furthermore, the generation unit 12 generates a flow by repeatedly performing connection operations, using the second event connected by the previous connection operation as a new first event, while excluding the initial event, other events occurring in the variable where the initial event occurred, connection events directly or indirectly connected to the initial event, and other events occurring in the variable where the connection event occurred from the selection of the new second event. As a result, a flow is generated in which one event is adopted for each variable. Since it is rare for all events occurring in a given variable to be meaningful, and in most cases it is necessary to focus on one type of event, the generated flow is expected to be free of unnecessary events.

[0062] Furthermore, the flow generation device 10 includes an output unit 13 that outputs a data file 31 showing an event flow diagram. This makes it easier to use the event flow diagram. For example, it becomes easy to create a manual that includes an event flow diagram.

[0063] Embodiment 2. Next, Embodiment 2 will be described, focusing on the differences from Embodiment 1 described above. Note that the same or equivalent components as in Embodiment 1 will be referred to by the same reference numerals. This embodiment differs from Embodiment 1 in that it calculates an appropriate representative value after eliminating inappropriate sample values ​​calculated as time differences.

[0064] The control processes specified in control program 211 are preferably executed periodically, but may be temporarily stopped in the event of an abnormality such as a momentary power outage. The time difference calculated in the preparation process from the recorded log information, including such exceptional periods, may include outliers that differ significantly from the 15 or 16 seconds during normal operation, as shown in Figure 14.

[0065] Therefore, the generation unit 12 detects outliers in the time difference distribution and calculates a representative value from the sample values ​​of one or more time differences from which the detected outliers have been excluded. For example, the generation unit 12 excludes outliers using the so-called 3σ method. Specifically, the generation unit 12 calculates the mean and standard deviation using all the sample values ​​of the time differences and repeats the process of excluding sample values ​​that are more than three times the mean and standard deviation until there are no more samples to exclude. In the example in Figure 14, it is shown that after the determination of what to exclude is repeated six times, sample values ​​of 972 seconds or longer are excluded as outliers.

[0066] Furthermore, if both the first and second events, which are the targets of the connection operation, occur only once in the control processing defined by the control program 211, the time difference between these events will be generally constant. However, if at least one of the first and second events occurs two or more times in the control processing, the time difference between the events will not necessarily be constant. For example, as shown in Figure 15, for the same combination of events, time differences of approximately 20 seconds and approximately 80 seconds may alternate.

[0067] Therefore, the generation unit 12 calculates representative values ​​based on the results of clustering the time-lag sample values. For example, the generation unit 12 clusters using the k-means method and calculates representative values ​​and variability index values ​​for each cluster. Then, the generation unit 12 adopts the representative value and index value of at least one cluster as values ​​to be used in the connection operation. For example, the generation unit 12 may adopt the cluster with the smallest representative value, or the cluster with the smallest index value, or it may adopt the weighted average of the values ​​of all clusters.

[0068] As explained above, the generation unit 12 detects outliers in the time difference distribution and calculates a representative value from one or more time difference sample values ​​excluding the detected outliers. This allows for the calculation of an appropriate representative value, resulting in a flow that accurately reflects the actual situation.

[0069] Furthermore, the generation unit 12 calculates representative values ​​based on the results of clustering time-difference sample values. For example, for a distribution that is appropriate to be considered as two clusters, as shown in Figure 15, the representative values ​​calculated in the same manner as in Embodiment 1 would be values ​​that hardly appear in the actual log information. In contrast, the generation unit 12 according to this embodiment can obtain representative values ​​that are more in line with reality by calculating representative values ​​based on the clustering results.

[0070] Embodiment 3. Next, Embodiment 3 will be described, focusing on the differences from Embodiment 1 described above. Note that the same or equivalent components as in Embodiment 1 will be referred to by the same reference numerals. This embodiment differs from Embodiment 1 in that the log information does not include a date and time, and no time difference is used in the connection operation.

[0071] The log information in this embodiment is equivalent to the log information in Embodiment 1 with the date and time omitted, as illustrated in Figure 16. Based on this log information, the preparation process counts the frequency with which the two events occurred consecutively without any other events in between for all combinations of two events, as shown in Figure 17. The generation unit 12 then performs a connection operation using this frequency as the degree of relevance. This generates a flow similar to that of Embodiment 1. Note that the determination of condition 1 shown in Figure 6 regarding the connection operation is omitted.

[0072] As explained above, in connection operations, the second event with the highest relevance to the first event is the event that occurs immediately after the first event more frequently than other events. This makes it possible to generate flows from logs that do not include timestamps.

[0073] While embodiments of this disclosure have been described above, this disclosure is not limited to the embodiments described above.

[0074] For example, in embodiments 1 and 2, the format of the log information is not limited to a format that associates the event that occurred with its time. The log information may be information in which the values ​​of variables are recorded with a sampling period shorter than the period of the control process, regardless of whether an event occurred or not. The presence or absence of an event may be determined in the preparation process from such information. The log information may be information that directly or indirectly shows the changes in the values ​​of variables when the control program is executed by the PLC21.

[0075] Furthermore, while an example has been described in which the log information acquisition unit 11 acquires log information from the PLC 21, it is not limited to this. The log information acquisition unit 11 may also acquire log information provided by the user.

[0076] Furthermore, while a flow was generated using all the events of the variables included in the control program 211, it is not limited to this. The UI unit 14 may accept a specification of a subprogram corresponding to a part of the control program from the user, and the generation unit 12 may generate a flow targeting the variables included in this subprogram. The UI unit 14 is an example of a user interface means that accepts a specification of a subprogram included in the control program.

[0077] Furthermore, the conditions used to determine the connection operation may be arbitrarily changed. For example, condition 3, which is used to alternately connect events of input variables and events of output variables, may be omitted. This allows events of one input variable to be connected to events of another input variable, or events of another output variable to be connected to events of another output variable.

[0078] Furthermore, while we have described an example of generating a flow by using one type of event per variable, this is not the only way to go. For example, for variables specified by the user, a flow may be generated using all events. That is, the exclusion criteria for condition 4 shown in Figure 6 may be the initial event and the connection events connected to the flow.

[0079] The generation unit 12 performs a connection operation on an initial event that occurs in an initial variable among multiple variables, treating it as the first event. Then, it uses the second event connected by the previous connection operation as a new first event. By repeating the connection operation while excluding the initial event and events directly or indirectly connected to the initial event from the selection of the new second event, it generates a flow in which two or more events are connected in series, and generates an event flow diagram showing the generated flow. This is an example of a generation means.

[0080] Furthermore, condition 2 may be changed from an event following the first event to an event preceding it, or it may be omitted. In the above embodiment, since condition 2 is a subsequent event, events that occur after the initial event are connected in order, resulting in a flow of events that occurred after the initial event. This flow can be described as a flow of events in which the effects of the initial event propagate. On the other hand, if condition 2 is changed to a preceding event, the resulting flow can be described as a flow that traces the events that caused the initial event, as events preceding the initial event are connected in order.

[0081] In the connection operation according to Embodiment 3, the second event with the highest degree of relevance to the first event may be defined as an event that occurs more frequently than other events immediately before the first event.

[0082] Furthermore, while we have described an example of treating an increase and decrease in a 1-bit value as different types of events, it is also possible to treat any change in value as a single type of event without distinguishing between increases and decreases. In addition, events occurring in a bit device are not limited to increases and decreases in value; other events may be used, or other events may be added. Examples of other events include the retention of an ON or OFF value for a specified period of time or longer.

[0083] Furthermore, the events that constitute the flow are not limited to events occurring on bit devices, but may also include events occurring on word devices.

[0084] The functions of the flow generation device 10 according to the above-described embodiment can be realized by dedicated hardware or by a normal computer system.

[0085] For example, a device that performs the above-mentioned processing can be configured by distributing program P1 on a computer-readable recording medium such as a flexible disk, CD-ROM (Compact Disk Read-Only Memory), DVD (Digital Versatile Disk), or MO (Magneto-Optical disk), and then installing program P1 on a computer.

[0086] Alternatively, program P1 may be stored on a disk drive of a server device on a communication network such as the Internet, and then downloaded to a computer, for example, by superimposing it onto a carrier wave.

[0087] Furthermore, the above-mentioned process can also be achieved by launching and executing program P1 while transferring it over a network such as the Internet.

[0088] Furthermore, the above-described process can also be achieved by having all or part of program P1 run on a server device, and by having a computer send and receive information about the process via a communication network while executing program P1.

[0089] Furthermore, if the above-mentioned functions are implemented by the OS (Operating System) or through collaboration between the OS and the application, only the parts other than the OS may be stored and distributed on a medium, or they may be downloaded to a computer.

[0090] Furthermore, the means for realizing the functions of the flow generation device 10 are not limited to software; some or all of them may be realized by dedicated hardware or circuits.

[0091] This disclosure allows for various embodiments and modifications without departing from the broad spirit and scope of this disclosure. Furthermore, the embodiments described above are for illustrative purposes only and do not limit the scope of this disclosure. In other words, the scope of this disclosure is indicated by the claims, not by the embodiments. Various modifications made within the scope of the claims and the equivalent significance of the disclosure are considered to be within the scope of this disclosure. [Industrial applicability]

[0092] This disclosure is suitable for verifying control programs used in factory automation (FA) settings. [Explanation of Symbols]

[0093] 10 Flow generation device, 11 Log information acquisition unit, 12 Generation unit, 13 Output unit, 14 UI unit, 101 Processor, 102 Main memory unit, 103 Auxiliary memory unit, 104 Input unit, 105 Output unit, 106 Communication unit, 107 Internal bus, 21 PLC, 211 Control program, 22 Equipment, 31 Data file, 41 User, 51-58 Nodes, P1 program.

Claims

1. Computer, a log information acquiring means for acquiring log information indicating transitions of values ​​of a plurality of variables included in a control program for controlling an apparatus when the control program is executed by a programmable controller; a generating means for generating an event flow diagram showing the generated flow by performing a connection operation of selecting a second event having the highest degree of association, which indicates the degree of association with a first event occurring in a first variable of the plurality of variables, from among events occurring in a second variable different from the first variable based on the log information and connecting the second event to the first event, by performing an initial event occurring in an initial variable of the plurality of variables as the first event, and then repeating the connection operation while setting the second event connected by the previous connection operation as the new first event and excluding the initial event and events directly or indirectly connected to the initial event from the selection targets for the new second event; A flow generator to function as a

2. the log information indicates, in association with time, transitions of values ​​of the plurality of variables when a process defined by the control program is repeatedly executed by the programmable controller; the degree of association is high when a representative value of a difference between a time when the first event occurred and a time when the second event occurred is small; The flow generating program according to claim 1 .

3. the connecting operation is an operation of selecting the second event from events having an index value indicating the variation in the difference smaller than a threshold value; The flow generating program according to claim 2 .

4. after generating the flow, the generating means selects, from the events constituting the flow, an event having the highest degree of association with an unconnected event that has occurred in any of the plurality of variables but is not included in the flow, and connects the unconnected event to the selected event, thereby modifying the flow. The flow generating program according to claim 3.

5. the generating means detects an outlier in the distribution of the differences, and calculates the representative value from one or more of the differences excluding the detected outlier. The flow generating program according to claim 2 .

6. the generating means calculates the representative value based on a result of clustering a plurality of sample values ​​of the difference. The flow generating program according to claim 2 .

7. The event flow diagram shows the flow by using nodes corresponding to events and lines connecting the nodes corresponding to the connected events, and shows the representative values ​​attached to the lines. The flow generating program according to claim 2 .

8. the log information indicates transitions of the values ​​of the plurality of variables when the process defined by the control program is repeatedly executed by the programmable controller; The second event having the highest relevance to the first event is an event that occurs more frequently immediately before or after the first event than other events. The flow generating program according to claim 1 .

9. When the first variable is an input variable corresponding to an input to the programmable controller, the second variable is an output variable corresponding to an output from the programmable controller to the device, if the first variable is the output variable, the second variable is the input variable; The flow generation program according to any one of claims 1 to 8.

10. The first variable and the second variable are variables representing a 1-bit value, the first event and the second event are a change in the value of the one bit; The flow generation program according to any one of claims 1 to 8.

11. the first event and the second event are, respectively, an increase or a decrease in the value of the one bit; The flow generating program according to claim 10.

12. the generating means generates the flow by repeating the connecting operation while excluding, from selection targets for the new second event, the second event connected by the previous connecting operation as the new first event, an event occurring in the initial variable, a connecting event directly or indirectly connected to the initial event, and another event occurring in the variable in which the connecting event occurred. The flow generation program according to any one of claims 1 to 8.

13. The computer, a user interface means for receiving a designation of a partial program included in the control program; It also functions as The plurality of variables are variables included in the partial program. The flow generation program according to any one of claims 1 to 8.

14. The computer, an output means for outputting a data file showing the event flow diagram; Further functioning as The flow generation program according to any one of claims 1 to 8.

15. a log information acquiring means for acquiring log information indicating transitions of values ​​of a plurality of variables included in a control program for controlling an apparatus when the control program is executed by a programmable controller; a generating means for performing a connection operation of selecting a second event having the highest degree of association indicating a degree of association with a first event occurring in a first variable of the plurality of variables from among events occurring in a second variable different from the first variable based on the log information and connecting the second event to the first event, by performing an initial event occurring in an initial variable of the plurality of variables as the first event, and then repeating the connection operation while setting the second event connected by the previous connection operation as a new first event and excluding the initial event and events directly or indirectly connected to the initial event from selection targets for the new second event, thereby generating a flow in which two or more events are connected in series, and generating an event flow diagram showing the generated flow; A flow generating device comprising:

16. a log information acquiring means for acquiring log information indicating transitions of values ​​of a plurality of variables included in a control program for controlling an apparatus when the control program is executed by a programmable controller; a generating means for performing a connection operation of selecting a second event having the highest degree of association indicating a degree of association with a first event occurring in a first variable among the plurality of variables from among events occurring in a second variable different from the first variable based on the log information and connecting the second event to the first event, and performing the connection operation with an initial event occurring in an initial variable among the plurality of variables as the first event, and then performing the connection operation while setting the second event connected by the previous connection operation as a new first event and excluding the initial event and events directly or indirectly connected to the initial event from selection targets for the new second event, thereby generating a flow in which two or more events are connected in series; the generating means generates an event flow diagram showing the flow; A flow generation method comprising: