Controller variable tag library forming method and device, equipment, storage medium and program product

By analyzing the controller engineering files, establishing the relationship between the controller variables and the device, and building a controller variable tag library, it solves the problem of irregular naming of the controller variables, and realizes the accurate and efficient utilization of variable data.

CN120386273APending Publication Date: 2025-07-29BEIJING WANWANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510466706.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In the prior art, controller variable naming is irregular and lacks unified standards, which leads to users being unable to understand the functions, uses, corresponding equipment and equipment models of variables, unable to quickly locate associated controller variables, and unable to achieve accurate and efficient use of controller variable data.

Method used

By analyzing the controller's control program project files, obtaining the controller variable information and device information, identifying the overlapping relationship between the variable address, establishing the association relationship between the variable and the device, building a controller variable tag library, and setting valuable unified tag information.

Benefits of technology

It realizes accurate and efficient acquisition and utilization of controller variable data, and users can quickly understand the functions, uses and corresponding equipment information of variables, improving data utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386273A_ABST
    Figure CN120386273A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of control, in particular to a controller variable tag library forming method and device, electronic equipment, a storage medium and a program product. The controller variable information and the device information related to the control program are obtained by analyzing the project file corresponding to the control program of the controller, and the controller variable information comprises the variable name and the variable address of at least one controller variable; the device information comprises a device name and a variable address of at least one device connected with the controller; identifying a variable address of a controller variable having a coincidence relationship with the variable address corresponding to the equipment, establishing an association relationship between the controller variable and the equipment, and setting equipment information of the equipment having the association relationship as label information of the controller variable; according to the method, the controller variable label library is constructed, and the controller variable label library comprises the controller variable information and the label information of the controller variables, so that valuable and uniform controller variable label information can be formed, and accurate and efficient acquisition and utilization of the controller variable data by a user are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of controllers, and in particular, to a method, apparatus, electronic device, storage medium, and program product for forming a controller variable tag library. Background Art

[0002] Controllers used for devices in industrial fields include programmable logic controllers (PLCs), distributed control systems (DCSs), and robot-specific controllers, etc. Different types of controllers have different control methods and application scenarios. Among them, a programmable logic controller (PLC) is a real-time data exchange system, usually connected to various industrial devices to obtain the operating status and operating data of various devices, and then control the industrial devices based on the obtained operating status and operating data of the industrial devices. The controller needs to write a control program to implement the logical control of multiple devices, and a large number of controller variables need to be set in the control program to match the different functions of different devices and participate in the program control instructions.

[0003] By parsing the engineering file of the PLC controller, all controller variable information related to the control program can be obtained, including information such as the variable address, variable name, and variable type of the controller variable. When writing a program, a PLC engineer may add some remarks or annotation information for explaining the function or use of some controller variables, but this information is not comprehensive, and most variables have no remarks or annotation information. Or even if remarks or annotation information is added, due to the lack of standardization or unification of the information, different people cannot understand its true meaning, and its use value is relatively low.

[0004] Currently, there is no unified regulation or standard for the names of controller variables at home and abroad, resulting in the naming of controller variable names using strings without rules. When the controller variables of the same function of the same device are written by different PLC engineers, multiple different naming forms are adopted. Even the variable names of some controller variables are randomly assigned without a system, resulting in the inability of actual users in the industrial field to know useful information such as the function, use, corresponding device, and device model of the controller variable.

[0005] At the same time, during the use of PLC historical data, since actual users cannot know useful information such as the function, use, corresponding device, and device model of the controller variable, it is impossible to quickly locate the controller variable associated with the actual use, and it is impossible to achieve precise and efficient utilization of the historical data corresponding to the controller variable, and thus it is impossible to solve various actual problems faced by users.

[0006] Therefore, how to set valuable and unified tag information for controller variables, so as to facilitate the accurate and efficient utilization of the data corresponding to the controller variables, is a technical problem that urgently needs to be solved. Summary of the Invention

[0007] To solve the above technical problems, the present disclosure provides a method, device, equipment, storage medium and program product for forming a controller variable tag library.

[0008] The first aspect of the embodiments of the present disclosure provides a method for forming a controller variable tag library, including: Analyze the engineering file corresponding to the control program of the controller to obtain the controller variable information and device information related to the control program. The controller variable information includes the variable names and variable addresses of at least one controller variable, and the device information includes the device names and variable addresses of at least one device connected to the controller; Identify the variable addresses of the controller variables that have a coincidence relationship with the variable addresses of the devices, establish the association relationship between the controller variables and the devices, and set the device information of the associated devices as the tag information of the controller variables; Construct a controller variable tag library, which includes controller variable information and tag information of controller variables.

[0009] The second aspect of the embodiments of the present disclosure provides a method for obtaining controller data, including: Receive a controller data acquisition instruction, analyze the instruction, and obtain the device information corresponding to the instruction; Based on the controller variable tag library, determine the controller variable information associated with the device information corresponding to the instruction. The controller variable tag library is formed by using the method provided in the first aspect above; Taking the obtained controller variable information as a query entry, extract the controller data corresponding to the controller variable information from the collected controller data. The controller data includes real-time controller data and / or historical controller data.

[0010] The third aspect of the embodiments of the present disclosure provides a device for forming a controller variable tag library, including: An engineering analysis module for analyzing the engineering file corresponding to the control program of the controller to obtain the controller variable information and device information related to the control program. The controller variable information includes the variable names and variable addresses of at least one controller variable, and the device information includes the device names and variable addresses of at least one device connected to the controller; A tag setting module for identifying the variable addresses of the controller variables that have a coincidence relationship with the variable addresses of the devices, establishing the association relationship between the controller variables and the devices, and setting the device information of the associated devices as the tag information of the controller variables; A tag library construction module, configured to construct a controller variable tag library, where the controller variable tag library includes controller variable information and tag information of the controller variables.

[0011] A fourth aspect of the embodiments of the present disclosure provides a controller data acquisition device, including: An instruction analysis module, configured to receive a controller data acquisition instruction, parse the instruction, and obtain device information corresponding to the instruction; A variable positioning module, configured to determine, based on the controller variable tag library, controller variable information associated with the device information corresponding to the instruction, where the controller variable tag library is formed by using the method provided in the first aspect above; A data extraction module, configured to use the obtained controller variable information as a query entry, and extract, from the acquired controller data, controller data corresponding to the controller variable information, where the controller data includes real-time controller data and / or historical controller data.

[0012] A fifth aspect of the embodiments of the present disclosure provides an electronic device, including: A processor; A memory; and A computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the method for forming the controller variable tag library provided in the first aspect above and the method for acquiring controller data provided in the second aspect above.

[0013] A sixth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the processor is enabled to implement the method for forming the controller variable tag library provided in the first aspect above and the method for acquiring controller data provided in the second aspect above.

[0014] A seventh aspect of the embodiments of the present disclosure provides a computer-readable program product, where the program product includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the processor is enabled to implement the method for forming the controller variable tag library provided in the first aspect above and the method for acquiring controller data provided in the second aspect above.

[0015] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art: The method, device, equipment, storage medium and program product for forming a controller variable tag library provided by the embodiments of the present disclosure obtain controller variable information and device information related to a control program by parsing an engineering file corresponding to the control program of a controller. The controller variable information includes the variable names and variable addresses of at least one controller variable, and the device information includes the device names and variable addresses of at least one device connected to the controller. Identify the variable addresses of the controller variables that have a coincidence relationship with the variable addresses of the devices, establish an association relationship between the controller variables and the devices, and set the device information of the associated devices as the tag information of the controller variables. Construct a controller variable tag library, which includes the controller variable information and the tag information of the controller variables. Thus, valuable and unified controller variable tag information can be formed, which is beneficial for users to accurately and efficiently obtain and utilize the controller variable data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0017] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 is a flowchart of a method for forming a controller variable tag library provided by an embodiment of the present disclosure; Figure 2 is a flowchart of another method for forming a controller variable tag library provided by an embodiment of the present disclosure; Figure 3 is a flowchart of a method for obtaining controller data provided by an embodiment of the present disclosure; Figure 4 is a schematic structural diagram of a device for forming a controller variable tag library provided by an embodiment of the present disclosure; Figure 5 is a schematic structural diagram of a device for obtaining controller data provided by an embodiment of the present disclosure; Figure 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0019] In order to better understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments can be combined with each other.

[0020] Numerous specific details are set forth in the following description in order to provide a thorough understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.

[0021] It should be understood that the various steps recited in the method embodiments of the present disclosure may be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

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

[0023] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".

[0024] Generally, by parsing the engineering files of controllers such as PLCs, all the controller variable information related to the control program can be obtained, including information such as the variable address, variable name, variable type of the controller variables, etc. When writing programs, PLC engineers may add some remarks or annotation information for explaining the functions or uses of some controller variables, but this information is not comprehensive, and most variables have no remarks or annotation information. Or even if remarks or annotation information is added, due to the non-standard or non-uniform information, different people cannot understand its true meaning, and the use value is relatively low. In view of this problem, the embodiments of the present disclosure provide a method for forming a controller variable tag library, and the method will be introduced below in conjunction with specific embodiments.

[0025] Figure 1It is a flowchart of a method for forming a controller variable tag library provided by an embodiment of the present disclosure. This method can be executed by a controller variable tag library forming device, which can be implemented in software and / or hardware, and can be configured in an electronic device, such as a server or a terminal.

[0026] As Figure 1 shown, the method for forming a controller variable tag library provided in this embodiment includes the following steps: S110. Parse the project file corresponding to the control program of the controller to obtain controller variable information and device information related to the control program. The controller variable information includes the variable names and variable addresses of at least one controller variable, and the device information includes the device names and variable addresses of at least one device connected to the controller.

