SFC program automatic debugging method and system, electronic equipment and storage medium

Through automated SFC program debugging methods and systems, the problems of high cost and low efficiency of manual verification tests are solved, and more efficient and accurate SFC program verification tests are achieved.

CN120216343APending Publication Date: 2025-06-27SUPCON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510357133.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, the verification test of SFC programs relies on manual execution, resulting in high labor costs, high resource consumption, and low accuracy and efficiency of verification tests.

Method used

It provides an automatic debugging method and system for SFC program. It receives debug command packets sent by the debug client through the debugging server, parses command information and determines the target SFC program, performs debugging actions, and performs these actions on the DCS system through the controller.

Benefits of technology

It reduces labor costs and resource consumption, and improves the accuracy and efficiency of SFC program verification tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216343A_ABST
    Figure CN120216343A_ABST
Patent Text Reader

Abstract

The invention provides an SFC program automatic debugging method and system, electronic equipment and a storage medium, the system comprises a debugging client, a debugging server and a controller, a plurality of SFC programs are deployed on the debugging server, and at least one debugging command data packet sent by the debugging client is received through the debugging server, the debugging command data packet is generated by the debugging client according to the test case file; aiming at each debugging command data packet, analyzing the debugging command data packet through the debugging server to obtain corresponding command information, a command number and a sub-command number; a debugging server determines a corresponding target SFC program according to command information, and sends a command number and a sub-command number to the target SFC program, so that the target SFC program determines a debugging action corresponding to the target SFC program according to self SFC configuration information, the command number and the sub-command number; and executing a debugging action on the corresponding DCS system through the controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a method, system, electronic device, and storage medium for automatically debugging SFC programs. Background Art

[0002] In industries such as pharmaceuticals, food, chemicals, and petrochemicals, a large number of sequential function chart (SFC) programs are usually formed by the control logic at one layer. The SFC programs are related to the control of field devices and are of great significance for on-site operation. Before the factory is put into operation, that is, before deploying the SFC program to the corresponding DCS system, it is necessary to strictly verify and test each logic in the SFC program. Only when the verification test passes can it be put into operation in the factory.

[0003] In the prior art, generally, each logic in the SFC program is verified and tested manually. However, when the on-site configuration scale is large, a large amount of manpower and time are required for joint debugging tests, which not only has high labor costs and large resource consumption, but also has low accuracy and efficiency of verification tests. Summary of the Invention

[0004] In view of this, the present application provides a method, system, electronic device, and storage medium for automatically debugging SFC programs, aiming to reduce labor costs, reduce resource consumption, and improve the accuracy and efficiency of verification tests for SFC programs.

[0005] The first aspect of the present application provides a method for automatically debugging SFC programs, which is applied to an SFC program automatic debugging system. The system includes a debugging client, a debugging server, and a controller. A plurality of SFC programs are deployed on the debugging server. The method includes:

[0006] Receiving, by the debugging server, at least one debugging command data packet sent by the debugging client, where the debugging command data packet is generated by the debugging client according to a test case file;

[0007] For each of the debugging command data packets, parsing, by the debugging server, the debugging command data packet to obtain corresponding command information, command number, and sub-command number;

[0008] Determining, by the debugging server according to the command information, a corresponding target SFC program, and sending the command number and the sub-command number to the target SFC program, so that the target SFC program determines a debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number, and the sub-command number; where the debugging action is to switch the operation mode or a control command for the target SFC program;

[0009] Execute the debugging action on the corresponding DCS system through the controller; wherein, the DCS system is an industrial control system that needs to deploy the target SFC program.

[0010] Optionally, the process of the debugging server determining the corresponding target SFC program according to the command information and sending the command number and the sub-command number to the target SFC program, so that the target SFC program determines the debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number, and the sub-command number, includes:

[0011] The debugging server determines the target SFC program that matches the program name in the command information and sends the command number and the sub-command number to the target SFC program;

[0012] While the target SFC program parses its own SFC configuration information, it combines the command number and the sub-command number to obtain a debugging action number;

[0013] The target SFC program determines the preset debugging action number that is the same as the debugging action number from each preset debugging action number set in advance, and determines the debugging action corresponding to the preset debugging number with the same debugging action number as the debugging action of the target SFC program.

[0014] Optionally, while the target SFC program parses its own SFC configuration information, it combines the command number and the sub-command number to obtain a debugging action number, including:

[0015] While the target SFC program parses its own SFC configuration information, it determines the combination method adopted by each preset debugging action number, and combines the command number and the sub-command according to the combination method to obtain a debugging action number.

