Program debugging method and system, storage medium and equipment

By exporting the debugging project in the industrial software platform and debugging in a separate debugging tool, the safety risks in the process of program debugging test and verification in the rail transit field are solved, and the effect of improving program debugging safety is achieved.

CN120045441APending Publication Date: 2025-05-27CRRC ZHUZHOU ELECTRIC LOCOMOTIVE RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311559284.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In the field of rail transit, there are safety risks during the process of program adjustment and verification, and after-sales personnel may accidentally modify the program code due to misoperation, resulting in program errors.

Method used

Provides a program debugging method, exports debugging projects through programming tools in industrial software platforms and imports them into separate debugging tools for debugging. The method includes importing the debug plug-in into the programming tool to obtain the compilation environment information, parsing and extracting the program information, generating a debugging project, and completing the debugging steps of the program information through the debugging tool.

Benefits of technology

Program debugging is completed through a separate debugging tool, hiding the program source code, avoiding the underlying code error caused by human errors, and improving the security during program debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045441A_ABST
    Figure CN120045441A_ABST
Patent Text Reader

Abstract

The invention provides a program debugging method and system, a storage medium and equipment. The method comprises the following steps: importing a debugging plug-in into a programming tool to obtain compiling environment information of the programming tool; analyzing the compiling environment information and extracting program information in the programming tool; generating a debugging project based on the program information; the debugging project is imported into the debugging tool through the programming tool; and finishing a debugging step of the program information by utilizing the debugging tool. The method has the effect of high safety in the program debugging process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial software platforms, and particularly relates to a program debugging method, system, storage medium and device. Background Art

[0002] In the field of rail transit, after a program developer completes the development of a target program using a development tool, it is usually necessary for after-sales personnel to go to the site where the target device that needs to apply the target program is located, and import the target program into the target device for debugging and verification. After-sales personnel usually also use development tools during the debugging and verification process. This method has some problems. First, when using a development tool for debugging, after-sales personnel can see the program source code, which poses a threat to the confidentiality of the code. In addition, using a development tool for debugging also has security risks, because after-sales personnel may accidentally modify the program code due to misoperation, resulting in program errors. Summary of the Invention

[0003] The present invention provides a program debugging method, system, storage medium and device to solve the problem of relatively high security risks during the program debugging and verification process.

[0004] In a first aspect, the present invention provides a program debugging method, which is applied to an industrial software platform. The industrial software platform includes a programming tool and a debugging tool. The method includes the following steps:

[0005] Import a debugging plugin into the programming tool to obtain the compilation environment information of the programming tool;

[0006] Analyze the compilation environment information and extract the program information in the programming tool. The program information includes program function blocks and program variables;

[0007] Generate a debugging project based on the program information;

[0008] Import the debugging project into the debugging tool through the programming tool;

[0009] Use the debugging tool to complete the debugging steps of the program information.

[0010] Optionally, the generating a debugging project based on the program information includes the following steps:

[0011] Obtain a user instruction through the user interface of the programming tool;

[0012] Select the target program function blocks and target program variables to be exported according to the user instruction;

[0013] Serialize the target program function blocks and the target program variables into a byte stream;

[0014] Encrypt the byte stream to obtain a debug project in binary format.

[0015] Optionally, the industrial software platform further includes a controller. The step of importing the debug project into the debug tool through the programming tool includes the following steps:

[0016] Generate debug object code through the programming tool and based on the debug project;

[0017] Download the debug project and the debug object code into the controller through the programming tool;

[0018] Establish a connection between the debug tool and the controller;

[0019] Use the controller and based on the debug object code to import the debug project into the debug tool.

[0020] Optionally, the debug steps include any one or more of the steps of program display and modification, program and variable monitoring, waveform tracking, variable forcing, and data storage.

[0021] In a second aspect, the present invention further provides a program debugging system applied to an industrial software platform. The industrial software platform includes a programming tool and a debug tool. The system includes:

[0022] A plug-in import module for importing a debug plug-in into the programming tool to obtain the compilation environment information of the programming tool;