[0027] In the embodiment of the present disclosure, a control program runs in the controller, and this control program controls various types of devices in the field through digital or analog input and output data. The controller can be any controller capable of device control, including but not limited to: Programmable Logic Controller (PLC), Distributed Control System (DCS), and robot special controllers, etc. Different types of controllers have different control methods and application scenarios.

[0028] The devices connected to and controlled by the controller include but are not limited to automation devices such as sensors, cameras, motors, frequency converters, and robots in the industrial field. These devices are controlled by the controller and execute in an orderly manner according to a predetermined program.

[0029] The project file corresponding to the control program of the controller refers to the file created and used during the development of the controller, which contains all the information required to implement a specific automation control task, such as configuration files for describing the hardware configuration, communication configuration, parameter configuration, etc. of the controller, and program files for describing the control logic of the controller, etc.

[0030] Optionally, the format of the controller can be XML format, or JSON format, or other formats.

[0031] Optionally, due to different configurations and settings of the controller, the number of project files can be one or more.

[0032] In some embodiments of the present disclosure, the corresponding project file is exported from the controller by invoking a dedicated export tool, and thus the project file corresponding to the controller is obtained. The project file can also be obtained through other means, which will not be further limited herein. For example, taking Siemens PLC1500 as an example, the project file of the PLC controller can be directly exported through the openness tool.

[0033] By parsing the project file corresponding to the control program of the obtained controller, the controller variable information and device information related to the control program can be obtained. Among them, the methods of parsing the project file include, but are not limited to, decompressing the project file, format processing, information reading, etc.

[0034] Among them, controller variables are variables used to store and transmit data in the controller, and the types of stored data include, but are not limited to, different data types such as numbers, booleans, and strings. During the operation of the control program, the numerical value of the data stored in the variable can be modified. Multiple variables need to be set in the control program to represent different functions of different devices and participate in the program control instructions.

[0035] Optionally, by parsing the project file corresponding to the control program of the controller, a controller variable table can be obtained. The controller variable table records the variable information of all controller variables. The controller variable information includes one or more of the information such as variable name, variable address, variable type, data type, and comment. Among them, the variable address of the controller variable is the variable address corresponding to a single controller variable. Here, the variable address refers to the IO address or IQ address of the controller variable. By way of example, the variable address can be an I address or an O address.

[0036] In the controller variable table, some controller variables contain comment information. These comment information are added by PLC engineers when writing programs to facilitate understanding the meaning or use of controller variables, and are part of the existing information in the PLC project file.

[0037] Optionally, parse the project file of the PLC controller to obtain a controller variable table that records all controller variable information. Among them, the controller variable table records all controller variable information, and the controller variable information includes at least information such as the controller variable name, variable type, variable address, data type, and comment of the controller variable, as shown in Table 1.

[0038] Table 1 Schematic Table of Controller Variables

[0039] The controller variable table is a tool for managing and manipulating PLC variables. Users can declare a new controller variable by entering the variable name, data type, address, and comment. For example, you can declare a controller variable with the name "M_start," the variable type "I," the variable address "I100.0," the data type "Boolean," and the comment "Motor start button."

[0040] It's important to note that comments are different from tags. Comments are small amounts of information included in the PLC control program. In reality, only a few variables in the accessible variable table have comments, and the format of this information is not standardized. Most variables lack comments. This makes it difficult for industrial users to understand the specific meaning, purpose, corresponding device, and location of each controller variable.

[0041] Optionally, parse the controller's project file to obtain device information for all devices connected to the controller. Device information records information about all devices connected to the controller. Each device's device information includes the device name, model, manufacturer, order number, and variable address. Variable addresses are I / O addresses, which represent the variable addresses of multiple controller variables corresponding to the device. See Table 2.

[0042] Table 2 Device information diagram

[0043] The device variable address in the device information is the variable address corresponding to multiple controller variables associated with the device. The variable address here refers to the IO address range of the controller variable. The device variable address is in the form of multiple variable address ranges. For example, the device variable address range I100-I107 includes the variable addresses of all variables in the variable address range I100.0-I107.7, including I100.0, I100.1, I100.2, I100.3, I100.4, I100.5, I100.6, I100.7, I101.0, I101.7, I102.0, I102.7, and so on.

[0044] For example, in Table 2, the IO address is in the range of I100-I107, which includes multiple controller variables. These controller variables may correspond to the inverter 1 device. The device manufacturer of the inverter 1 is Siemens, and the order number is xsieidk133. The above device information can be obtained in batches through parsing.

[0045] The device information here includes all devices connected to and controlled by the PLC, including but not limited to various types of roller beds, machine tools, frequency converters, sensors, cameras, robotic arms and other automation devices in the industrial field.

