Variable monitoring method and device, equipment, storage medium and program product

By obtaining and adding variable monitoring interfaces in the industrial control system, real-time monitoring of the lower computer program variables is achieved, and the problem of real-time monitoring in the existing technology is solved, which improves the flexibility and program stability of variable monitoring.

CN119201721APending Publication Date: 2024-12-27HYGON INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411290186.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The existing variable monitoring methods require the application to be paused during the debugging process, and the real-time monitoring of the program's running status cannot be achieved, reducing the flexibility of variable monitoring.

Method used

By obtaining the initial program code of the target task, determining the variable monitoring interface based on the serialization library and program variables in the target programming language, and adding it to the initial program code, controlling the computer to run the target program code, and calling the variables during the run The monitoring interface performs real-time monitoring to realize real-time monitoring of program variables.

Benefits of technology

It improves the flexibility of variable monitoring and the stability of program code, allowing program variables to be monitored in real time without stopping the program running, and enhances the reliability and reliability of operation and maintenance personnel to the program operation status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201721A_ABST
    Figure CN119201721A_ABST
Patent Text Reader

Abstract

The invention relates to a variable monitoring method and device, equipment, a storage medium and a program product. The method comprises the steps that an initial program code corresponding to a target task is obtained, a variable monitoring interface corresponding to the initial program code is determined according to a serialization library under a target programming language and a program variable in the initial program code, the target programming language is a programming language for writing the initial program code, and the target programming language is a programming language for writing the target program code; the variable monitoring interface is added to the initial program code to obtain a target program code, the lower computer is controlled to run the target program code, and in the process of running the target program code, the variable monitoring interface is called to monitor the program variable in real time. By adopting the method, the flexibility of variable monitoring can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial control technology, and in particular to a variable monitoring method, device, equipment, storage medium and program product. Background Art

[0002] In industrial control systems, the host computer is responsible for developing applications, and the slave computer is responsible for running the applications developed by the host computer. In order to monitor the running of applications on the slave computer, variable monitoring methods have emerged. Existing variable monitoring methods generally perform breakpoint debugging on applications through debugging protocols, that is, when the application is interrupted, the variable information in the application is sent to the host computer.

[0003] However, the existing variable monitoring method needs to pause the application during the debugging process, which cannot realize real-time monitoring of the program running status, reducing the flexibility of variable monitoring. Summary of the invention

[0004] Based on this, it is necessary to provide a variable monitoring method, device, equipment, storage medium and program product that can improve the flexibility of variable monitoring in response to the above technical problems.

[0005] In a first aspect, the present application provides a variable monitoring method, comprising:

[0006] Obtain the initial program code corresponding to the target task;

[0007] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0008] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0009] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0010] In an embodiment of the present application, on the one hand, by adding a variable monitoring interface based on a serialization library and configuration, and adding the variable monitoring interface to the initial program code, the host computer can monitor the program variables in real time by calling the variable monitoring interface, thereby improving the flexibility of variable monitoring; on the other hand, since real-time monitoring of program variables can be achieved without stopping the running of the target program code, the stability of the running of the target program code can be guaranteed.

[0011] In one embodiment, determining a variable monitoring interface corresponding to the initial program code according to a serialization library in a target programming language and program variables in the initial program code includes:

[0012] Based on the structural characteristics of the target programming language, program variables are extracted from the initial program code; the serialization library under the target programming language is used to process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0013] In the embodiment of the present application, by extracting program variables from the initial program code based on the structural features of the target programming language, the accuracy of determining the program variables can be ensured, thereby ensuring the accuracy of the determined variable monitoring interface.

[0014] In one embodiment, the lower computer is controlled to run the target program code, and during the running of the target program code, a variable monitoring interface is called to monitor the program variables in real time, including:

[0015] Send a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; in the process of the lower computer running the target program code, send a variable acquisition request to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate the serialization information of the program variables at the current moment according to the running data of the target program code; obtain the serialization information of the program variables at the current moment fed back by the lower computer, and output the serialization information of the program variables at the current moment.

[0016] In an embodiment of the present application, by calling the variable monitoring interface to obtain the serialization information of the program variables at the current moment during the process of running the target program code on the lower computer, the operation and maintenance personnel can monitor the changes of the program variables at any time, thereby improving the reliability of the target program code operation.

[0017] In one embodiment, the method further comprises:

[0018] Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; and add the variable modification interface to the target program code.

[0019] In the embodiment of the present application, a variable modification interface is added to the target program code so that the host computer can directly modify the program variables based on the variable modification interface, thereby improving the efficiency of variable modification.

[0020] In one embodiment, in the process of controlling the lower computer to run the target program code, the method further includes:

[0021] In response to a variable modification request, obtain the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified; send the variable to be modified and the target variable value to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0022] In the embodiment of the present application, the variable to be modified is modified by calling a variable modification interface corresponding to the variable to be modified in the target program code, thereby improving the efficiency of variable modification.

[0023] In one embodiment, obtaining the initial program code corresponding to the target task includes:

[0024] According to the task description information associated with the target task, the target function blocks required to execute the target task and the initial connection method between the target function blocks are determined from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; the task configuration interface is displayed; wherein the task configuration interface displays the target function blocks connected by the initial connection method; in response to the dragging operation of the target function block in the task configuration interface, the initial connection method is adjusted to obtain the target connection method; according to the target connection method and the program code corresponding to each target function block, the initial program code corresponding to the target task is determined.

[0025] In the embodiment of the present application, the operation and maintenance personnel configure the initial program code corresponding to the target task by dragging the target function block in the task configuration interface, which can improve the flexibility and efficiency of determining the initial program code.

[0026] In a second aspect, the present application also provides a variable monitoring device, comprising:

[0027] A code acquisition module is used to obtain the initial program code corresponding to the target task;

[0028] An interface generation module, used to determine a variable monitoring interface corresponding to the initial program code according to a serialization library under a target programming language and program variables in the initial program code; wherein the target programming language is a programming language for writing the initial program code;

[0029] A code determination module is used to add a variable monitoring interface to the initial program code to obtain a target program code;

[0030] The variable monitoring module is used to control the lower computer to run the target program code, and in the process of running the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] Obtain the initial program code corresponding to the target task;

[0033] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0034] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0035] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0036] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0037] Obtain the initial program code corresponding to the target task;

[0038] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0039] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0040] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0041] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0042] Obtain the initial program code corresponding to the target task;

[0043] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0044] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0045] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0046] The above-mentioned variable monitoring method, device, equipment, storage medium and program product determine the variable monitoring interface corresponding to the initial program code according to the program variables in the initial program code corresponding to the serialization library and the target task under the target programming language; then, the variable monitoring interface is added to the initial program code to obtain the target program code, thereby controlling the lower computer to run the target program code, and in the process of running the target program code, calling the variable monitoring interface to monitor the program variables in real time. Compared with the related art, on the one hand, by adding a variable monitoring interface based on the serialization library and configuration, and adding the variable monitoring interface to the initial program code, so that the upper computer can monitor the program variables in real time by calling the variable monitoring interface, the flexibility of variable monitoring is improved; on the other hand, since the real-time monitoring of the program variables can be achieved without stopping the operation of the target program code, the stability of the operation of the target program code can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 An application environment diagram of a variable monitoring method in an embodiment;

[0049] Figure 2 A schematic diagram of a flow chart of a variable monitoring method in one embodiment;

[0050] Figure 3 A schematic diagram of a process for determining a variable monitoring interface in one embodiment;

[0051] Figure 4 A schematic diagram of a process for obtaining variable information in an embodiment;

[0052] Figure 5 A schematic diagram of a flow chart for modifying a program variable value in one embodiment;

[0053] Figure 6 A schematic diagram of a flow chart for determining an initial program code in one embodiment;

[0054] Figure 7 A schematic flow chart of a variable monitoring method in another embodiment;

[0055] Figure 8 is a structural block diagram of a variable monitoring device in one embodiment;

[0056] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0058] The variable monitoring method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the upper computer 102 communicates with the lower computer 104 through TCP (Transmission Control Protocol) / UDP (User Datagram Protocol). For example, the upper computer 102 obtains the initial program code corresponding to the target task, and determines the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code, and then adds the variable monitoring interface to the initial program code to obtain the target program code; then, the lower computer 104 is controlled to run the target program code, and in the process of running the target program code, the variable monitoring interface is called to monitor the program variables in real time.

[0059] In industrial control systems, the host computer is responsible for developing applications, and the slave computer is responsible for running the applications developed by the host computer. In order to monitor the running of applications on the slave computer, variable monitoring methods have emerged. Existing variable monitoring methods generally perform breakpoint debugging on applications through debugging protocols, that is, when the application is interrupted, the variable information in the application is sent to the host computer.