[0023] An environment parsing module for parsing the compilation environment information and extracting the program information in the programming tool. The program information includes program function blocks and program variables;

[0024] A project generation module for generating a debug project based on the program information;

[0025] A project import module for importing the debug project into the debug tool through the programming tool;

[0026] A program debugging module for using the debug tool to complete the debug steps of the program information.

[0027] Optionally, the project generation module includes:

[0028] An instruction acquisition unit for acquiring user instructions through the user interface of the programming tool;

[0029] A data selection unit for selecting target program function blocks and target program variables to be exported according to the user instructions;

[0030] A data conversion unit for serializing the target program function block and the target program variables into a byte stream;

[0031] A data encryption unit for encrypting the byte stream to obtain a debug project in binary format.

[0032] Optionally, the industrial software platform further includes a controller, and the project import module includes:

[0033] A target code generation unit for generating a debug target code through the programming tool and based on the debug project;

[0034] A project loading unit for downloading the debug project and the debug target code into the controller through the programming tool;

[0035] A tool connection unit for establishing a connection between the debug tool and the controller;

[0036] A project import unit for importing the debug project into the debug tool by using the controller and based on the debug target code.

[0037] Optionally, the debug steps include any one or more of a program display and modification step, a program and variable monitoring step, a waveform tracking step, a variable forcing step, and a data storage step.

[0038] In a third aspect, the present invention further provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, the processor is configured to execute the program debugging method described in the first aspect.

[0039] In a fourth aspect, the present invention further provides a program debugging device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the program debugging method described in the first aspect is implemented.

[0040] The beneficial effects of the present invention are:

[0041] The program debugging process is completed through a set of separate debug tools. The debug project of the debug tool is exported by the programming tool. When exporting the project, the programming tool can select the program function blocks and variables to be debugged, so as to perform debug operations such as detecting, forcing, displaying, and storing variables. Compared with the after-sales debug personnel directly using the programming tool for debugging, only the program function blocks and variables can be given to the debug personnel for operation, which can not only hide the program source code but also prevent the underlying code from being accidentally modified due to human errors, improving the security during the program debugging process. Description of the Drawings

[0042] Figure 1 This is a schematic flowchart of the program debugging method in the present invention.

[0043] Figure 2 This is a schematic data flow diagram of importing a debugging project into a debugging tool in the present invention.

[0044] Figure 3 This is a schematic diagram of the steps of program debugging in the present invention. Detailed implementation manner

[0045] The present invention discloses a program debugging method, which is applied to an industrial software platform. The industrial software platform is specifically an industrial control program integrated development platform, which includes a development layer and a service layer. The development layer is used to develop device programs for target devices, and the service layer is used to provide underlying service programs to realize communication and interaction between the development layer and the target devices. The development layer includes a configuration tool, a programming tool, and a debugging tool, wherein:

[0046] The configuration tool is used to generate a system configuration, which includes a network topology configuration, a device configuration, and a device variable configuration. The configuration tool shares the generated system configuration to the programming tool;

[0047] The programming tool is used to provide an algorithm library, a function block library, and a driving bus for interacting with devices. By importing the system configuration generated by the configuration tool, program variables of the device program are generated and the bus configuration of the driving bus is configured. The programming tool shares the program variables to the debugging tool;

[0048] The debugging tool is used to monitor program variables based on the limitations of the system configuration and forcibly adjust program variables.

[0049] In this embodiment, the industrial control program integrated development platform provides various development tools for developing device programs, such as a configuration tool, a programming tool, and a debugging tool, etc. The service layer mainly provides auxiliary development services and programs supporting the development tools. Among them, the configuration tool is mainly used to generate a system configuration, that is, a large amount of configuration information included in the device program, including network topology configuration, device configuration, and device variable configuration, etc.

[0050] The network topology settings specifically include the device connection method, device IP address, device communication protocol, etc. The device connection method specifically refers to configuring the connection method between devices, such as Ethernet, serial port, etc. The device IP address specifically assigns a unique IP address to each target device for network communication. The device communication protocol is the communication protocol between devices, such as Modbus, OPC UA, etc. Device configuration mainly includes device type, device parameters, device variables, etc. The device type is mainly used to select the type of target device, such as PLC, sensor, actuator, etc. The device parameters are to configure the parameters of the target device, such as sampling frequency, communication rate, range of input and output signals, etc. The device variable configuration can define the variables of the target device, such as temperature, pressure, speed, etc. Since development tools such as configuration tools, programming tools, and debugging tools are all integrated into the underlying framework, such as the codesys underlying framework, data interaction and sharing can be carried out arbitrarily between each module, thus realizing the interconnection and interoperability between tools, and the configuration tool can also share the generated system configuration to the programming tool.

[0051] The programming tool supports the development of device programs in IEC61131-3 language, C language, and C++ language. The programming tool can also provide an algorithm library, a function block library, and a drive bus. Among them, the algorithm library refers to a set of commonly used algorithm functions or algorithm modules provided in the industrial control program integrated development platform for processing and analyzing device data. For example:

[0052] PID control algorithm: used to implement closed-loop control and adjust the control output according to the data fed back by the device.

[0053] Filtering algorithm: used to smooth the device data and remove noise and interference.

[0054] Data processing algorithm: used to perform statistical analysis, trend prediction, etc. on device data.

[0055] The function block library refers to a set of commonly used function blocks provided in the industrial control program integrated development platform for combining and implementing control programs. For example:

[0056] Logic function block: including logic operation function blocks such as AND gate, OR gate, NOT gate, etc., used to implement logical judgment and conditional control.

[0057] Mathematical function block: including mathematical operation function blocks such as addition, subtraction, multiplication, division, etc., used to perform numerical calculation and data processing.

[0058] Timing function block: used to set function blocks triggered by timing, such as timing start, timing stop, etc.

[0059] Refer to Figure 1 , Figure 1It is a schematic flowchart of a program debugging method in an embodiment. It should be understood that although Figure 1 each step in the flowchart is shown in sequence according to the arrow indication, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 1 at least a part of the steps in

[0060] can include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps. Figure 1 As shown in

[0061] S101. Import the debugging plug-in into the programming tool to obtain the compilation environment information of the programming tool.

[0062] Among them, the program information is saved in the metaobject of each project. There is a function call statement preset in the debugging plug-in, such as:

[0063] APEnvironment.LanguageModelMgr.GetCompileContext();

[0064] Therefore, the plug-in manager can be opened in the programming tool, and the downloaded debugging plug-in can be imported. The plug-in manager will automatically install and integrate the debugging plug-in into the programming tool. Finally, the compilation environment information can be obtained through the interface of the plug-in and through the function call statement. The compilation environment information contains all symbol information ISignature, and each ISignature contains all information of a group of variables.

[0065] S102. Analyze the compilation environment information and extract the program information in the programming tool.

[0066] Among them, the program information includes program function blocks and program variables. Using the API or command-line tool provided by the programming tool, the compilation environment information can be analyzed and the program information can be extracted. The programming tool usually provides some functions or tools to analyze the source code, identify program function blocks and variables. By calling these functions or using these tools, the source code can be parsed into an abstract syntax tree (AST) or other suitable data structures to represent the structure and elements of the program.

[0067] S103. Generate a debugging project based on the program information.

[0068] Among them, by using the API or command-line tool provided by the programming tool, a debugging project can be generated using program information. The debugging project includes program code, program variables, and some program management information (such as project name, etc.). The properties of the debugging project can be configured as needed, such as breakpoint settings, debugging options, etc.

[0069] S104. Import the debugging project into the debugging tool through the programming tool.

[0070] S105. Use the debugging tool to complete the debugging steps of the program information.

[0071] The implementation principle of this embodiment is as follows:

[0072] The program debugging process is completed through a set of separate debugging tools. The debugging project of the debugging tool is exported by the programming tool. When exporting the project, the programming tool can select the program function blocks and variables to be debugged, so as to perform debugging operations such as detecting, forcing, displaying, and storing variables. Compared with the after-sales debugger directly using the programming tool for debugging, only the program function blocks and variables can be given to the debugger for operation, which can not only hide the program source code, but also prevent the underlying code from being accidentally modified due to human error, improving the security during the program debugging process.

[0073] In one of the embodiments, step S103 specifically includes the following steps:

[0074] Obtain user instructions through the user interface of the programming tool;

[0075] Select the target program function blocks and target program variables to be exported according to the user instructions;

[0076] Serialize the target program function blocks and target program variables into a byte stream;

[0077] Perform encryption processing on the byte stream to obtain a debugging project in binary format.

[0078] In this embodiment, the programming tool can provide an interactive interface through which the user can input instructions. The user can interact with the programming tool through a command-line interface, a graphical interface, or other forms of interfaces. The user instructions can be some specific commands or options for specifying the target program function blocks and target program variables to be exported.

[0079] For example, the user input user instruction is: export -f func1 func2 -v var1 var2

[0080] In the above example, the user specifies the target program function blocks (func1, func2) and target program variables (var1, var2) to be exported by inputting the export command and corresponding options.

[0081] According to the options and parameters in the user instruction, the programming tool can parse and determine the target program function blocks and target program variables to be exported. The corresponding target program function blocks and target program variables can be selected according to the information such as the function name and variable name specified by the user. The programming tool can convert the target program function blocks and target program variables into the form of byte streams for subsequent processing and transmission. Serialization can be completed using the serialization library or algorithm provided by the programming tool.

[0082] For example, serialize the target program function block into a byte stream: 0x12 0x34 0x56 0x78;

[0083] Serialize the target program variable into a byte stream: 0xAB 0xCD 0xEF 0x01;

[0084] After serialization, the programming tool can use an encryption algorithm to encrypt the serialized byte stream to protect the security of the debugging project. Encryption can be completed using a symmetric encryption algorithm or an asymmetric encryption algorithm.

[0085] For example, the byte stream before encryption: 0x12 0x34 0x56 0x78 0xAB 0xCD 0xEF 0x01;

[0086] The byte stream after encryption: 0x9A 0x2B 0x5C 0x7D 0x8F 0xE0 0x13 0x24.

[0087] In one implementation, the industrial software platform further includes a controller, and step S104 specifically includes the following steps:

[0088] Generate debug target code through the programming tool and based on the debugging project;

[0089] Download the debugging project and the debug target code into the controller through the programming tool;

[0090] Establish a connection between the debugging tool and the controller;

[0091] Use the controller and based on the debug target code, import the debugging project into the debugging tool.

[0092] In this implementation, refer to Figure 2, the debug object code generated by the programming tool is downloaded to the controller. At the same time, the programming tool exports the debug project, which can be saved on the PC and opened manually through the debug tool. The debug project can also be downloaded to the controller through the programming tool. After the debug tool is connected to the controller, it can automatically open the debug project. The debug project includes program code, program variables, and some program management information (such as project name, etc.). When the debug tool is connected to the controller, variable interaction and viewing of the program execution flow can be performed. In another implementation, as Figure 2 shown, the debug tool can also directly open the debug project through the programming tool.

[0093] In one of the implementation manners, referring to Figure 3 , the debug steps include any one or more of the steps of program display and modification, program and variable monitoring, waveform tracking, variable forcing, and data storage. Specifically as follows:

[0094] Program display and modification: After opening the program through the debug tool, the program can be modified;

[0095] Program and variable monitoring: The debug project file exported by the programming tool carries the address information of variables and programs in the controller. The debug program can obtain the variables in the controller through the address information for monitoring;

[0096] Variable forcing: The variable forcing function can be realized. After variable forcing, the data in the program logic will not be overwritten, and the forced value will be maintained;

[0097] Waveform tracking: The program data in the controller can be taken out and displayed in waveform;

[0098] Data storage: After obtaining the program data in the controller, it can be saved on the PC for viewing.

[0099] The present invention also discloses a program debugging system, which is applied to an industrial software platform. The industrial software platform includes a programming tool and a debug tool. The system includes:

[0100] A plug-in import module, which is used to import a debug plug-in into the programming tool to obtain the compilation environment information of the programming tool;

[0101] An environment parsing module, which is used to parse the compilation environment information and extract the program information in the programming tool. The program information includes program function blocks and program variables;

[0102] A project generation module, which is used to generate a debug project based on the program information;

[0103] A project import module, which is used to import the debug project into the debug tool through the programming tool;

[0104] The program debugging module is used to complete the debugging steps of program information by using a debugging tool.

[0105] The implementation principle of this embodiment is as follows:

[0106] Through the program executed by the above modules, the program debugging process can be completed by using a set of separate debugging tools. The debugging project of the debugging tool is exported by the programming tool. When exporting the project, the programming tool can select the program function blocks and variables to be debugged, so as to perform debugging operations such as detecting, forcing, displaying, and storing variables. Compared with the after-sales debugger directly using the programming tool for debugging, only the program function blocks and variables can be given to the debugger for operation, which can not only hide the program source code, but also prevent the underlying code from being accidentally modified due to human errors, improving the security during the program debugging process.

[0107] In one of the embodiments, the project generation module includes:

[0108] An instruction acquisition unit for acquiring user instructions through the user interface of the programming tool;

[0109] A data selection unit for selecting target program function blocks and target program variables to be exported according to the user instructions;

[0110] A data conversion unit for serializing the target program function blocks and target program variables into a byte stream;

[0111] A data encryption unit for encrypting the byte stream to obtain a debugging project in binary format.

[0112] In one of the embodiments, the industrial software platform further includes a controller, and the project import module includes:

[0113] A target code generation unit for generating a debugging target code through the programming tool based on the debugging project;

[0114] A project loading unit for downloading the debugging project and the debugging target code into the controller through the programming tool;

[0115] A tool connection unit for establishing a connection between the debugging tool and the controller;

[0116] A project import unit for importing the debugging project into the debugging tool by using the controller based on the debugging target code.

[0117] In one of the embodiments, the debugging steps include any one or more of the steps of program display and modification, program and variable monitoring, waveform tracking, variable forcing, and data storage.

[0118] The present invention also discloses a computer-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the program debugging method described in any of the above embodiments.

[0119] Among them, the computer program can be stored in a computer-readable storage medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some middleware form, etc. The computer-readable storage medium includes any entity or device, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the computer-readable storage medium includes, but is not limited to, the above components.

[0120] Among them, through this machine-readable storage medium, the program debugging method in the above embodiments is stored in the machine-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above method.

[0121] The embodiments of the present application also disclose a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, the program debugging method in the above embodiments is adopted.

[0122] Among them, the computer device can be a desktop computer, a laptop computer or a cloud server, etc. And the computer device includes, but is not limited to, a processor and a memory. For example, the computer device may also include input / output devices, network access devices, and a bus, etc.

[0123] Among them, the processor can adopt a central processing unit (CPU). Of course, according to the actual usage situation, other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc. The present application does not make any restrictions on this.

[0124] Among them, the memory can be an internal storage unit of the computer device, for example, the hard disk or memory of the computer device, or can be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital card (SD), or a flash card (FC), etc. equipped on the computer device. Moreover, the memory can also be a combination of the internal storage unit and the external storage device of the computer device. The memory is used to store computer programs and other programs and data required by the computer device, and can also be used to temporarily store data that has been output or will be output. This application does not limit this.

[0125] Among them, through this computer device, the program debugging method in the above embodiment is stored in the memory of the computer device, and is loaded and executed on the processor of the computer device for convenient use.

[0126] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0127] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0128] These computer program instructions can also be stored in a machine-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the machine-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0129] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 steps of the functions specified in one block or multiple blocks.

[0130] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0131] The memory may include non-permanent memory in the computer-readable storage medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable storage medium.