[0046] S120. Identify the variable addresses of the controller variables that have an overlapping relationship with the variable addresses of the devices, establish the association relationship between the controller variables and the devices, and set the device information of the devices with the association relationship as the label information of the controller variables.

[0047] In the embodiment of the present disclosure, an association relationship between the controller variables and the devices is established through the controller variable addresses, so as to use the device information as the label information of the controller variables corresponding to the devices. Specifically, identify the variable addresses of the controller variables that have an overlapping relationship with the variable addresses of the devices, establish the association relationship between the controller variables with overlapping address relationships and the devices, and then set the device information as the label information of the corresponding controller variables, that is, set the device information as the label information of the controller variables corresponding to the devices.

[0048] For example, in Table 1, the variable address of the controller variable M_start is I100.0, which has an overlapping relationship with the variable addresses I100 - I107 of the device frequency converter 1 in Table 2. Then, an association relationship can be established between the controller variable M_start and the device frequency converter 1, and further, the device information of the device frequency converter 1 can be set as the label information of the controller variable M_start.

[0049] S130. Construct a controller variable label library, which includes controller variable information and the label information of the controller variables.

[0050] In the embodiment of the present disclosure, the variable information and label information of the set multiple controller variables are summarized and combined to construct a controller variable label library. This label library records the label information corresponding to the controller variables. Refer to Table 3.

[0051] Table 3 Schematic Table of Controller Variable Label Library

[0052] Optionally, the label information includes one or more labels, and the content of each label includes but is not limited to device information. The label information is used to comprehensively and uniformly explain the controller variables, facilitating actual users to quickly understand and locate the controller variables, so as to obtain the historical data or real-time data corresponding to the controller variables and use these data to solve practical problems.

[0053] The essence of a tag is the identification or interpretation of the controller variables of a device, which is a description or explanation of information such as the meaning, function, usage, production line location, application, etc. of the controller variables, and is different from the existing industrial identification information.

[0054] For example, it can be determined from Table 3 that the device corresponding to the controller variable with the IO address of I100.0 is Inverter 1 device, and the manufacturer of this Inverter 1 device is Siemens, the device model is S120, the order number is xsieidk133, and the existing annotation of this variable is the motor start button. The device corresponding to the controller variable with the IO address of Q158.0 is Inverter 2, and the manufacturer of this Inverter 2 device is Siemens, the device model is V20, and the order number is eixnhabi12. Since it has no program annotation, at this time, only the device information corresponding to this Q-type controller variable can be known, but the function and usage information corresponding to this variable cannot be known yet.

[0055] Therefore, by parsing the engineering file of the PLC, the tag information of the device information of the I and Q type controller variables can be obtained, but these controller variables still cannot be accurately matched to the specific components, specific locations, specific functions and usage information of the device, resulting in the user being unable to accurately locate the required controller variables and unable to effectively utilize the historical data of the PLC.

[0056] In the embodiment of the present disclosure, by parsing the engineering file corresponding to the control program of the controller, the controller variable information and device information related to the control program are obtained. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller; identify the variable address of the controller variable that has a coincidence relationship with the variable address of the device, establish the association relationship between the controller variable and the device, and set the device information of the device with the association relationship as the tag information of the controller variable; construct a controller variable tag library, and the controller variable tag library includes the controller variable information and the tag information of the controller variable. Thus, valuable and unified tag information is set for the controller variable, which is beneficial to the accurate and efficient acquisition and utilization of the data corresponding to the controller variable.

[0057] Based on the above embodiment, Figure 2 is a flowchart of another method for forming a controller variable tag library provided by the embodiment of the present disclosure. As Figure 2 shown, it specifically includes the following steps: S210. Parse the engineering file corresponding to the control program of the controller, and obtain the controller variable information and device information related to the control program. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller; S220. Identify the variable addresses of the controller variables that have an overlapping relationship with the variable addresses of the device, establish the association relationship between the controller variables and the device, and set the device information of the device with the association relationship as the label information of the controller variables.

[0058] It should be noted that the specific implementation manners of S210 - S220 are similar to the above - mentioned implementation manners and will not be elaborated here.

[0059] S230. Obtain text materials from different sources related to the device, extract the information associated with the controller variables, and use the information associated with the controller variables as the label information of the controller variables. The text materials from different sources related to the device include one or more of the device instruction manual, the device electrical drawing, and the device mechanical drawing.

[0060] In the embodiments of the present disclosure, in order to be able to utilize the controller data corresponding to the controller variables more accurately and efficiently, it is necessary to accurately locate the controller variables. Since the controller variables corresponding to different user purposes are different, it is considered to obtain the information related to the controller variables from different sources, including but not limited to obtaining from one or more different - source text materials such as the device instruction manual, the device electrical drawing, and the device mechanical drawing related to the device. Specifically, obtain the text materials from different sources related to the device, extract the information associated with the controller variables, and use these information associated with the controller variables as the label information of the controller variables.