[0016] Optionally, if the debugging action is a running mode switch and the running debugging is switched to automatic;

[0017] The process of the controller executing the debugging action on the corresponding DCS system includes:

[0018] The controller obtains the conversion conditions of the target SFC program under the running debugging switch and determines whether the corresponding DCS system meets the conversion conditions;

[0019] If the DCS system meets the conversion conditions, the controller executes the debugging action on the DCS system.

[0020] Optionally, if the operation debugging is switched to manual, the method further includes:

[0021] If the DCS system meets the conversion condition, the controller is used to detect in real time whether a continue command sent by the user based on the debugging client is received;

[0022] If the continue command is received, the controller is used to execute the debugging action on the DCS system.

[0023] Optionally, if the debugging action is an SFC control command, and the SFC control command is start, or stop, or reset;

[0024] The step of the controller executing the debugging action on the corresponding DCS system includes:

[0025] The controller is used to control the target SFC program to enter the target state from the current state, and run the target SFC program in the target state on the corresponding DCS system, so as to execute the debugging action on the DCS;

[0026] Wherein, if the SFC control command is start, the current state is the IDLE state or the STOPPED state, and the target state is the RUNNING state; if the SFC control command is stop, the current state is the RUNNING state, and the target state is the STOPPED state; if the SFC control command is reset, the current state is the COMPLETE state or the STOPPED state, and the target state is the IDLE state.

[0027] Optionally, after the controller executes the debugging action on the corresponding DCS system, the method further includes:

[0028] The controller is used to collect the debugging result after the debugging action is executed on the DCS system, and send the debugging result to the debugging client;

[0029] The debugging client is used to compare the debugging result of the target SFC program with the target debugging result of the target SFC program.

[0030] A second aspect of the present application provides an SFC program automatic debugging system, the system includes a debugging client, a debugging server and a controller, and a plurality of SFC programs are deployed on the debugging server;

[0031] The debugging server is configured to receive at least one debugging command data packet sent by the debugging client. The debugging command data packet is generated by the debugging client according to a test case file. For each debugging command data packet, the debugging server parses the debugging command data packet to obtain corresponding command information, a command number, and a sub-command number. The debugging server determines a corresponding target SFC program according to the command information, and sends the command number and the sub-command number to the target SFC program, so that the target SFC program determines a debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number, and the sub-command number. The debugging action is to switch the operation mode or a control command for the target SFC program.

[0032] The controller is configured to execute the debugging action on a corresponding DCS system. The DCS system is an industrial control system where the target SFC program needs to be deployed.

[0033] A third aspect of the present application provides an electronic device, including: a processor and a memory, where the processor and the memory are connected through a communication bus. The processor is configured to call and execute a program stored in the memory. The memory is configured to store a program, and the program is used to implement the SFC program automatic debugging method provided in the first aspect of the present application.

[0034] A fourth aspect of the present application provides a storage medium, where computer-executable instructions are stored in the storage medium, and the computer-executable instructions are used to execute the SFC program automatic debugging method provided in the second aspect of the present application.

[0035] The present application provides an SFC program automatic debugging method, system, electronic device, and storage medium. By receiving at least one debugging command data packet sent by the debugging client through the debugging server, for each debugging command data packet, the debugging server parses the debugging command data packet to obtain corresponding command information, a command number, and a sub-command number, and determines a corresponding target SFC program according to the command information, so as to send the command number and the sub-command number to the target SFC program, so that the target SFC program determines a debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number, and the sub-command number. Finally, the controller executes the debugging action on a corresponding DCS system. If manual intervention is involved in the entire debugging process of the target SFC program, it can not only reduce labor costs and resource consumption, but also improve the accuracy and efficiency of the verification test of the target SFC program. Description of the Drawings

[0036] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0037] Figure 1 It is a schematic flowchart of a method for automatically debugging an SFC program provided by an embodiment of the present application;

[0038] Figure 2 It is a schematic structural diagram of a system for automatically debugging an SFC program provided by an embodiment of the present application;

[0039] Figure 3 It is an example diagram of a method for automatically debugging an SFC program provided by an embodiment of the present application;

[0040] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0042] In the present application, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including an..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0043] For a better understanding of the present application, the following explains the technical terms involved in the present application:

[0044] Sequential Function Chart: The Sequential Function Chart (SFC) is a type of module operation used to control the sequence of time events, such as processes like start-up, operation, and stop. The SFC consists of steps and transition conditions. Among them, a step contains a series of actions; when the corresponding transition condition is met, the sequence progresses from the current step to the next step. During each scan of the SFC program, the system determines the active step and transition conditions. When the transition condition is satisfied, the step before the transition condition is no longer active, and the step after the transition condition becomes active, that is, the actions included in the step corresponding to the SFC program are executed.

[0045] DCS: Refers to the Distributed Control System, an instrument control system based on microprocessors, adopting the design principle of decentralized control functions, centralized display and operation, and taking into account both decentralized autonomy and comprehensive coordination. Its main feature is centralized management and decentralized control.

[0046] Tag number: Defines the on-site I / O points.

[0047] See Figure 1 , showing a schematic flow chart of a method for automatically debugging an SFC program provided by an embodiment of the present application. The method for automatically debugging an SFC program is applied to an SFC program automatic debugging system. The SFC program automatic debugging system includes a debugging client, a debugging server, and a controller. As Figure 2 shown, multiple SFC programs are deployed on the debugging server. The method for automatically debugging an SFC program specifically includes the following steps:

[0048] S101: Receive at least one debugging command data packet sent by the debugging client through the debugging server, where the debugging command data packet is generated by the debugging client according to a test case file.

[0049] During the specific execution of step S101, first, the debugging server can be started; second, when the debugging server is started, the debugging client establishes a connection and communication with the debugging server according to the IP address and port number of the debugging server; finally, when the debugging client and the debugging server establish a connection and communication, the debugging client loads the test case file information from its own cache and generates at least one debugging command data packet to transmit the generated debugging command data packet to the debugging server.

[0050] In some embodiments, the test case file information includes debugging commands related to each SFC program. Among them, the debugging commands related to the SFC program at least include information such as version number, command information, command number related to the SFC program, sub-command number, and data length, etc.; the version number is the version number of the communication protocol used when the debugging client and the debugging server establish a connection and communication; the command information at least includes the program name of the SFC program.

[0051] In the actual application process, after the debugging client loads the test case file information, for each debugging command in the test case file, corresponding data packet headers can be generated according to information such as the version number, command number, and data length of the sub-command number in the debugging command, corresponding data packet bodies can be generated according to the command information in the debugging command, and finally, the debugging command data packet of the debugging command can be generated according to the data packet body and the data packet header.

[0052] S102: For each debugging command data packet, the debugging server parses the debugging command data packet to obtain the corresponding command information, command number, and sub-command number.

[0053] In the specific process of executing step S102, after the debugging server receives at least one debugging command data packet transmitted by the debugging client, for each debugging command data packet, the data packet body in the debugging command data packet is parsed to obtain the corresponding command information, and the data packet header in the debugging command data packet is parsed to obtain the corresponding command number and sub-command number.

[0054] S103: The debugging server determines the corresponding target SFC program according to the command information and sends the command number and sub-command number to the target SFC program, so that the target SFC program determines the debugging action corresponding to the target SFC program according to its own SFC configuration information, command number, and sub-command number.

[0055] In the specific process of executing step S103, for each debugging command data packet, after the debugging server parses the command information, command number, and sub-command number in the debugging command data packet, it can determine the target SFC program that matches the program name in the command information from each target SFC program deployed on itself, and send the corresponding command number and sub-command number to the determined target SFC program, so that while the target SFC program parses its own SFC configuration information, it determines the corresponding debugging action according to the received command number and sub-command number.

[0056] Optionally, the debugging server determines the target SFC program that matches the program name in the command information and sends the command number and sub-command number to the target SFC program; while the target SFC program parses its own SFC configuration information, it combines the command number and sub-command number to obtain the debugging action number; the target SFC program determines the preset debugging action number with the same debugging action number from each preset debugging action number set in advance, and determines the debugging action corresponding to the preset debugging number with the same debugging action number as the debugging action of the target SFC program.

[0057] In some embodiments, the debugging actions corresponding to each SFC program and the debugging action numbers corresponding to each debugging action can be preset. Among them, the debugging action number of the debugging action corresponding to the SFC program is composed of the command number and sub-command number corresponding to the SFC program. The debugging action corresponding to the SFC program can be to open the SFC program, or close the SFC program, or perform a running mode switch, or an SFC control command, or a bit number read value, or a bit number write value, etc., which are not limited in the embodiments of the present application.

[0058] It should be noted that the running switch mode can be automatic, manual, self-start, etc.; the SFC program control commands can be step skipping, continuing, starting, stopping, resetting, etc., which are not limited in the embodiments of the present application.