[0060] However, the existing variable monitoring method needs to pause the application during the debugging process, which cannot realize real-time monitoring of the program running status, reducing the flexibility of variable monitoring.

[0061] Based on this, in an exemplary embodiment, Figure 2 As shown, a variable monitoring method is provided, which is applied to Figure 1 The host computer in the example is used as an example to illustrate, which specifically includes the following steps:

[0062] S201, obtaining the initial program code corresponding to the target task.

[0063] Among them, the target task refers to an industrial task with execution requirements; the initial program code refers to the program code that can execute the target task.

[0064] Optionally, the operation and maintenance personnel can enter the task description information corresponding to the target task through the task display page corresponding to the host computer, and send a code acquisition request to the host computer; then, after the host computer detects the code acquisition request, it can directly obtain the initial program code corresponding to the target task from the preset code library based on the task description information corresponding to the target task.

[0065] Alternatively, the operation and maintenance personnel can directly select the function blocks required for the target task from the icons corresponding to the packaged function blocks through the task display page corresponding to the host computer; then, based on the function blocks required for the target task, obtain the initial program code corresponding to the target task.

[0066] S202, determining a variable monitoring interface corresponding to the initial program code according to a serialization library under a target programming language and program variables in the initial program code.

[0067] Among them, the target programming language is the programming language used to write the initial program code; the serialization library refers to the code library that can serialize code information; the program variables refer to the variables in the initial code program, for example, they can be various variables defined by the operation and maintenance personnel, or global variables in the project; the variable monitoring interface refers to the interface used to feedback variable information.

[0068] It can be understood that in order to monitor the changes of these variables in real time when the program code is running, after obtaining the initial program code corresponding to the target task, the program variables in the initial program code can be parsed based on the code template in the serialization library under the target programming language, and then a variable monitoring interface corresponding to the initial program code can be generated.

[0069] S203, adding the variable monitoring interface to the initial program code to obtain the target program code.

[0070] The target program code refers to the program code including the variable monitoring interface.

[0071] Optionally, after the variable monitoring interface is determined, the variable monitoring interface may be added to a corresponding code position to obtain a target program code.

[0072] For example, in C++ language, the program variables in the initial program code A written in C++ language can be serialized based on the serialize template function in the Cereal library (serialization library in C++ language) corresponding to the C++ language, and then a serialize interface (variable monitoring interface) is generated, where the serialize interface includes the serialization of variables defined in the initial code program and global variables; then, the serialize interface is added to the initial program code A to obtain the target program code A'.

[0073] S204, controlling the lower computer to run the target program code, and in the process of running the target program code, calling the variable monitoring interface to monitor the program variables in real time.

[0074] Optionally, after determining the target program code, the target program code may be compiled first, and after successful compilation; subsequently, the successfully compiled target program code may be sent to a lower computer, and the lower computer may run the target program code.

[0075] Furthermore, during the process of running the target program code, the operation and maintenance personnel can send a variable acquisition request to the lower computer through the upper computer to instruct the lower computer to feedback the variable information of the program variables by calling the variable monitoring interface; or, a variable information feedback cycle can be pre-configured in the target program code. During the process of running the target program code, the lower computer can periodically call the variable monitoring interface to feedback the variable information of the program variables based on the variable information feedback cycle.

[0076] In the above variable monitoring method, the variable monitoring interface corresponding to the initial program code is determined according to the program variables in the initial program code corresponding to the serialization library and the target task under the target programming language; then, the variable monitoring interface is added to the initial program code to obtain the target program code, and then the lower computer is controlled to run the target program code, and in the process of running the target program code, the variable monitoring interface is called to monitor the program variables in real time. Compared with the related art, in which the application is breakpoint debugged through the debugging protocol to obtain the variable information of the program variables, the above method is adopted. On the one hand, by adding the variable monitoring interface based on the serialization library and configuration, and adding the variable monitoring interface to the initial program code, so that the upper computer can monitor the program variables in real time by calling the variable monitoring interface, the flexibility of variable monitoring is improved; on the other hand, since the real-time monitoring of the program variables can be realized without stopping the operation of the target program code, the stability of the operation of the target program code can be guaranteed.