[0061] Optionally, the label information of the controller variables includes one or more of device - type label information, location - type label information, energy - consumption - type label information, function - type label information, and usage - type label information. The device - type label information includes at least one label of the device information associated with the controller variables. The location - type label information includes at least one label of the location information associated with the controller variables. The energy - consumption - type label information includes at least one label of the energy - consumption information associated with the controller variables. The function - type label information includes at least one label of the function information associated with the controller variables. The usage - type label information includes at least one label of the usage information associated with the controller variables. Different types of label information correspond to different types of labels. The label information includes at least one label, and the content of each label is different.

[0062] Exemplarily, by obtaining the device instruction manual related to the device, extract the device - type information associated with the controller variables, and use the information associated with the controller variables as the device - type label information, function - type label information, or usage - type label information of the controller variables.

[0063] The device manual for ordinary users records all the information about the components associated with the device, the functions, uses, models, etc. of each component, facilitating users to understand how the functions of the device are realized and its specific structure. Different devices correspond to different device manuals. By interpreting the device manuals, extracting the controller variables corresponding to different functions or components of different devices, establishing the association relationship between the controller variables and the device functions or components, and creating label information about the functions and use types of the controller variables. Taking the device manual of the roller bed 1 as an example below, see Figure 4 。

[0064] Table 4 Schematic Diagram of the Information in the Device Manual of Roller Bed 1

[0065] By interpreting the above device manual, the different components corresponding to the device, the device functions and uses corresponding to different components, and the I / O addresses of the controller variables corresponding to these functions can be clarified. These information cannot be obtained by parsing the PLC project file. Obtaining these information will make up for the deficiencies in the PLC project file information and make the label information of the controller variables more comprehensive and unified.

[0066] Furthermore, through the variable addresses of the controller variables, the information such as functions, uses, component names, device names, etc. related to the controller variables obtained by parsing is formed into the label information of the controller variables.

[0067] For example, by obtaining the device electrician's book related to the device, extracting the device class information associated with the controller variables, and using the information associated with the controller variables as the energy consumption class label information, function class label information or use class label information of the controller variables.

[0068] The electrician's diagram corresponding to the PLC program contains the circuit connection information and control line information of components such as buttons, switches, relays, and indicator lights of various devices. The types of electrician's diagrams include control circuit diagrams, flowcharts, wiring diagrams, schematic diagrams, system block diagrams, etc. By reading the scanned electrician's diagram related to the PLC device, the information about electrical components related to the PLC device, the corresponding controller variable names, functions and uses, etc. can be obtained, thereby forming the label information of the controller variables. For the schematic diagram of the electrician's diagram information of the roller bed 2, see Table 5.

[0069] Table 5 Schematic Diagram of the Electrician's Diagram Information of Roller Bed 2

[0070] Further, through the variable address information of the controller variable, the information such as functions, uses, device names, component names, equipment names, etc. obtained and associated with the controller variable are matched to the corresponding controller variable to form the corresponding device class, function class, or use class label information of the controller variable.

[0071] Exemplarily, by obtaining the equipment mechanical drawing related to the equipment, the equipment class information associated with the controller variable is extracted, and the information associated with the controller variable is used as the position class label information of the controller variable.

[0072] The mechanical drawing of the equipment generally refers to the drawings that accurately identify the structure, size, assembly relationship, connection relationship, etc. of the mechanical equipment. It mainly includes two-dimensional or three-dimensional mechanical drawings such as general assembly drawings, exploded views, part drawings, process drawings, etc. in CAD. The equipment mechanical drawing mainly reflects the overall layout positions of different production lines, the physical layout positions of different equipment on the same production line, and the assembly positions of different components of the same equipment, etc., that is, physical space positions.

[0073] By interpreting the mechanical drawings of different equipment, the physical mechanical connection relationships and the corresponding assembly information and position information of different equipment can be obtained, and the association relationship between the controller variable and the position and assembly information of the equipment can be established, so as to form the label information of the controller variable. For the schematic diagram of the equipment mechanical drawing information of the production line, see Table 6.

[0074] Table 6 Schematic Diagram of Equipment Mechanical Drawing Information of Production Line

[0075] Further, the obtained equipment position information, device name and position, etc. can be matched to the corresponding controller variable through the equipment name to form the corresponding position label information of the controller variable, so that the equipment position information corresponding to the corresponding controller variable can be determined, which is beneficial to accurately locating the abnormal position when the data of the controller variable is monitored to be abnormal.

[0076] S240. Build a controller variable label library, which includes controller variable information and label information of the controller variable.

[0077] In the embodiments of the present disclosure, by summarizing the different types of label information obtained from different sources above, a controller variable label library is built. The controller variable label library includes controller variable information and label information of the controller variable. Each label information includes at least one label. The controller variable label library can be displayed in the form of a table, see Table 7.

[0078] Table 7 Schematic Diagram of Controller Variable Label Library

[0079] Different types of tag information can be obtained from different sources and matched to the corresponding controller variables to form relatively complete and comprehensive tag information for the controller variables, thus meeting the different needs of users, as shown in Table 7.

[0080] Optionally, display the tag information of the controller variables in the controller variable tag library. By presenting the formed controller variable tag information to the user, it is beneficial for the user to understand information such as the functions, uses, corresponding devices, and locations of the controller variables, and is conducive to the effective utilization of the historical data corresponding to the variables.

[0081] Optionally, store the formed controller variable tag library for the repeated use and direct or indirect invocation of the tags in the tag library. The storage methods include but are not limited to long-term storage and temporary storage. The storage method and storage medium are not further defined herein as long as they can play a storage role.

[0082] Optionally, the ways of displaying controller variable tags include but are not limited to chart form, text form, three-dimensional device floor plan or three-dimensional diagram + text, voice, audio-video, etc.

[0083] Optionally, the setting method of tags is not limited and can be manual setting or automatic setting. The automatic setting method of tags can be to set corresponding tags according to different types of the variable through an AI model algorithm. The AI model algorithm can be a decision tree model or a neural network model.

[0084] Optionally, the specific content of the tags can be updated regularly, specifically according to information such as equipment maintenance, updates, and production line upgrades, so as to facilitate recording the update process of the variables and storing them in the database for subsequent engineers to trace and use during maintenance.

[0085] Based on the above embodiments, Figure 3 is a flowchart of a method for obtaining controller data provided by an embodiment of the present disclosure. As Figure 3 shown, it specifically includes the following steps: S310. Receive a controller data acquisition instruction, parse the instruction, and obtain device information corresponding to the instruction.

[0086] In the embodiments of the present disclosure, after receiving a controller data acquisition instruction, the device information corresponding to the instruction is obtained by parsing the instruction. Here, the device information refers to the information of the device connected to the controller, including one or more of device name, device location, device type, production line name, device operation time, etc.

[0087] For different controller data acquisition instructions, the device information corresponding to the data to be acquired is different. Therefore, when parsing the instructions, it is necessary to extract keywords related to the device information to determine the valid device information.

[0088] For example, for the data acquisition instruction of "providing the historical values of all devices on the first production line in the past 24 hours", it is necessary to identify and extract keywords such as "the first production line", "all devices", and "in the past 24 hours" to determine that the device information corresponding to the data to be acquired is: all devices on the first production line, in the past 24 hours, energy consumption values.

[0089] Optionally, the devices whose energy consumption is to be monitored and related to the controller data acquisition instruction include several devices, which can be several devices on the same production line, or several devices with a correlation relationship on different production lines; they can be several devices of the same type or the same model, or several devices of different types or different models but with a correlation relationship.

[0090] Preferably, the device here can be one device related to the data acquisition instruction, or multiple devices. Among them, one device can be an independent single device, and multiple devices can be devices with a correlation relationship, which can be multiple devices located in different positions, or arbitrarily selected multiple devices, so that the controller data acquisition is not restricted by physical location and hardware settings, etc., and the accuracy and flexibility of the controller data acquisition are improved.

[0091] Optionally, the device information related to the controller data acquisition instruction obtained is saved. The saving method is not further limited here.

[0092] S320. Based on the controller variable tag library, determine the controller variable information associated with the device information corresponding to the instruction. The controller variable tag library is formed by using the controller variable tag library formation method.

[0093] In the implementation of the present disclosure, the controller variable tag library includes controller variable information and tag information of the controller variable. By using the device information related to the controller data acquisition instruction that has been obtained to match and obtain the controller variable information associated with this device information, the controller variable information corresponding to the controller data acquisition instruction can be quickly located, and then the data corresponding to this variable can be accurately and efficiently acquired and utilized.

[0094] S330. Using the obtained controller variable information as the query entry, extract the controller data corresponding to the controller variable information from the collected controller data. The controller data includes real-time controller data and / or historical controller data In the implementation of the present disclosure, taking the obtained controller variable information as the query entry, controller data with the same name as the above-mentioned controller variable name is obtained. The controller data of the controller variable includes historical controller data collected and stored in the controller database and real-time controller data collected in real time.

[0095] The running controller data is collected from devices such as on-site sensors and frequency converters through corresponding programs. These running data include running data such as device status, temperature, pressure, current, voltage, etc. that may be related to energy consumption, and the running data is stored in the database. This database is used to store the time series data corresponding to all variables in the corresponding controller engineering file, recording the specific values of each variable at different times.

[0096] Since in the controller engineering file, the naming of controller variables is irregular, users cannot understand information such as the function, use, or application of each variable in the controller engineering file through the variable name of the controller variable. When a user wants to obtain relevant data of a certain device on a certain production line, the user also does not know which controller variables are the data of the controller variables related to the device.

[0097] For example, in the controller engineering file, the controller variable named F019K8C. The name of this variable is the variable name set by the controller engineer when writing the program, but the actual user does not know the specific meaning of the variable named F019K8C, resulting in the inability to query and obtain the corresponding data of the device from the controller historical database. However, after setting corresponding labels such as production line A, roller bed 2, motor, switch control, etc. for this controller variable, the user can understand and clarify information such as the function, use, or application corresponding to this controller variable, and thus clearly know that this controller variable is the motor of roller bed 2 on production line A, which can be used for data recording and storage of the switch control of the motor.

[0098] In the implementation of the present disclosure, by receiving a controller data acquisition instruction, parsing the instruction, and obtaining device information corresponding to the instruction; based on the controller variable tag library, determining controller variable information associated with the device information corresponding to the instruction, the controller variable tag library is obtained by using the controller variable tag library formation method; taking the obtained controller variable information as the query entry, extracting from the collected controller data the controller data corresponding to the controller variable information, so that the variable name corresponding to the required data can be located by using the controller variable tag, and then the data corresponding to the controller variable can be obtained accurately and efficiently.

[0099] Figure 4 It is a schematic structural diagram of a device for forming a controller variable tag library provided by an embodiment of the present disclosure. The device for forming a controller variable tag library provided by an embodiment of the present disclosure can execute the processing flow provided by the embodiment of the method for forming a controller variable tag library, such asFigure 4 As shown in Figure 4 , the controller variable tag library forming device 40 includes: an engineering analysis module 41, a tag setting module 42, and a tag library construction module 43.

[0100] Among them, the engineering analysis module 41 can be used to analyze the engineering file corresponding to the control program of the controller, and obtain the controller variable information and device information related to the control program. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller.

[0101] The tag setting module 42 can be used to identify the variable address of the controller variable that has a coincidence relationship with the variable address of the device, establish the association relationship between the controller variable and the device, and set the device information of the device with the association relationship as the tag information of the controller variable.

[0102] The tag library construction module 43 can be used to construct a controller variable tag library, and the controller variable tag library includes controller variable information and tag information of the controller variable.

[0103] In the embodiments of the present disclosure, by analyzing the engineering file corresponding to the control program of the controller, the controller variable information and device information related to the control program are obtained. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller; the variable address of the controller variable that has a coincidence relationship with the variable address of the device is identified, the association relationship between the controller variable and the device is established, and the device information of the device with the association relationship is set as the tag information of the controller variable; a controller variable tag library is constructed, and the controller variable tag library includes controller variable information and tag information of the controller variable. Thus, valuable and unified controller variable tag information can be formed.

[0104] In some embodiments of the present disclosure, the controller variable tag library forming device 40 further includes a device tag acquisition module 44, which is used to acquire text materials from different sources related to the device, extract information associated with the controller variable, and use the information associated with the controller variable as the tag information of the controller variable. The text materials from different sources related to the device include one or more of a device instruction manual, a device electrical diagram, and a device mechanical diagram.

[0105] In some embodiments of the present disclosure, the controller variable tag library forming device 40 further includes a display module 45, which can be used to display the tag information of the controller variable in the controller variable tag library.

[0106] Figure 4The controller variable tag library forming device of the embodiment can be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0107] Figure 5 It is a schematic structural diagram of a controller data acquisition device provided by an embodiment of the present disclosure. The controller data acquisition device provided by the embodiment of the present disclosure can execute the processing flow provided by the controller data acquisition method embodiment, such as Figure 5 As shown, the controller data acquisition device 50 includes: an instruction analysis module 51, a variable positioning module 52, and a data extraction module 53.

[0108] Among them, the instruction analysis module 51 can be used to receive a controller data acquisition instruction, parse the instruction, and obtain device information corresponding to the instruction.

[0109] The variable positioning module 52 can be used to determine controller variable information associated with the device information corresponding to the instruction based on the controller variable tag library, and the controller variable tag library is obtained by using the controller variable tag library forming method provided by the embodiment of the present disclosure Figures 1 to 2 obtained.

[0110] The data extraction module 53 can be used to use the obtained controller variable information as a query entry to extract controller data corresponding to the controller variable information from the collected controller data, and the controller data includes real-time controller data and / or historical controller data.

[0111] In the embodiment of the present disclosure, it is possible to receive a controller data acquisition instruction, parse the instruction, and obtain device information corresponding to the instruction; based on the controller variable tag library, determine controller variable information associated with the device information corresponding to the instruction, and the controller variable tag library is obtained by using the controller variable tag library forming method; use the obtained controller variable information as a query entry to extract controller data corresponding to the controller variable information from the collected controller data, so that it is possible to use the controller variable tag to locate the variable name corresponding to the required data, and then accurately and efficiently obtain the data corresponding to the controller variable.

[0112] Figure 5 The controller data acquisition device of the embodiment can be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.

[0113] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. The electronic device provided by the embodiment of the present disclosure can execute the processing flow provided by the controller variable tag library forming method and the controller data acquisition method embodiment, such as Figure 6As shown, the electronic device 6 includes: a processor 61, a memory 62, and a computer program 63; wherein, the computer program is stored in the memory 62 and is configured to read the computer program 63 from the memory 62 and execute the computer program 63 to implement the embodiments of the present disclosure Figures 1 to 2 the controller variable tag library formation method provided Figure 3 and the controller data acquisition method provided

[0114] In addition, the embodiments of the present disclosure also provide a computer-readable storage medium, which can store a computer program. When the computer program is executed by a processor, the processor implements the embodiments of the present disclosure Figures 1 to 2 the controller variable tag library formation method provided Figure 3 and the controller data acquisition method provided

[0115] The above storage medium may include, for example, a memory for a computer program. The above computer program can be executed by a processor for forming a controller variable tag library and acquiring controller data to complete the embodiments of the present disclosure Figures 1 to 2 the controller variable tag library formation method provided Figure 3 and the controller data acquisition method provided. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, and an optical data storage configuration device, etc

[0116] Furthermore, the embodiments of the present disclosure also provide a computer program product, which includes a computer program or instruction. When the computer program or instruction is executed by a processor, the controller variable tag library formation method and the controller data acquisition method as described above are implemented

[0117] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein

Claims

1. A method for forming a controller variable tag library, characterized in that, Including: Analyze the project file corresponding to the control program of the controller, and obtain the controller variable information and device information related to the control program. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller; Identify the variable addresses of the controller variables that have an overlapping relationship with the variable addresses of the devices, establish the association relationship between the controller variables and the devices, and set the device information of the devices with the association relationship as the label information of the controller variables; Construct a controller variable tag library, which includes the controller variable information and the label information of the controller variables.

2. The method according to claim 1, wherein Before constructing the controller variable tag library, the method further includes: obtaining text materials from different sources related to the device, extracting information associated with the controller variables, and using the information associated with the controller variables as the label information of the controller variables. The text materials from different sources related to the device include one or more of device manuals, device electrical diagrams, and device mechanical diagrams.

3. The method according to claim 2, wherein The label information of the controller variables includes one or more of device type label information, location type label information, energy consumption type label information, function type label information, and usage type label information. The device type label information includes at least one label of device information associated with the controller variables, the location type label information includes at least one label of location information associated with the controller variables, the energy consumption type label information includes at least one label of energy consumption information associated with the controller variables, the function type label information includes at least one label of function information associated with the controller variables, and the usage type label information includes at least one label of usage information associated with the controller variables.

4. The method according to claim 1, characterized in that Display the label information of the controller variables in the controller variable tag library.

5. A method for obtaining controller data, characterized in that, Including: Receive a controller data acquisition instruction, analyze the instruction, and obtain the device information corresponding to the instruction; Based on the controller variable tag library, determine the controller variable information associated with the device information corresponding to the instruction. The controller variable tag library is formed by using the controller variable tag library formation method in any one of claims 1-4; Using the obtained controller variable information as a query entry, extract the controller data corresponding to the controller variable information from the collected controller data. The controller data includes real-time controller data and / or historical controller data.

6. A controller variable tag library forming device, characterized in that, Including: An engineering analysis module for analyzing the project file corresponding to the control program of the controller, and obtaining the controller variable information and device information related to the control program. The controller variable information includes the variable name and variable address of at least one controller variable, and the device information includes the device name and variable address of at least one device connected to the controller; A label setting module, configured to identify the variable address of the controller variable that has an overlapping relationship with the variable address of the device, establish an association relationship between the controller variable and the device, and set the device information of the device with the association relationship as the label information of the controller variable; A label library construction module, configured to construct a controller variable label library, where the controller variable label library includes the controller variable information and the label information of the controller variable.

7. A controller data acquisition device, characterized in that, Comprising: An instruction analysis module, configured to receive a controller data acquisition instruction, parse the instruction, and obtain the device information corresponding to the instruction; A variable positioning module, configured to determine the controller variable information associated with the device information corresponding to the instruction based on the controller variable label library, where the controller variable label library is obtained by using the controller variable label library formation method according to any one of claims 1-4; A data extraction module, configured to use the obtained controller variable information as a query entry, and extract the controller data corresponding to the controller variable information from the collected controller data, where the controller data includes real-time controller data and / or historical controller data.

8. An electronic device, characterized in that, Comprising: A processor; A memory; And A computer program; Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement the controller variable label library formation method according to any one of claims 1-4 and / or the controller data acquisition method according to claim 5.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by the processor, the processor is caused to implement the controller variable label library formation method according to any one of claims 1-4 and / or the controller data acquisition method according to claim 5.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, the controller variable label library formation method according to any one of claims 1-4 and / or the controller data acquisition method according to claim 5 is implemented.