[0059] Optionally, when the target SFC program parses its own SFC configuration information, the process of combining the command number and sub-command number to obtain the debugging action number can be specifically: when the target SFC program parses its own SFC configuration information, determine the combination method adopted by each preset debugging action number, and combine the command number and sub-command according to the combination method to obtain the debugging action number.

[0060] As a preferred method provided by the embodiments of the present application, the combination method adopted by each preset debugging action number can be splicing. After the target SFC program determines the combination method adopted by each preset debugging action number, it can splice the command number and sub-command number to obtain the debugging action number of the debugging action corresponding to the target SFC program.

[0061] It should be noted that when the debugging action corresponding to the SFC program is to open the SFC program, close the SFC program, perform a running mode switch, an SFC control command, or a bit number read value, the debugging action numbers corresponding to the debugging actions of each SFC program can be as shown in Table 1. Among them, the action descriptions corresponding to each debugging action are as shown in Table 2.

[0062] Table 1:

[0063] Preset debugging action number Command number Sub-command number Debugging action 1+1 1 1 Open SFC program 1+2 1 2 Close SFC program 2+1 2 1 Operation mode switch: Automatic 2+2 2 2 Operation mode switch: Manual 2+3 2 3 Operation mode switch: Auto-start 3+1 3 1 SFC program control command: Skip 3+2 3 2 SFC program control command: Continue 3+4 3 3 SFC program control command: Start 3+4 3 4 SFC program control command: Stop 3+5 3 5 SFC program control command: Reset 4+1 4 1 Bit number read value 4+2 4 2 Bit number write value

[0064] Table 2:

[0065] No. Debugging action Debugging action description 1 Open SFC program Open the SFC program before debugging and load the SFC configuration. Support single and batch opening. 2 Close SFC program Close the SFC program after debugging. Support single and batch closing. 3 Operation mode switch There are 3 types of operation mode switches: Automatic: When the conversion condition is met, it is automatically activated and the next step is executed. Manual: After the currently activated step is completed, the step continues to execute, and the next step is only activated and executed when the continue command is received and the conversion condition is met. Auto-start: After the program is executed in manual mode, it will automatically enter the first step and start executing again. 4 SFC control command SFC control command. There are 5 types of SFC control commands: Skip: In manual mode, clear the status parameters of the target step and activate the target step. Continue: In manual mode, continue to execute the program. Start: Make the program enter the RUNNING state from IDLE, or enter the RUNNING state from STOPPED. Stop: Make the program enter the STOPPED state from RUNNING. Reset: Make the program enter the IDLE state from the COMPLETE or STOPPED state. 5 Bit number read value Read the value of the specified bit number, support single and batch writing. 6 Bit number write value Write the value to the specified bit number, support single and batch writing.

[0066] The above is only one combination method of the command number and sub-command number provided by the embodiments of the present application. The specific combination method of the command number and sub-command number can be set according to actual applications, which are not limited in the embodiments of the present application.

[0067] It should be noted that in the actual application process, after the target SFC program receives the command number and sub-command number sent by the debugging server, the combination method adopted for the command number and sub-command number needs to be consistent with the combination method adopted when setting the debugging action number corresponding to the pre-set debugging action.

[0068] For example, in the process of setting the corresponding debugging action number for the debugging action corresponding to the target SFC program in advance, if the command number and sub-command number of the target SFC program are concatenated to obtain the corresponding debugging action number, then for each debugging command data packet, after the debugging server determines the target SFC program corresponding to the command information parsed from the debugging command data packet, it can send the command number and sub-command number parsed from the debugging command data packet to the determined target SFC program, so that the determined target SFC program concatenates the received command number and sub-command number to obtain the corresponding debugging command number, and finally determines the debugging command number consistent with the obtained debugging command number from the debugging command numbers shown in Table 1, and determines the debugging action corresponding to the determined debugging command number as the debugging action corresponding to the determined target SFC program.

[0069] S104: Execute the debugging action on the corresponding DCS system through the controller.

[0070] In the specific process of executing step S104, the debugging client establishes a communication connection with the debugging server according to the IP address and port number of the debugging server; after the debugging server establishes a communication connection with the debugging client, it opens the SFC program deployed by itself and loads the SFC configuration information corresponding to each SFC program; for each SFC program, after the SFC program is opened, it can establish a corresponding online debugging environment with the controller, as Figure 3 shown, so that when the debugging client establishes a communication connection with the debugging server, it sends the generated debugging command data packet to the debugging server; the debugging server parses the received debugging command data packet to obtain the corresponding command information, command number and sub-command number, and determines the target SFC program that matches the command information from the deployed SFC programs, so as to send the parsed command number and sub-command number to the target SFC program; the target SFC program determines the corresponding debugging action according to the received command number and sub-command number, and forwards the determined debugging action to the controller; the controller executes the debugging action on the corresponding DCS system; the controller feeds back the obtained debugging result to the target SFC program, and the target SFC program feeds back the debugging result to the debugging client through the debugging server.

[0071] In the embodiments of the present application, the debugging actions of the target SFC program may include opening the SFC program, closing the SFC program, switching the operation mode, SFC control commands, reading the tag value, writing the tag value, and so on.

[0072] As an implementation manner in the embodiments of the present application, if the debugging action is to switch the operation mode and the running debugging is switched to automatic, the process of executing the debugging action on the corresponding DCS system by the controller may be as follows: The controller obtains the conversion conditions of the target SFC program under the running debugging switch and determines whether the corresponding DCS system meets the conversion conditions; if the DCS system meets the conversion conditions, the controller executes the debugging action on the DCS system; if the DCS system does not meet the conversion conditions, corresponding prompt information may be output to prompt the user that the DCS system currently does not meet the corresponding conversion conditions and cannot execute the corresponding debugging action.

[0073] It should be noted that as can be seen from Table 2, when the debugging action of the controller is to switch the operation mode to automatic, the corresponding DCS system needs to meet the corresponding conversion conditions. Under the condition of meeting the corresponding conversion conditions, it is automatically activated and the next step is executed, that is, it is automatically activated and the debugging action is executed on the DCS system.

[0074] As another implementation manner in the embodiments of the present application, if the debugging action is to switch the operation mode and the running debugging is switched to manual, the process of executing the debugging action on the corresponding DCS system by the controller may be as follows: The controller obtains the conversion conditions of the target SFC program under the running debugging switch and determines whether the corresponding DCS system meets the conversion conditions; if the DCS system meets the conversion conditions, it can further detect in real time whether a continue command sent by the user based on the debugging client is received; when the continue command is received, the debugging action is executed on the DCS system; if the DCS system does not meet the conversion conditions, corresponding prompt information may be output to prompt the user that the DCS system currently does not meet the corresponding conversion conditions and cannot execute the corresponding debugging action.

[0075] As another implementation manner in the embodiments of the present application, if the debugging action is to switch the operation mode and the running debugging is switched to self-start, the process of executing the debugging action on the corresponding DCS system by the controller may be as follows: The controller may execute the corresponding debugging action when the DCS system meets the conversion conditions of the corresponding target SFC program under the running debugging switch and receives the corresponding continue command, and return to execute step S101 after executing the corresponding debugging control to re-execute the corresponding SFC program automatic debugging method.

[0076] It should be noted that when the debugging action corresponding to the target SFC program is to switch the operation mode, the switching between single-step and continuous operation can be achieved.

[0077] As another implementation provided by the embodiments of the present application, if the debugging action is an SFC control command, and the SFC control command is start, or stop, or reset, the process of executing the debugging action on the corresponding DCS system by the controller may be: controlling, by the controller, the target SFC program to enter the target state from the current state, and running the target SFC program that enters the target state on the corresponding DCS system, so as to implement the debugging action on the DCS.

[0078] It should be noted that, as can be seen from Table 2, if the SFC control command is start, the current state is the IDLE state or the STOPPED state, and the target state is the RUNNING state; if the SFC control command is stop, the current state is the RUNNING state, and the target state is the STOPPED state; if the SFC control command is reset, the current state is the COMPLETE state or the STOPPED state, and the target state is the IDLE state.

[0079] As another implementation provided by the embodiments of the present application, if the debugging action is an SFC control command, and the SFC control command is step skip, the process of executing the debugging action on the corresponding DCS system by the controller may be: the controller clears the state parameters of the target step in the manual mode and activates the target step; wherein, the action corresponding to the target step is the debugging action.

[0080] As another implementation provided by the embodiments of the present application, if the debugging action is an SFC control command, and the SFC control command is continue, the process of executing the debugging action on the corresponding DCS system by the controller may be: the controller executes the target SFC program in the manual mode to execute the corresponding debugging action on the DCS system.

[0081] It should be noted that in the case where the debugging action corresponding to the target SFC program is an SFC control command, debugging of steps can be implemented.

[0082] As another implementation provided by the embodiments of the present application, if the debugging action is a tag reading value, the process of executing the debugging action on the corresponding DCS system by the controller may be: the controller can read the value corresponding to the specified tag carried on the target SFC program from the DCS system.

[0083] As another implementation provided by the embodiments of the present application, if the debugging action is a tag writing value, the process of executing the debugging action on the corresponding DCS system by the controller may be: the controller can write the corresponding value to the specified tag on the DCS system; wherein, the target SFC program carries the corresponding specified tag and the value to be written.

[0084] It should be noted that by reading / writing values of the tag number, read / write operations can be performed on the corresponding specified tag number on the DCS system; if the corresponding IO tag number does not exist in the debugged program page (such as in other program pages), the IO tag number can be added to the corresponding tag number debug table, so as to achieve the purpose of supporting the debugging of IO tag numbers outside the program.

[0085] It should also be noted that the SFC program can also distinguish operations such as reading values of tag numbers, writing values, and step control according to the sub-command number, and send debug commands to the controller. In order to improve efficiency, multiple commands can also be combined into one data packet for sending, so as to improve the data communication ability.

[0086] It should also be noted that when the corresponding debug action of the SFC program is to read the value of the tag number, it can periodically read the corresponding value from the controller and cache it, or read the corresponding value when a debug client request arrives.

[0087] Furthermore, in the embodiment of the present application, after the controller executes the debug action on the corresponding DCS system, it can collect the debug result after executing the debug action on the DCS system, and send the debug result to the debug client; the debug client compares the debug result of the target SFC program with the target debug result of the target SFC program; if the debug result is consistent with the target debug result, it can be considered that the target SFC program is debugged successfully; if not, it can be considered that the target SFC program is not debugged successfully, and at this time, the corresponding prompt message can be output to prompt the user that the target SFC program is not debugged successfully.

[0088] The present application provides an SFC program automatic debugging method. The debug server receives at least one debug command data packet sent by the debug client. For each debug command data packet, the debug server parses the debug command data packet to obtain the corresponding command information, command number, and sub-command number, and determines the corresponding target SFC program according to the command information, so as to send the command number and sub-command number to the target SFC program, so that the target SFC program determines the corresponding debug action according to its own SFC configuration information, command number, and sub-command number. Finally, the controller executes the debug action on the corresponding DCS system. The entire debugging process of the target SFC program does not require manual intervention, which can not only reduce labor costs and resource consumption, but also improve the accuracy and efficiency of the verification test of the target SFC program.

[0089] Based on the SFC program automatic debugging method provided by the above embodiment of the present application, correspondingly, the embodiment of the present application also provides an SFC program automatic debugging system, as Figure 2As shown, the automatic debugging system for SFC programs includes a debugging client, a debugging server, and a controller. Multiple SFC programs are deployed on the debugging server.

[0090] The debugging server is used to receive at least one debugging command data packet sent by the debugging client. The debugging command data packet is generated by the debugging client according to a test case file. For each debugging command data packet, the debugging server parses the debugging command data packet to obtain the corresponding command information, command number, and sub-command number. The debugging server determines the corresponding SFC program according to the command information, and sends the command number and sub-command number to the SFC program, so that the SFC program determines the debugging action corresponding to the SFC program according to its own SFC configuration information, command number, and sub-command number. The debugging action is to switch the running mode or a control command for the SFC program.

[0091] The controller is used to execute the debugging action on the corresponding DCS system. The DCS system is an industrial control system where the SFC program needs to be deployed.

[0092] The specific principles and execution processes of each unit in the SFC program automatic debugging system disclosed in the embodiments of the present application are the same as those of the SFC program automatic debugging method disclosed in the embodiments of the present application. For the corresponding parts, reference can be made to the SFC program automatic debugging method disclosed in the embodiments of the present application, and details will not be elaborated here.

[0093] The present application provides an SFC program automatic debugging system. The debugging server receives at least one debugging command data packet sent by the debugging client. For each debugging command data packet, the debugging server parses the debugging command data packet to obtain the corresponding command information, command number, and sub-command number, and determines the corresponding SFC program according to the command information, so as to send the command number and sub-command number to the SFC program, so that the SFC program determines the debugging action corresponding to the SFC program according to its own SFC configuration information, command number, and sub-command number. Finally, the controller executes the debugging action on the corresponding DCS system. The entire debugging process of the SFC program does not require manual intervention, which can not only reduce labor costs and resource consumption, but also improve the accuracy and efficiency of the verification test for the SFC program.

[0094] Optionally, the debugging server that determines the corresponding SFC program according to the command information, sends the command number and sub-command number to the SFC program, and enables the SFC program to determine the debugging action corresponding to the SFC program according to its own SFC configuration information, command number, and sub-command number is specifically used for:

[0095] Determine the SFC program that matches the program name in the command information, and send the command number and sub-command number to the SFC program. While the SFC program parses its own SFC configuration information, combine the command number and sub-command number to obtain a debugging action number, and determine the preset debugging action number with the same debugging action number from each preset debugging action number set in advance, and determine the debugging action corresponding to the preset debugging number with the same debugging action number as the debugging action of the SFC program.

[0096] Optionally, the SFC program that combines the command number and sub-command number to obtain a debugging action number while parsing its own SFC configuration information is specifically used for:

[0097] While parsing its own SFC configuration information, determine the combination method adopted by each preset debugging action number, and combine the command number and sub-command according to the combination method to obtain a debugging action number.

[0098] Optionally, if the debugging action is a running mode switch and the running debugging is switched to automatic; the controller that executes the debugging action on the corresponding DCS system is specifically used for:

[0099] Obtain the conversion condition of the SFC program under the running debugging switch, and determine whether the corresponding DCS system meets the conversion condition; if the DCS system meets the conversion condition, execute the debugging action on the DCS system.

[0100] Optionally, if the running debugging is switched to manual, the controller is also used for:

[0101] If the DCS system meets the conversion condition, detect in real time whether a continue command sent by the user based on the debugging client is received; if the continue command is received, execute the debugging action on the DCS system.

[0102] Optionally, if the debugging action is an SFC control command, and the SFC control command is start, or stop, or reset; the controller that executes the debugging action on the corresponding DCS system is specifically used for:

[0103] Control the SFC program to enter the target state from the current state, and run the SFC program entering the target state on the corresponding DCS system to implement the debugging action on the DCS.

[0104] Among them, if the SFC control command is start, the current state is the IDLE state or the STOPPED state, and the target state is the RUNNING state; if the SFC control command is stop, the current state is the RUNNING state, and the target state is the STOPPED state; if the SFC control command is reset, the current state is the COMPLETE state or the STOPPED state, and the target state is the IDLE state.

[0105] Optionally, the controller is further configured to:

[0106] Collect the debugging result after the debugging action is executed on the DCS system through the controller, and send the debugging result to the debugging client, so that the debugging client compares the debugging result of the SFC program with the target debugging result of the SFC program.

[0107] The present application also provides a storage medium, in which program instructions are stored, and when the program instructions are loaded and executed by a processor, the embodiments of any one of the above program automatic debugging methods are implemented.

[0108] The present application also provides an electronic device, as Figure 4 shown. The electronic device includes a processor 401 and a memory 402, and the processor and the memory are connected through a communication bus; the processor and the memory are connected through a communication bus; wherein, the processor is configured to call and execute the program stored in the memory; the memory is configured to store a program, and the program is used to implement any one of the above SFC program automatic debugging methods.

[0109] The processor herein may be the CPU of the terminal, or an MCU integrated in the terminal, or a combination of the CPU and the MCU. Moreover, the processor includes a kernel, and the kernel retrieves the corresponding program from the memory, and one or more kernels may be provided.

[0110] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.

[0111] For the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0112] It should be noted that the various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the similarities between the embodiments, reference can be made to each other. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description of the method embodiments. The steps in the method embodiments of this application can be adjusted, combined, and deleted according to actual needs. The modules and sub-modules in the devices and terminals in the embodiments of this application can be combined, divided, and deleted according to actual needs.

[0113] In several embodiments provided by this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the terminal embodiments described above are merely illustrative. For example, the division of modules or sub-modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or modules can be in electrical, mechanical, or other forms.

[0114] The modules or sub-modules described as separate components may or may not be physically separated. The components as modules or sub-modules may or may not be physical modules or sub-modules, that is, they can be located in one place, or they can be distributed to multiple network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0115] In addition, in each embodiment of this application, the various functional modules or sub-modules can be integrated in a processing module, or each module or sub-module can exist physically alone, or two or more modules or sub-modules can be integrated in one module. The above-mentioned integrated modules or sub-modules can be implemented in the form of hardware or in the form of software functional modules or sub-modules.

[0116] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0117] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0118] The above are only the preferred embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for automatic debugging of an SFC program, characterized in that: Applied to an SFC program automatic debugging system, the system includes a debugging client, a debugging server and a controller, and a plurality of SFC programs are deployed on the debugging server. The method includes: Receiving, by the debugging server, at least one debugging command data packet sent by the debugging client, wherein the debugging command data packet is generated by the debugging client according to a test case file; For each of the debugging command data packets, the debugging server parses the debugging command data packet to obtain corresponding command information, command number and sub-command number; The debugging server determines the corresponding target SFC program according to the command information, and sends the command number and the sub-command number to the target SFC program, so that the target SFC program determines the debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number and the sub-command number; wherein the debugging action is switching the operation mode, or is a target SFC program control command; The debugging action is performed on the corresponding DCS system through the controller; wherein the DCS system is an industrial control system that needs to deploy a target SFC program.

2. The method according to claim 1, characterized in that: The debugging server determines the corresponding target SFC program according to the command information, and sends the command number and the sub-command number to the target SFC program, so that the target SFC program determines the debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number and the sub-command number, including: Determine, by the debugging server, a target SFC program that matches the program name in the command information, and send the command number and the sub-command number to the target SFC program; While parsing the SFC configuration information of the target SFC program itself, the command number and the sub-command number are combined to obtain a debugging action number; The target SFC program determines the preset debugging action number with the same debugging action number from various preset debugging action numbers, and determines the debugging action corresponding to the preset debugging number with the same debugging action number as the debugging action of the target SFC program.

3. The method according to claim 2, characterized in that While parsing the SFC configuration information of the target SFC program itself, combining the command number and the sub-command number to obtain a debugging action number includes: While parsing the SFC configuration information of the target SFC program itself, the combination method used by each of the preset debugging action numbers is determined, and the command number and the sub-command are combined according to the combination method to obtain the debugging action number.

4. The method according to claim 1, characterized in that: If the debugging action is a running mode switch, and the running debugging switch is automatic; The performing the debugging action on the corresponding DCS system by the controller includes: Acquiring, by the controller, a conversion condition of the target SFC program under the running and debugging switching, and determining whether the corresponding DCS system satisfies the conversion condition; If the DCS system meets the switching condition, the debugging action is executed on the DCS system through the controller.

5. The method according to claim 4, characterized in that If the operation debugging is switched to manual, the method further includes: If the DCS system meets the conversion condition, the controller detects in real time whether a continue command sent by the user based on the debugging client is received; If the continue command is received, the debugging action is executed on the DCS system through the controller.

6. The method according to claim 1, characterized in that If the debugging action is an SFC control command, and the SFC control command is start, stop, or reset; The performing the debugging action on the corresponding DCS system by the controller includes: Controlling the target SFC program from the current state to the target state through the controller, and running the target SFC program entering the target state on the corresponding DCS system, so as to implement the debugging action on the DCS; Among them, if the SFC control command is to start, the current state is the IDLE state or the STOPPED state, and the target state is the RUNNING state; if the SFC control command is to stop, the current state is the RUNNING state, and the target state is the STOPPED state; if the SFC control command is to reset, the current state is the COMPLETE state or the STOPPED state, and the target state is the IDLE state.

7. The method according to claim 1, characterized in that After executing the debugging action on the corresponding DCS system through the controller, the method further includes: collecting, by the controller, a debugging result after executing the debugging action on the DCS system, and sending the debugging result to the debugging client; The debugging result of the target SFC program is compared with the target debugging result of the target SFC program through the debugging client.

8. An SFC program automatic debugging system, characterized in that: The system includes a debugging client, a debugging server and a controller, and a plurality of SFC programs are deployed on the debugging server; The debugging server is used to receive at least one debugging command data packet sent by the debugging client, wherein the debugging command data packet is generated by the debugging client according to the test case file; for each of the debugging command data packets, the debugging command data packet is parsed to obtain corresponding command information, command number and sub-command number; according to the command information, a corresponding target SFC program is determined, and the command number and the sub-command number are sent to the target SFC program, so that the target SFC program determines the debugging action corresponding to the target SFC program according to its own SFC configuration information, the command number and the sub-command number; wherein the debugging action is switching the operation mode, or is a target SFC program control command; The controller is used to execute the debugging action on the corresponding DCS system; wherein the DCS system is an industrial control system that needs to deploy a target SFC program.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor and the memory are connected via a communication bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program, and the program is used to implement the SFC program automatic debugging method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores computer executable instructions, and the computer executable instructions are used to execute the SFC program automatic debugging method according to any one of claims 1 to 7.