[0077] It is understandable that when determining the variable monitoring interface, there may be problems such as missing program variables, thereby reducing the accuracy of determining the variable monitoring interface. Based on this, on the basis of the above embodiment, in this embodiment, an optional method for determining the variable monitoring interface is provided, such as Figure 3 As shown, the specific steps include:

[0078] S301, extracting program variables from initial program codes based on structural features of the target programming language.

[0079] Among them, structural features refer to the programming structures corresponding to various type definitions in the programming language.

[0080] Optionally, the structural features used to define variables in the target programming language can be used as indexes to query from the initial program code; then, based on the matching results obtained from the query, the program variables in the initial program code are determined; or, based on the structural features of the target programming language, a positioning code segment that can locate the program variables can be determined; then, the program variables are extracted from the initial program code based on the positioning code segment.

[0081] S302, using a serialization library under a target programming language to process program variables, and obtain a variable monitoring interface corresponding to the initial program code.

[0082] Optionally, after determining the program variables, the program variables can be parsed first, and after obtaining the variable information corresponding to the program variables through parsing, the variable information corresponding to the program variables can be serialized based on the interface generation template in the serialization library under the target programming language, thereby generating a variable monitoring interface corresponding to the initial program code.

[0083] It is understandable that in order to ensure the accuracy of program variables, program variables can be parsed based on variable configuration files associated with the program variables, and custom code static rules and tag parsing can be implemented based on static code scanning tools.

[0084] For example, when the target programming language is C++, the clang tools (independent command line) toolset can be used to parse the type, variable name, initial value of the program variable, and the function name, return value, parameter and other variable information of the function based on C++ ast (abstract syntax tree) for subsequent serialization processing; at the same time, clang-tidy can be used to implement custom code static rules and label parsing.

[0085] In the embodiment of the present application, by extracting program variables from the initial program code based on the structural features of the target programming language, the accuracy of determining the program variables can be ensured, thereby ensuring the accuracy of the determined variable monitoring interface.

[0086] It is understandable that in order to facilitate the operation and maintenance personnel to monitor the changes of program variables at any time, based on the above embodiment, in this embodiment, an optional method for obtaining variable information is provided, such as Figure 4 As shown, the specific steps include:

[0087] S401, sending a task processing request for a target task to a lower computer.

[0088] The task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task.

[0089] Optionally, after the target program code is successfully compiled, a task processing request can be generated based on the target program code and the task description information corresponding to the target task, and sent to the lower computer; accordingly, after receiving the task processing request, the lower computer can run the target program code in the lower computer based on the task description information to realize the processing of the target task.

[0090] S402, sending a variable acquisition request to the lower computer during the process of the lower computer running the target program code.

[0091] The variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate serialization information of the program variables at the current moment according to the running data of the target program code; the serialization information refers to the variable information after serialization processing.

[0092] Optionally, when the lower computer is running the target program code, if the operation and maintenance personnel have a variable acquisition requirement, the operation and maintenance personnel can send a variable acquisition request to the lower computer by clicking the variable acquisition control in the task display page corresponding to the upper computer.

[0093] Correspondingly, after the lower computer obtains the variable acquisition request, it can obtain the running data of the target program code at the current moment by calling the variable monitoring interface, and extract the variable information of the program variables from the running data at the current moment; then, the variable monitoring interface can serialize the variable information of the program variables, obtain the serialization information of the program variables at the current moment, and feedback to the upper computer.

[0094] S403, obtaining the serialization information of the program variables fed back by the lower computer at the current moment, and outputting the serialization information of the program variables at the current moment.

[0095] It is understandable that in order to better display serialization information to operation and maintenance personnel, after the upper computer obtains the serialization information of the program variables fed back by the lower computer at the current moment, the serialization information at the current moment can be displayed through the task display page associated with the upper computer.

[0096] Optionally, when displaying the serialized information at the current moment, if there is an abnormality in the information of a certain program variable, the serialized information corresponding to the program variable can be marked to prompt the operation and maintenance personnel to handle it in a timely manner.

[0097] In an embodiment of the present application, by calling the variable monitoring interface to obtain the serialization information of the program variables at the current moment during the process of running the target program code on the lower computer, the operation and maintenance personnel can monitor the changes of the program variables at any time, thereby improving the reliability of the target program code operation.

[0098] It is understandable that during the operation of the target code program, the operation and maintenance personnel can self-define the content of the program variables by monitoring the program variables in real time. However, in the prior art, it is necessary to find out the modification address and other information corresponding to the program variables in the lower computer and then modify the program variables, which undoubtedly increases the overhead and difficulty of the lower computer.

[0099] Based on this, on the basis of the above embodiments, in this embodiment, an optional method of configuring the interface is provided, specifically, generating a variable modification interface corresponding to the program variable according to the configuration information of the program variable; and adding the variable modification interface to the target program code.

[0100] Among them, the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface. Furthermore, the write interface refers to an interface that can write variable values, which may be a set_value interface; the variable value interface refers to an interface used to obtain variable values, which may be a get_value interface; the variable address interface refers to an interface used to obtain variable addresses, which may be a get_addr interface; the variable type interface refers to an interface used to obtain variable types, which may be a get_type interface.

[0101] Optionally, after obtaining the target program code, the write interface, variable value interface, variable address interface and variable type interface of each program variable can be extracted based on the configuration information of the program variables in the target program code; then, for each program variable, the write interface, variable value interface, variable address interface and variable type interface of the program variable can be encapsulated to obtain the variable modification interface of the program variable.

[0102] Furthermore, after the variable modification interface of each program variable is determined, the variable modification interface of each program variable can be added to a preset position in the target program code for subsequent calling.

[0103] In the embodiment of the present application, a variable modification interface is added to the target program code so that the host computer can directly modify the program variables based on the variable modification interface, thereby improving the efficiency of variable modification.

[0104] In order to ensure the accuracy of variable value modification, based on the above embodiment, in this embodiment, an optional method for modifying program variable values ​​is provided, such as Figure 5 As shown, the specific steps include:

[0105] S501 , in response to a variable modification request, obtaining a variable to be modified in a program variable and a target variable value corresponding to the variable to be modified.

[0106] The variable modification request is used to instruct the lower computer to call the variable modification interface to modify the variable to be modified; the variable to be modified refers to the program variable that has the variable modification requirement; the target variable value.

[0107] Optionally, the operation and maintenance personnel can select the variable to be modified from each program variable through the task display page corresponding to the host computer, and enter / check the target variable value corresponding to the variable to be modified to generate a variable modification request, and send it to the host computer, so that the host computer obtains the variable to be modified and the target variable value corresponding to the variable to be modified.

[0108] S501, sending the variable to be modified and the target variable value to the lower computer, to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0109] Optionally, after the upper computer sends the variable to be modified and the target variable value to the lower computer, the lower computer can modify the variable value of the variable to be modified to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0110] In the embodiment of the present application, the variable to be modified is modified by calling a variable modification interface corresponding to the variable to be modified in the target program code, thereby improving the efficiency of variable modification.

[0111] In order to improve the efficiency of determining the initial program code, based on the above embodiment, in this embodiment, an optional method for determining the initial program code is provided, such as Figure 6 As shown, the specific steps include:

[0112] S601, according to the task description information associated with the target task, determine the target function blocks required to execute the target task and the initial connection mode between the target function blocks from the pre-packaged candidate function blocks.

[0113] Among them, task description information refers to the specific configuration information that describes the target task; function blocks are basic components under international standards in the field of industrial automation, used to implement specific functions or algorithms; further, each candidate function block is written based on the target programming language. The target function block refers to the function block used to perform the target task; the initial connection method refers to the initial connection method between each target function block.

[0114] Optionally, in order to improve the efficiency of determining the initial program code, the initial connection method between functional blocks under each type of task can be pre-constructed based on the configuration of commonly used tasks; then, based on the task description information associated with the target task, each type of task can be screened to determine the target functional blocks required to execute the target task and the initial connection method between each target functional block.

[0115] Alternatively, in order to increase the flexibility of determining the initial program code, the operation and maintenance personnel can also customize the target function blocks required to execute the target task from the database corresponding to the candidate function blocks; then, the host computer can automatically connect the pins between the target function blocks based on the functions that can be achieved by each target function block to obtain the initial connection method between the target function blocks.

[0116] It can be understood that in this embodiment, in order to realize the call of subsequent variable monitoring interface, each candidate function block, program and other program organization units in the host computer system can be abstracted into corresponding program classes, and each program class can be designed as a singleton mode; accordingly, when configuring the corresponding program code for the task, these program classes can be bound to the executable tasks to realize the scheduling of tasks to programs.

[0117] S602, displaying a task configuration interface.

[0118] Among them, the task configuration interface displays various target function blocks connected by the initial connection method.

[0119] Optionally, the target function blocks required to execute the target task and the initial connection mode between the target function blocks may be displayed to the operation and maintenance personnel through the task configuration interface.

[0120] S603, in response to the dragging operation on the target function block in the task configuration interface, adjusting the initial connection mode to obtain the target connection mode.

[0121] The target connection method refers to the connection method required to perform the target task.

[0122] Optionally, the operation and maintenance personnel can customize the modification of the initial connection mode by dragging the target function block in the task configuration interface; accordingly, after detecting the dragging operation of the operation and maintenance personnel, the upper computer can adjust the initial connection mode based on the target function block corresponding to the dragging operation and the final dragging position to obtain the target connection mode.

[0123] S604, determining the initial program code corresponding to the target task according to the target connection mode and the program code corresponding to each target function block.

[0124] Optionally, after the target connection mode is determined, adaptive logic optimization may be performed on the program code corresponding to each target functional block according to the target connection mode, thereby obtaining an initial program code corresponding to the target task.

[0125] In the embodiment of the present application, the operation and maintenance personnel configure the initial program code corresponding to the target task by dragging the target function block in the task configuration interface, which can improve the flexibility and efficiency of determining the initial program code.

[0126] Figure 7 FIG. 2 is a flow chart of a variable monitoring method in another embodiment. Based on the above embodiment, this embodiment provides an optional example of a variable monitoring method. Figure 7 The specific implementation process is as follows:

[0127] S701 , according to the task description information associated with the target task, determine the target function blocks required to execute the target task and the initial connection mode between the target function blocks from the pre-packaged candidate function blocks.

[0128] Each candidate functional block is written based on the target programming language.

[0129] S702, displaying the task configuration interface.

[0130] Among them, the task configuration interface displays various target function blocks connected by the initial connection method.

[0131] S703, in response to the dragging operation on the target function block in the task configuration interface, adjusting the initial connection mode to obtain the target connection mode.

[0132] S704, determining the initial program code corresponding to the target task according to the target connection mode and the program code corresponding to each target function block.

[0133] The target programming language is the programming language used to write the initial program code.

[0134] S705 , extracting program variables from the initial program code based on the structural features of the target programming language.

[0135] S706, using the serialization library under the target programming language, process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0136] S707, adding the variable monitoring interface to the initial program code to obtain the target program code.

[0137] S708, generating a variable modification interface corresponding to the program variable according to the configuration information of the program variable, and adding the variable modification interface to the target program code.

[0138] Among them, the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface.

[0139] S709: Send a task processing request for the target task to the lower computer.

[0140] The task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task.

[0141] S710, sending a variable acquisition request to the lower computer during the process of the lower computer running the target program code.

[0142] The variable acquisition request is used to instruct the lower computer to call the variable monitoring interface and generate serialization information of the program variables at the current moment according to the running data of the target program code.

[0143] S711, obtaining the serialization information of the program variables fed back by the lower computer at the current moment, and outputting the serialization information of the program variables at the current moment.

[0144] S712, in response to the variable modification request, obtaining the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified.

[0145] S713, sending the variable to be modified and the target variable value to the lower computer, to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0146] The specific process of the above S701-S713 can be found in the description of the above method embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0147] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0148] Based on the same inventive concept, the embodiment of the present application also provides a variable monitoring device for implementing the variable monitoring method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more variable monitoring device embodiments provided below can refer to the limitations of the variable monitoring method above, and will not be repeated here.

[0149] In an exemplary embodiment, Figure 8 As shown, a variable monitoring device 1 is provided, comprising: a code acquisition module 10, an interface generation module 20, a code determination module 30 and a variable monitoring module 40, wherein:

[0150] A code acquisition module 10 is used to acquire the initial program code corresponding to the target task;

[0151] The interface generation module 20 is used to determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0152] A code determination module 30, for adding the variable monitoring interface to the initial program code to obtain a target program code;

[0153] The variable monitoring module 40 is used to control the lower computer to run the target program code, and in the process of running the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0154] In an exemplary embodiment, the interface generation module 20 is specifically used for:

[0155] Based on the structural characteristics of the target programming language, program variables are extracted from the initial program code; the serialization library under the target programming language is used to process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0156] In an exemplary embodiment, the variable monitoring module 40 is specifically used to:

[0157] Send a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; in the process of the lower computer running the target program code, send a variable acquisition request to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate the serialization information of the program variables at the current moment according to the running data of the target program code; obtain the serialization information of the program variables at the current moment fed back by the lower computer, and output the serialization information of the program variables at the current moment.

[0158] In an exemplary embodiment, the variable monitoring device further includes an interface adding module, wherein the interface adding module is specifically used for:

[0159] Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; and add the variable modification interface to the target program code.

[0160] In an exemplary embodiment, the variable monitoring module 40 is further configured to:

[0161] In response to a variable modification request, obtain the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified; send the variable to be modified and the target variable value to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0162] In an exemplary embodiment, the code acquisition module 10 is specifically used for:

[0163] According to the task description information associated with the target task, the target function blocks required to execute the target task and the initial connection method between the target function blocks are determined from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; the task configuration interface is displayed; wherein the task configuration interface displays the target function blocks connected by the initial connection method; in response to the dragging operation of the target function block in the task configuration interface, the initial connection method is adjusted to obtain the target connection method; according to the target connection method and the program code corresponding to each target function block, the initial program code corresponding to the target task is determined.

[0164] Each module in the above variable monitoring device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0165] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a variable monitoring method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0166] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0167] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0168] Obtain the initial program code corresponding to the target task;

[0169] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0170] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0171] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0173] Based on the structural characteristics of the target programming language, program variables are extracted from the initial program code; the serialization library under the target programming language is used to process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0174] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0175] Send a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; in the process of the lower computer running the target program code, send a variable acquisition request to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate the serialization information of the program variables at the current moment according to the running data of the target program code; obtain the serialization information of the program variables at the current moment fed back by the lower computer, and output the serialization information of the program variables at the current moment.

[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0177] Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; and add the variable modification interface to the target program code.

[0178] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0179] In response to a variable modification request, obtain the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified; send the variable to be modified and the target variable value to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0180] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0181] According to the task description information associated with the target task, the target function blocks required to execute the target task and the initial connection method between the target function blocks are determined from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; the task configuration interface is displayed; wherein the task configuration interface displays the target function blocks connected by the initial connection method; in response to the dragging operation of the target function block in the task configuration interface, the initial connection method is adjusted to obtain the target connection method; according to the target connection method and the program code corresponding to each target function block, the initial program code corresponding to the target task is determined.

[0182] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0183] Obtain the initial program code corresponding to the target task;

[0184] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0185] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0186] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0188] Based on the structural characteristics of the target programming language, program variables are extracted from the initial program code; the serialization library under the target programming language is used to process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0189] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0190] Send a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; in the process of the lower computer running the target program code, send a variable acquisition request to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate the serialization information of the program variables at the current moment according to the running data of the target program code; obtain the serialization information of the program variables at the current moment fed back by the lower computer, and output the serialization information of the program variables at the current moment.

[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0192] Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; and add the variable modification interface to the target program code.

[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0194] In response to a variable modification request, obtain the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified; send the variable to be modified and the target variable value to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0196] According to the task description information associated with the target task, the target function blocks required to execute the target task and the initial connection method between the target function blocks are determined from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; the task configuration interface is displayed; wherein the task configuration interface displays the target function blocks connected by the initial connection method; in response to the dragging operation of the target function block in the task configuration interface, the initial connection method is adjusted to obtain the target connection method; according to the target connection method and the program code corresponding to each target function block, the initial program code corresponding to the target task is determined.

[0197] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0198] Obtain the initial program code corresponding to the target task;

[0199] Determine the variable monitoring interface corresponding to the initial program code according to the serialization library under the target programming language and the program variables in the initial program code; wherein the target programming language is the programming language for writing the initial program code;

[0200] Add the variable monitoring interface to the initial program code to obtain the target program code;

[0201] Control the lower computer to run the target program code, and during the running of the target program code, call the variable monitoring interface to monitor the program variables in real time.

[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0203] Based on the structural characteristics of the target programming language, program variables are extracted from the initial program code; the serialization library under the target programming language is used to process the program variables to obtain a variable monitoring interface corresponding to the initial program code.

[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0205] Send a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; in the process of the lower computer running the target program code, send a variable acquisition request to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface, and generate the serialization information of the program variables at the current moment according to the running data of the target program code; obtain the serialization information of the program variables at the current moment fed back by the lower computer, and output the serialization information of the program variables at the current moment.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; and add the variable modification interface to the target program code.

[0208] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0209] In response to a variable modification request, obtain the variable to be modified in the program variable and the target variable value corresponding to the variable to be modified; send the variable to be modified and the target variable value to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0211] According to the task description information associated with the target task, the target function blocks required to execute the target task and the initial connection method between the target function blocks are determined from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; the task configuration interface is displayed; wherein the task configuration interface displays the target function blocks connected by the initial connection method; in response to the dragging operation of the target function block in the task configuration interface, the initial connection method is adjusted to obtain the target connection method; according to the target connection method and the program code corresponding to each target function block, the initial program code corresponding to the target task is determined.

[0212] It should be noted that the data involved in this application (including but not limited to data corresponding to functional blocks, etc.) are all data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0213] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0214] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0215] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A variable monitoring method, characterized in that: Applied to a host computer, the method includes: Obtain the initial program code corresponding to the target task; Determine a variable monitoring interface corresponding to the initial program code according to a serialization library under a target programming language and program variables in the initial program code; wherein the target programming language is a programming language for writing the initial program code; Adding the variable monitoring interface to the initial program code to obtain a target program code; The lower computer is controlled to run the target program code, and during the running of the target program code, the variable monitoring interface is called to monitor the program variables in real time.

2. The method according to claim 1, characterized in that The step of determining a variable monitoring interface corresponding to the initial program code according to a serialization library in a target programming language and program variables in the initial program code includes: extracting program variables from the initial program code based on structural features of the target programming language; The program variables are processed using a serialization library in the target programming language to obtain a variable monitoring interface corresponding to the initial program code.

3. The method according to claim 1, characterized in that The controlling lower computer runs the target program code, and in the process of running the target program code, calls the variable monitoring interface to monitor the program variables in real time, including: Sending a task processing request for the target task to the lower computer; wherein the task processing request carries the target program code, and the task processing request is used to instruct the lower computer to run the target program code to realize the processing of the target task; During the process of the target program code being run by the lower computer, a variable acquisition request is sent to the lower computer; wherein the variable acquisition request is used to instruct the lower computer to call the variable monitoring interface and generate serialization information of the program variable at the current moment according to the running data of the target program code; The serialization information of the program variables at the current moment fed back by the lower computer is obtained, and the serialization information of the program variables at the current moment is output.

4. The method according to claim 1, characterized in that The method further comprises: Generate a variable modification interface corresponding to the program variable according to the configuration information of the program variable; wherein the variable modification interface includes a write interface, a variable value interface, a variable address interface and a variable type interface; The variable modification interface is added to the target program code.

5. The method according to claim 4, characterized in that: In the process of controlling the lower computer to run the target program code, the method further includes: In response to a variable modification request, obtaining a variable to be modified in the program variable and a target variable value corresponding to the variable to be modified; The variable to be modified and the target variable value are sent to the lower computer to instruct the lower computer to modify the variable to be modified according to the target variable value by calling the variable modification interface corresponding to the variable to be modified in the target program code.

6. The method according to claim 1, characterized in that The obtaining of the initial program code corresponding to the target task includes: According to the task description information associated with the target task, determine the target function block required to execute the target task and the initial connection mode between the target function blocks from the pre-packaged candidate function blocks; wherein each candidate function block is written based on the target programming language; Displaying a task configuration interface; wherein the task configuration interface displays each target function block connected by the initial connection method; In response to a drag operation on a target function block in the task configuration interface, adjusting the initial connection mode to obtain a target connection mode; According to the target connection mode and the program code corresponding to each target function block, an initial program code corresponding to the target task is determined.

7. A variable monitoring device, characterized in that: The device comprises: A code acquisition module is used to obtain the initial program code corresponding to the target task; An interface generation module, used to determine a variable monitoring interface corresponding to the initial program code according to a serialization library under a target programming language and program variables in the initial program code; wherein the target programming language is a programming language for writing the initial program code; A code determination module, used for adding the variable monitoring interface to the initial program code to obtain a target program code; The variable monitoring module is used to control the lower computer to run the target program code, and in the process of running the target program code, call the variable monitoring interface to monitor the program variables in real time.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.