[0132] Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be machine-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media do not include transitory media, such as modulated data signals and carrier waves.

[0133] It should also be noted that the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, commodity or device including the element.

[0134] The present invention also discloses a program debugging device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the program debugging method described in any of the above embodiments is implemented.

[0135] Among them, the above-mentioned plug-in import module, environment parsing module, project generation module, project import module, program debugging module, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions. The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.

[0136] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the protection scope of the present application is limited to these examples; under the idea of the present application, the technical features in the above embodiments or different embodiments can also be combined, and the steps can be implemented in any order, and there are many other variations in different aspects of one or more embodiments in the present application as above, and they are not provided in detail for the sake of brevity.

[0137] One or more embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the present application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application shall be included in the protection scope of the present application.

Claims

1. A program debugging method, characterized in that, applied to an industrial software platform, the industrial software platform includes a programming tool and a debugging tool, and the method includes the following steps: Import a debugging plugin into the programming tool to obtain the compilation environment information of the programming tool; Analyze the compilation environment information and extract the program information in the programming tool, where the program information includes program function blocks and program variables; Generate a debugging project based on the program information; Import the debugging project into the debugging tool through the programming tool; Use the debugging tool to complete the debugging steps of the program information.

2. The program debugging method according to claim 1, characterized in that, The generating a debugging project based on the program information includes the following steps: Obtain a user instruction through the user interface of the programming tool; Select the target program function blocks and target program variables to be exported according to the user instruction; Serialize the target program function blocks and the target program variables into a byte stream; Perform encryption processing on the byte stream to obtain a debugging project in binary format.

3. The program debugging method according to claim 1, characterized in that, The industrial software platform further includes a controller, and the importing the debugging project into the debugging tool through the programming tool includes the following steps: Generate a debugging target code through the programming tool and based on the debugging project; Download the debugging project and the debugging target code into the controller through the programming tool; Establish a connection between the debugging tool and the controller; Use the controller and based on the debugging target code to import the debugging project into the debugging tool.

4. The program debugging method according to claim 1, characterized in that, The debugging steps include any one or more of a program display and modification step, a program and variable monitoring step, a waveform tracking step, a variable forcing step, and a data storage step.

5. A program debugging system, characterized in that, applied to an industrial software platform, the industrial software platform includes a programming tool and a debugging tool, and the system includes: A plugin import module for importing a debugging plugin into the programming tool to obtain the compilation environment information of the programming tool; An environment analysis module for analyzing the compilation environment information and extracting the program information in the programming tool, where the program information includes program function blocks and program variables; A project generation module for generating a debugging project based on the program information; A project import module for importing the debugging project into the debugging tool through the programming tool; A program debugging module for using the debugging tool to complete the debugging steps of the program information.

6. The program debugging system according to claim 5, characterized in that, The project generation module includes: An instruction acquisition unit for obtaining a user instruction through the user interface of the programming tool; A data selection unit for selecting the target program function blocks and target program variables to be exported according to the user instruction; A data conversion unit for serializing the target program function blocks and the target program variables into a byte stream; A data encryption unit for encrypting the byte stream to obtain a debug project in binary format.

7. The program debugging system according to claim 5, wherein, the industrial software platform further includes a controller, and the project import module includes: A target code generation unit for generating a debug target code through the programming tool based on the debug project; A project loading unit for downloading the debug project and the debug target code into the controller through the programming tool; A tool connection unit for establishing a connection between the debug tool and the controller; A project import unit for importing the debug project into the debug tool by using the controller based on the debug target code.

8. The program debugging system according to claim 5, wherein, the debugging steps include any one or more of a program display and modification step, a program and variable monitoring step, a waveform tracking step, a variable forcing step, and a data storage step.

9. A computer-readable storage medium having instructions stored thereon, wherein, when the instructions are executed by a processor, the processor is configured to execute the program debugging method according to any one of claims 1 to 4.

10. A program debugging device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the computer program, the program debugging method according to any one of claims 1 to 4 is implemented.