CN115793582A - Industrial control algorithm debugging method, system and device and electronic equipment - Google Patents

Industrial control algorithm debugging method, system and device and electronic equipment Download PDF

Info

Publication number
CN115793582A
CN115793582A CN202211491326.XA CN202211491326A CN115793582A CN 115793582 A CN115793582 A CN 115793582A CN 202211491326 A CN202211491326 A CN 202211491326A CN 115793582 A CN115793582 A CN 115793582A
Authority
CN
China
Prior art keywords
target
industrial control
control algorithm
debugging
operation result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211491326.XA
Other languages
Chinese (zh)
Inventor
施江林
王方平
邱怀宇
柯体杰
姚晶星
陈秉强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Supcon Technology Co Ltd
Original Assignee
Zhejiang Supcon Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Supcon Technology Co Ltd filed Critical Zhejiang Supcon Technology Co Ltd
Priority to CN202211491326.XA priority Critical patent/CN115793582A/en
Publication of CN115793582A publication Critical patent/CN115793582A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses an industrial control algorithm debugging method, system and device and electronic equipment. Wherein, the method comprises the following steps: downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment; acquiring a target operation result generated by the target simulation controller operating a target industrial control algorithm; and displaying the target operation result to the target object, responding to the algorithm debugging instruction of the target object under the condition that the target operation result is inconsistent with the preset expected result, and debugging the target industrial control algorithm. The method and the device solve the technical problem that the development and debugging efficiency of the industrial control algorithm is low because the development and debugging of the industrial control algorithm in the industrial field at present must depend on the development and verification environment provided by the entity controller and the running condition of the algorithm can be detected only through the log output of the entity controller.

Description

Industrial control algorithm debugging method, system and device and electronic equipment
Technical Field
The application relates to the technical field of industrial automation control, in particular to a method, a system and a device for debugging an industrial control algorithm and electronic equipment.
Background
In industrial production life, the high-performance controller with powerful functions supports rich industrial standard protocols and large storage capacity by means of universal computing capacity, has the functions of input and output functions, is widely applied to traditional factory workshops, improves the traditional process, and provides parallel computing capacity for each task; however, in the industrial field, development and debugging of an industrial control algorithm and subsequent upgrading and reconstruction are highly dependent on a development verification environment provided by an entity controller, the debugging algorithm cannot be compiled after the development verification environment is separated from the entity controller, and the industrial control algorithm can be debugged only by detecting the running condition of the algorithm through log output of the entity controller, so that the problems of low development and debugging efficiency of the industrial control algorithm and the like are caused.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides an industrial control algorithm debugging method, an industrial control algorithm debugging system, an industrial control algorithm debugging device and electronic equipment, and at least solves the technical problem that the development and debugging efficiency of an industrial control algorithm is low because the development and debugging of the industrial control algorithm in the current industrial field must depend on a development verification environment provided by an entity controller and the running condition of the algorithm can only be detected through the log output of the entity controller.
According to an aspect of an embodiment of the present application, there is provided an industrial control algorithm debugging method, including: downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment; obtaining a target operation result generated by the target simulation controller operating a target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished; and under the condition that the target operation result is inconsistent with a preset expected result, responding to an algorithm debugging instruction of the target object, and debugging the target industrial control algorithm, wherein the preset expected result is a result output by the operation target industrial control algorithm which is obtained in a planned mode.
Optionally, in response to the algorithm debugging instruction of the target object, debugging the target industrial control algorithm includes: determining a target debugging mode indicated by the algorithm debugging instruction, wherein the target debugging mode comprises at least one of the following modes: adding a debugging mode and starting the debugging mode; and debugging the target industrial control algorithm according to the target debugging mode.
Optionally, according to the target debugging manner, the debugging the target industrial control algorithm includes: determining a first operation result inconsistent with a preset expected result as an operation result to be corrected under the condition that the target debugging mode is an additional debugging mode; determining a code position for generating an operation result to be corrected in a target industrial control algorithm; the method comprises the steps of showing a code position to a target object, responding to a breakpoint setting instruction of the target object, and setting a target breakpoint in a program code of a target industrial control algorithm, wherein the target breakpoint is used for enabling the target industrial control algorithm to be paused at the position of the target breakpoint when the target industrial control algorithm is operated; running a target industrial control algorithm containing target breakpoints to obtain a breakpoint running result; and displaying the breakpoint operation result to the target object, responding to the breakpoint debugging instruction of the target object, and debugging the target industrial control algorithm.
Optionally, according to the target debugging manner, the debugging the target industrial control algorithm includes: and under the condition that the target debugging mode is a starting debugging mode, debugging the target industrial control algorithm according to the algorithm debugging instruction.
Optionally, before determining the target debugging mode, the method further includes: determining a code module which generates a target operation result inconsistent with a preset expected result in a target industrial control algorithm under the condition that the target operation result is inconsistent with the preset expected result; and sending the target operation result inconsistent with the preset expected result and the code module to a front-end interface for displaying, and sending alarm information.
Optionally, downloading the target industrial control algorithm to the target simulation controller comprises: determining functional parameters and structural parameters of a target entity controller, wherein the target entity controller is an entity controller planning to apply a target industrial control algorithm; establishing a target simulation controller according to the functional parameters and the structural parameters; and acquiring a target industrial control algorithm in the integrated development environment, and configuring the target industrial control algorithm into a target simulation controller, wherein the integrated development environment is used for developing the target industrial control algorithm.
Optionally, the method further comprises: under the condition that a plurality of target industrial control algorithms exist, setting a target identifier for each target industrial control algorithm, and configuring the target identifiers and the target industrial control algorithms into a target simulation controller; acquiring a target operation result corresponding to a target industrial control algorithm according to the target identification; and under the condition that the target operation result is inconsistent with the preset expected result, responding to the algorithm debugging instruction, and debugging the corresponding target industrial control algorithm.
According to another aspect of the embodiments of the present application, there is also provided an industrial control algorithm debugging system, including: the system comprises a target simulation controller, equipment to be controlled and a processor, wherein the target simulation controller is used for acquiring bit number data of the equipment to be controlled and calculating the bit number data according to a target industrial control algorithm to obtain a target operation result, and the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished; the device to be controlled is used for receiving the output signal of the target simulation controller and sending bit number data to the target simulation controller; the processor is used for downloading a target industrial control algorithm to the target simulation controller; acquiring a target operation result generated by the target simulation controller operating a target industrial control algorithm; and displaying the target operation result to the target object, responding to the algorithm debugging instruction of the target object under the condition that the target operation result is inconsistent with the preset expected result, and debugging the target industrial control algorithm.
According to another aspect of the embodiments of the present application, there is also provided an industrial control algorithm debugging apparatus, including: the simulation configuration module is used for downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of the entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment; the result obtaining module is used for obtaining a target operation result generated by the target simulation controller operating the target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished; and the algorithm debugging module is used for displaying a target operation result to the target object, responding to an algorithm debugging instruction of the target object and debugging the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result, wherein the preset expected result is a result output by the operation target industrial control algorithm which is acquired in a planned mode.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, which includes a processor, where the processor is configured to execute a program, and the program executes an industrial control algorithm debugging method during execution.
According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored computer program, and the device in which the non-volatile storage medium is located executes the industrial control algorithm debugging method by running the computer program.
In the embodiment of the application, a target industrial control algorithm is downloaded to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment; obtaining a target operation result generated by the target simulation controller operating a target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished; the method comprises the steps of displaying a target operation result to a target object, responding to an algorithm debugging instruction of the target object and debugging a target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result, wherein the preset expected result is a mode of operating a result output by the target industrial control algorithm obtained by planning, a simulation development environment is established by using software to simulate a hardware environment, the industrial control algorithm can be verified and debugged without the help of the hardware environment, the purposes of reducing debugging optimization time and improving development and production efficiency are achieved, and the technical problem that the development and debugging efficiency of the industrial control algorithm is low because the development and debugging of the industrial control algorithm in the current industrial field must depend on the development and verification environment provided by a real controller and only can be detected by log output of the real controller is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a hardware structure block diagram of a computer terminal (or an electronic device) for implementing a method for debugging an industrial control algorithm according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a method flow for debugging an industrial control algorithm according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a method flow for algorithm development based on a simulation controller according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an industrial control algorithm debugging system provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of an architecture of an internal functional module of a target simulation controller according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an industrial control algorithm debugging device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to facilitate the understanding of the embodiments of the present application by those skilled in the art, some technical terms or terms related to the embodiments of the present application will be explained as follows:
integrated Development Environment (IDE): is an application program for providing a program development environment.
In the related art, the development and debugging of the industrial control algorithm highly depends on the development and verification environment provided by the entity controller, so that the problem of low development and debugging efficiency of the industrial control algorithm exists. In order to solve this problem, the embodiments of the present application provide related solutions, which are described in detail below.
In accordance with an embodiment of the subject application, there is provided a method embodiment for industrial control algorithm debugging, it being noted that the steps illustrated in the flowchart of the figure can be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described can be performed in an order different than presented herein.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Fig. 1 shows a hardware structure block diagram of a computer terminal (or an electronic device) for implementing an industrial control algorithm debugging method. As shown in fig. 1, the computer terminal 10 (or electronic device 10) may include one or more (shown as 102a, 102b, … …,102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or electronic device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the industrial control algorithm debugging method in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, so as to implement the industrial control algorithm debugging method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet via wireless.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or electronic device).
In the foregoing operating environment, an embodiment of the present application provides a method for debugging an industrial control algorithm, and fig. 2 is a schematic diagram of a process flow of the method for debugging the industrial control algorithm provided by the embodiment of the present application, as shown in fig. 2, the method includes the following steps:
step S202, downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment;
in some embodiments of the present application, downloading the target industrial control algorithm to the target simulation controller comprises: determining functional parameters and structural parameters of a target entity controller, wherein the target entity controller is an entity controller planning to apply a target industrial control algorithm; establishing a target simulation controller according to the functional parameters and the structural parameters; and acquiring a target industrial control algorithm in the integrated development environment, and configuring the target industrial control algorithm into a target simulation controller, wherein the integrated development environment is used for developing the target industrial control algorithm.
The target industrial control algorithm is an algorithm program for controlling each industrial device (e.g., industrial instrument) in an industrial production environment.
As an alternative embodiment, the target industrial control algorithm may be written by a technician (i.e., target object) in the integrated development environment IDE according to actual requirements.
Specifically, the IDE is remotely connected with the target simulation controller to compile an algorithm, the simulation controller integrates a cross compiling environment, technicians do not need to install a complex compiling environment, the technicians only need to compile related algorithms, and then the compiled target industrial control algorithm is downloaded to the target simulation controller through configuration software.
Step S204, obtaining a target operation result generated by the target simulation controller operating the target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished;
specifically, the target simulation controller schedules and operates according to the downloaded target industrial control algorithm to control the device to be controlled in the industrial production environment, and in some embodiments of the present application, the device to be controlled may be an entity device to be controlled in the industrial production environment or may be a virtual simulation device to be controlled in the system.
Step S206, displaying a target operation result to the target object, responding to an algorithm debugging instruction of the target object and debugging the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result, wherein the preset expected result is a result output by the operation target industrial control algorithm which is acquired in a planned mode.
Specifically, a technician can remotely debug the target industrial control algorithm through the IDE, modify the related codes, continue to download the target industrial control algorithm, and monitor the output result.
In order to improve the flexibility of algorithm debugging, the method for debugging the target industrial control algorithm in response to the algorithm debugging instruction of the target object comprises the following steps: determining a target debugging mode indicated by the algorithm debugging instruction, wherein the target debugging mode comprises at least one of the following modes: adding a debugging mode and starting the debugging mode; and debugging the target industrial control algorithm according to the target debugging mode.
In some embodiments of the present application, debugging a target industrial control algorithm in a target debugging mode comprises the steps of: determining a first operation result inconsistent with a preset expected result as an operation result to be corrected under the condition that the target debugging mode is an additional debugging mode; determining a code position for generating an operation result to be corrected in an industrial control algorithm; the method comprises the steps of showing a code position to a target object, responding to a breakpoint setting instruction of the target object, and setting a target breakpoint in a program code of a target industrial control algorithm, wherein the target breakpoint is used for enabling the target industrial control algorithm to be paused at the position of the target breakpoint when the target industrial control algorithm is operated; running a target industrial control algorithm containing target breakpoints to obtain a breakpoint running result; and displaying the breakpoint operation result to the target object, responding to the breakpoint debugging instruction of the target object, and debugging the target industrial control algorithm.
Specifically, in an additional debugging mode, a first operation result which is generated in the operation process of a target industrial control algorithm and does not accord with a preset expected result is determined; then, determining a code position of a code which generates the first operation result which does not accord with the preset expected result in the program code of the target industrial control algorithm; technical personnel can set target breakpoints in program codes of the target industrial control algorithm for debugging according to the first running result and the position information of the codes, which do not accord with the preset expected result, and can carry out single-step debugging (one step is carried out from the position of the last target breakpoint to the position of the next target breakpoint) when the program codes of the target industrial control algorithm with the target breakpoints are run.
In some embodiments of the present application, debugging the target industrial control algorithm in a target debugging mode further comprises the steps of: and under the condition that the target debugging mode is a starting debugging mode, debugging the target industrial control algorithm according to the algorithm debugging instruction.
Specifically, in the starting debugging mode, the program codes of the target industrial control algorithm are all executed at one time, and the final operation result is directly obtained.
The startup debugging is applicable to a scenario in which additional debugging cannot be applied, for example, a case in which a program is started up and crashed directly, so that debugging cannot be performed in time of being added to a corresponding program, and a scenario in which debugging is performed for a logic related to startup.
In order to enable technicians to better monitor the operation of the target industrial control algorithm, the method for determining the target debugging mode further comprises the following steps: determining a code module which generates a target operation result inconsistent with a preset expected result in a target industrial control algorithm under the condition that the target operation result is inconsistent with the preset expected result; and sending the target operation result inconsistent with the preset expected result and the code module to a front-end interface for displaying, and sending alarm information.
As an alternative embodiment, the real-time data is provided externally by means of standard protocols such as OPCUA, modbusTCPSlave, etc., so that the technician (target object) can monitor the data by relevant standard tools.
In some embodiments of the present application, the method further comprises: under the condition that a plurality of target industrial control algorithms exist, setting a target identifier for each target industrial control algorithm, and configuring the target identifiers and the target industrial control algorithms into a target simulation controller; acquiring a target operation result corresponding to a target industrial control algorithm according to the target identification; and under the condition that the target operation result is inconsistent with the preset expected result, responding to the algorithm debugging instruction, and debugging the corresponding target industrial control algorithm.
As an optional implementation, a sandbox isolation technology is adopted to realize independent operation of a single user program.
The industrial control algorithm debugging method in steps S202 to S206 of the embodiment of the present application is further described below.
Fig. 3 is a schematic diagram of a process flow of an algorithm development method based on a simulation controller according to an embodiment of the present application, and as shown in fig. 3, the method includes the following steps:
step S302, configuring a simulation controller, and downloading a target industrial control algorithm to the simulation controller;
specifically, a simulation controller corresponding to the function of the entity controller is built, the simulation controller is mounted on a host in a mirror image mode, hardware resources of the simulation controller are distributed (if no special requirement exists, the default is met), and the simulation controller is started; the method comprises the steps of installing related development IDE programming software on a host machine, remotely connecting a target simulation controller through an IDE to compile an algorithm, integrating a cross compiling environment into the simulation controller, needing no complex compiling environment to be installed by technicians, needing only to compile related algorithms by the technicians, and downloading the compiled target industrial control algorithm to the target simulation controller through configuration software.
In some embodiments of the present application, when a technician develops a target industrial control algorithm, the technician writes a corresponding optimization algorithm according to actual field requirements, and downloads the corresponding optimization algorithm to a simulation controller through configuration software, where the simulation controller is responsible for scheduling and running the algorithm and supports development using multiple programming languages, including but not limited to: C/C + +/Python algorithm development.
And step S304, operating the target industrial control algorithm in the simulation controller, and debugging the target industrial control algorithm according to the operation result.
Specifically, the target simulation controller schedules operation according to the downloaded target industrial control algorithm to control the equipment to be controlled in the industrial production environment; and monitoring whether the operation result of the target industrial control algorithm in the simulation controller reaches the expectation, if not, a technician can remotely debug the target industrial control algorithm through the IDE, modify the related codes, continuously download the target industrial control algorithm and monitor the output result.
In some embodiments of the present application, a scheduling engine in a simulation environment (i.e., a simulation controller) performs differentiated scheduling according to characteristics of programs of different target industrial control algorithms, and supports a hybrid scheduling mode of programming language algorithms such as C/C + +/Python.
Through the steps, a hardware environment is simulated by software, a simulation development environment is established, the industrial control algorithm can be verified and debugged without the help of the hardware environment, the aims of reducing debugging optimization time and improving development and production efficiency are fulfilled, and the technical problem that the development and debugging efficiency of the industrial control algorithm is low because the development and debugging of the industrial control algorithm in the current industrial field must depend on the development and verification environment provided by an entity controller and the running condition of the algorithm can only be detected through the log output of the entity controller is solved.
According to the embodiment of the application, the embodiment of the industrial control algorithm debugging device is further provided. Fig. 4 is a schematic structural diagram of an industrial control algorithm debugging system provided according to an embodiment of the present application. As shown in fig. 4, the system includes: a target simulation controller 40, a device to be controlled 42, a processor 44, wherein,
the target simulation controller 40 is configured to collect bit number data of the device to be controlled 42, and calculate the bit number data according to a target industrial control algorithm to obtain a target operation result, where the target operation result includes: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished;
a device to be controlled 42 for receiving an output signal of the target simulation controller 40 and transmitting bit number data to the target simulation controller 40;
a processor 44 for downloading a target industrial control algorithm into the target simulation controller 40; acquiring a target operation result generated by the target simulation controller 40 operating the target industrial control algorithm; and displaying a target operation result to the target object, and responding to an algorithm debugging instruction of the target object to debug the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result.
As further described below with respect to the target simulation controller 40, fig. 5 is a schematic structural diagram of internal functional modules of the target simulation controller according to an embodiment of the present disclosure, as shown in fig. 5, the target simulation controller 40 mainly includes three parts, a data acquisition module 50, an optimization calculation module 52, and a control output module 54, wherein,
the data acquisition module 50: the simulation system is responsible for real-time acquisition of simulation system bit number data, provides a data source for optimization calculation and stores, and currently supported standard industrial protocols include but are not limited to: and protocols such as Modbus TCP Slave and OPC UA.
The optimization calculation module 52: after the optimization algorithm (namely the target industrial control algorithm) is developed by technicians, the optimization algorithm is downloaded to the simulation controller through the configuration software, and the simulation controller provides an algorithm operation environment to support concurrent operation and millisecond response control.
The control output module 54: and outputting the result to the equipment to be controlled according to the result output by the target industrial control algorithm, thereby achieving the purpose of control.
The simulation development system solution is similar to the function of an entity controller and supports compiling and debugging, a more convenient and efficient algorithm debugging solution is provided for technical staff, for example, single step debugging is supported, global resources are checked, the problem can be solved more quickly, and the algorithm development debugging efficiency is improved.
According to the embodiment of the application, the embodiment of the industrial control algorithm debugging device is further provided. Fig. 6 is a schematic structural diagram of an industrial control algorithm debugging device according to an embodiment of the present application. As shown in fig. 6, the apparatus includes:
the simulation configuration module is used for downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of the entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment;
the result obtaining module is used for obtaining a target operation result generated by the target simulation controller operating the target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished;
and the algorithm debugging module is used for displaying a target operation result to the target object, responding to an algorithm debugging instruction of the target object and debugging the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result, wherein the preset expected result is a result output by the operation target industrial control algorithm which is acquired in a planned mode.
It should be noted that, each module in the industrial control algorithm debugging apparatus may be a program module (for example, a program instruction set for implementing a certain specific function), or may also be a hardware module, and in the latter case, it may be represented in the following form, but is not limited thereto: the above modules are all represented by one processor, or the functions of the above modules are realized by one processor.
It should be noted that the industrial control algorithm debugging apparatus provided in the present embodiment can be used to execute the industrial control algorithm debugging method shown in fig. 2, and therefore, the related explanation of the industrial control algorithm debugging method is also applicable to the embodiment of the present application, and is not described herein again.
The embodiment of the application also provides a nonvolatile storage medium, wherein the nonvolatile storage medium comprises a stored computer program, and the device where the nonvolatile storage medium is located executes the following industrial control algorithm debugging method by running the computer program: downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment; obtaining a target operation result generated by the target simulation controller operating a target industrial control algorithm, wherein the target operation result comprises: the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after the operation of all the target industrial control algorithms is finished; and under the condition that the target operation result is inconsistent with a preset expected result, responding to an algorithm debugging instruction of the target object, and debugging the target industrial control algorithm, wherein the preset expected result is a result output by the operation target industrial control algorithm which is obtained in a planned mode.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. An industrial control algorithm debugging method is characterized by comprising the following steps:
downloading a target industrial control algorithm to a target simulation controller, wherein the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment;
obtaining a target operation result generated by the target simulation controller operating the target industrial control algorithm, wherein the target operation result comprises: a first operation result and a second operation result, wherein the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after all the operation of the target industrial control algorithm is finished;
and under the condition that the target operation result is inconsistent with a preset expected result, responding to an algorithm debugging instruction of the target object, and debugging the target industrial control algorithm, wherein the preset expected result is a result which is obtained by planning and output by operating the target industrial control algorithm.
2. The industrial control algorithm debugging method of claim 1, wherein debugging the target industrial control algorithm in response to the algorithm debugging instructions of the target object comprises:
determining a target debugging mode indicated by the algorithm debugging instruction, wherein the target debugging mode comprises at least one of the following modes: adding a debugging mode and starting the debugging mode;
and debugging the target industrial control algorithm according to the target debugging mode.
3. The industrial control algorithm debugging method of claim 2, wherein debugging the target industrial control algorithm in the target debugging mode comprises:
determining the first operation result inconsistent with the preset expected result as an operation result to be corrected under the condition that the target debugging mode is the additional debugging mode;
determining a code position for generating the operation result to be corrected in the target industrial control algorithm;
displaying the code position to a target object, responding to a breakpoint setting instruction of the target object, and setting a target breakpoint in a program code of the target industrial control algorithm, wherein the target breakpoint is used for enabling the target industrial control algorithm to be paused at the position of the target breakpoint when the target industrial control algorithm is running;
running the target industrial control algorithm containing the target breakpoint to obtain a breakpoint running result;
and displaying the breakpoint operation result to a target object, responding to a breakpoint debugging instruction of the target object, and debugging the target industrial control algorithm.
4. The industrial control algorithm debugging method of claim 2, wherein debugging the target industrial control algorithm in the target debugging mode comprises:
and debugging the target industrial control algorithm according to the algorithm debugging instruction under the condition that the target debugging mode is the starting debugging mode.
5. The industrial control algorithm debugging method of claim 2, wherein determining the target debugging mode further comprises:
determining a code module which generates a target operation result inconsistent with the preset expected result in the target industrial control algorithm under the condition that the target operation result is inconsistent with the preset expected result;
and sending the target operation result inconsistent with the preset expected result and the code module to a front-end interface for displaying, and sending alarm information.
6. The industrial control algorithm debugging method of claim 1, wherein downloading the target industrial control algorithm into the target simulation controller comprises:
determining functional parameters and structural parameters of a target entity controller, wherein the target entity controller is an entity controller planned to apply the target industrial control algorithm;
establishing the target simulation controller according to the functional parameters and the structural parameters;
and acquiring the target industrial control algorithm in an integrated development environment, and configuring the target industrial control algorithm into a target simulation controller, wherein the integrated development environment is used for developing the target industrial control algorithm.
7. The industrial control algorithm debugging method of claim 1, further comprising:
under the condition that a plurality of target industrial control algorithms exist, setting a target identifier for each target industrial control algorithm, and configuring the target identifiers and the target industrial control algorithms into the target simulation controller;
acquiring a target operation result corresponding to the target industrial control algorithm according to the target identification;
and under the condition that the target operation result is inconsistent with a preset expected result, responding to an algorithm debugging instruction, and debugging the corresponding target industrial control algorithm.
8. An industrial control algorithm debugging system, comprising: a target simulation controller, a device to be controlled, and a processor, wherein,
the target simulation controller is configured to acquire bit number data of the device to be controlled, and calculate the bit number data according to the target industrial control algorithm to obtain the target operation result, where the target operation result includes: a first operation result and a second operation result, wherein the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after all the operation of the target industrial control algorithm is finished;
the device to be controlled is used for receiving the output signal of the target simulation controller and sending the bit number data to the target simulation controller;
the processor is used for downloading a target industrial control algorithm to the target simulation controller; acquiring a target operation result generated by the target simulation controller operating the target industrial control algorithm; and displaying the target operation result to a target object, and responding to an algorithm debugging instruction of the target object to debug the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result.
9. An industrial control algorithm debugging device, comprising:
the system comprises a simulation configuration module, a target simulation controller and a control module, wherein the simulation configuration module is used for downloading a target industrial control algorithm to the target simulation controller, the target simulation controller is a program module with the function consistent with that of an entity controller, and the entity controller is equipment for controlling equipment to be controlled in an industrial production environment;
a result obtaining module, configured to obtain a target operation result generated by the target simulation controller operating the target industrial control algorithm, where the target operation result includes: a first operation result and a second operation result, wherein the first operation result is an output result generated in the operation process of the target industrial control algorithm, and the second operation result is an output result generated after all the operation of the target industrial control algorithm is finished;
and the algorithm debugging module is used for displaying the target operation result to a target object, responding to an algorithm debugging instruction of the target object and debugging the target industrial control algorithm under the condition that the target operation result is inconsistent with a preset expected result, wherein the preset expected result is a result which is obtained by planning and is output by operating the target industrial control algorithm.
10. An electronic device comprising a processor, wherein the processor is configured to execute a program, and wherein the program executes to perform the industrial control algorithm debugging method of any one of claims 1-7.
11. A non-volatile storage medium, comprising a stored computer program, wherein a device on which the non-volatile storage medium is located executes the industrial control algorithm debugging method according to any one of claims 1 to 7 by running the computer program.
CN202211491326.XA 2022-11-25 2022-11-25 Industrial control algorithm debugging method, system and device and electronic equipment Pending CN115793582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211491326.XA CN115793582A (en) 2022-11-25 2022-11-25 Industrial control algorithm debugging method, system and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211491326.XA CN115793582A (en) 2022-11-25 2022-11-25 Industrial control algorithm debugging method, system and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115793582A true CN115793582A (en) 2023-03-14

Family

ID=85441543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211491326.XA Pending CN115793582A (en) 2022-11-25 2022-11-25 Industrial control algorithm debugging method, system and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115793582A (en)

Similar Documents

Publication Publication Date Title
CN104281520B (en) Tracking and method, the apparatus and system of debugging
CN112270149A (en) Verification platform automation integration method and system, electronic equipment and storage medium
CN104125504A (en) Deployment method, device and system based on continuous integration
EP4390673A1 (en) Ecu upgrade method and device, and readable storage medium
CN114138644A (en) BMC (baseboard management controller) debugging method, monitoring method, system, device, equipment and medium
KR101323937B1 (en) A simulation system of communication between HMI simulator and PLC simulator
CN114328223A (en) Information testing method, device, equipment and storage medium
CN110209565A (en) A kind of metadata schema adjustment method and its device
CN112162919A (en) Debugging method and system for vehicle-mounted equipment and computer readable storage medium
CN108536586B (en) Information acquisition method, equipment and system of Android mobile terminal
CN115793582A (en) Industrial control algorithm debugging method, system and device and electronic equipment
CN112241356A (en) Page testing method, device, equipment and storage medium
US9798649B1 (en) Debugging code controlling resource-constrained intelligent devices contemporaneously with executing object code
CN115080113A (en) Item code detection method and device, readable storage medium and electronic equipment
CN109002309A (en) A kind of HardwareUpgring method and relevant apparatus
CN111813702B (en) Debugging system, debugging method, device, and computer-readable storage medium
CN112306845B (en) Concurrency test method, concurrency test device, concurrency test equipment and concurrency test medium
CN114741273A (en) Remote real mobile terminal testing method, device, storage medium and equipment
CN114579131A (en) Method, device and system for acquiring hardware performance data
CN112527571A (en) CPU instruction set coverage rate calculation method and device
CN111352802A (en) Monitoring processing method, device, equipment and storage medium of network bus
CN112199270A (en) Program testing method, device, equipment and medium
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN117376229B (en) FTP file system software cross debugging method and system based on embedded equipment
CN110188491B (en) Processing method and device for improving calculation efficiency in simulation calculation process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination