Device plc data acquisition reverse derivation algorithm
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU YUANYANG TECHNOLOGY CO LTD
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-07
AI Technical Summary
[0034]有益效果:通过控制变量与代数推演,技术人员能够精准重构设备面板参数与PLC内部寄存器地址位的数据映射逻辑,通过将该技术固化为调试脚本并结合外设摄像头拍摄HMI面板以自动捕捉数据变化,实现了面板数据解析的完全自动化,打破了设备供应商的技术封闭,极大地降低了老旧设备和异构设备数据采集的改造成本与实施难度。
Smart Images

Figure CN122526083A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation, and in particular to a reverse derivation algorithm for PLC data acquisition in equipment. Background Technology
[0002] With the development of the Industrial Internet and the popularization of intelligent manufacturing, more and more factories have an increasing demand for monitoring and collecting equipment operating parameters, and data collection has gradually become one of the core links in enterprise digital transformation. However, in actual industrial sites, most factories usually do not use equipment from a single supplier, and the purchase dates of different equipment vary greatly. This complexity of the hardware ecosystem means that many older or non-standard devices cannot be contacted with the original manufacturer, and therefore cannot obtain the standard data interfaces, communication protocols, and address mapping point tables provided by the original manufacturer.
[0003] Without a point location table or if the equipment supplier refuses to provide connection information and point location mapping, data acquisition engineers cannot confirm the correspondence between the actual parameters displayed on the equipment's physical panel and the address bits of the PLC's internal registers.
[0004] Therefore, we propose a reverse derivation algorithm for PLC data acquisition to solve the above problems. Summary of the Invention
[0005] This invention provides a reverse derivation algorithm for PLC data acquisition in equipment, which is used to overcome the data barrier of equipment by combining the control variable method with solving algebraic equations.
[0006] The first aspect of this invention provides a reverse derivation algorithm for PLC data acquisition in a device. The algorithm includes: connecting a device, a PLC, an industrial gateway, and a data acquisition server to establish a data link from the device data to the server; adjusting a single parameter of the device while keeping other parameters constant based on the data link, observing the numerical changes of the PLC register address bits, and obtaining the corresponding relationship between the device parameters and the PLC address bits; confirming the correspondence between the original values in the address bits and the panel values based on the correlation; continuously changing the device parameters twice to obtain the original values in the corresponding address bits and the parameter panel values on the device panel; obtaining a system of two linear equations based on the two obtained original values and panel values; solving the system of two linear equations to obtain the multiplier and offset, and calculating the accurate calculation formula for the PLC; obtaining information about a certain address bit in the PLC through the correlation, and using the accurate calculation formula to calculate the actual panel value from the original value in the address bit information.
[0007] Optionally, in a first implementation of the first aspect of the present invention, the method includes:
[0008] A multi-frequency step-by-step debugging script for a single parameter of the device is generated, and the multi-frequency step-by-step debugging script is sent to the device through the data link to perform multiple consecutive numerical adjustment actions on the single parameter while keeping other parameters unchanged.
[0009] During the synchronization cycle of executing the multi-frequency step debugging script, all address bits of the PLC register are polled and read through the data link, the target address bits whose values change are recorded and their changes are extracted, and a first jump value sequence belonging to the target address bits is generated.
[0010] During the synchronization cycle of executing the same multi-frequency step debugging script, the HMI panel of the camera is captured, and the data changes on the panel that follow the action are automatically analyzed to generate a second visual display sequence of the single parameter on the real physical panel.
[0011] The system receives the first jump value sequence and the second visual display sequence as comparison inputs, verifies the consistency and following attributes of the two over time, and if the verification is successful, it binds the target address bit with the single parameter and outputs the corresponding association mapping table between the device parameter and the PLC address bit.
[0012] Optionally, in a second implementation of the first aspect of the present invention, the method includes:
[0013] Extract the PLC register address bits that are bound to the parameters of the device under test in the corresponding association relationship, and generate a targeted monitoring and extraction strategy;
[0014] According to the targeted monitoring and extraction strategy, a first drive change instruction is sent to the device parameters under test, and the value change of a specific address is continuously polled and monitored. After it is determined that the value change tends to be stable, the first original value in the specific address and the first panel value on the device panel are captured at the stable moment and combined to generate a first steady-state feature pair.
[0015] After confirming the successful generation of the first steady-state feature pair, a second driving change instruction is issued to the parameters of the device under test based on a preset step size. The value change of the specific address bit is monitored again. After determining that the value tends to stabilize again, the second original value in the specific address bit at that moment and the second panel value on the device panel are captured simultaneously and combined to generate the second steady-state feature pair.
[0016] Extract the first steady-state feature pair and the second steady-state feature pair, and obtain the basic solution parameter matrix based on the extracted first original value, first panel value, second original value and second panel value.
[0017] Optionally, in a third implementation of the first aspect of the present invention, the method includes:
[0018] Perform byte order conversion and numerical base unification operations based on the underlying communication protocol on the two original values to generate a standard solution dataset;
[0019] Based on the standard solution dataset, extract the two original values after transformation and calculate the absolute difference between them. Compare the results, and if the difference meets the calculation conditions, generate a validity mapping instruction.
[0020] In response to the validity mapping instruction, the two original values and the panel values in the standard solution dataset are taken as determined constant terms and substituted into the linear algebra skeleton with the multiplier and the offset as unknown variables, respectively, according to the position of the panel value corresponding to the actual physical quantity and the position of the original value, to construct an array of two linear analytical equations.
[0021] Optionally, in a fourth implementation of the first aspect of the present invention, the method includes:
[0022] The system of two linear equations in two variables is solved by algebraic elimination, and the corresponding multiplier and offset values are extracted and combined to generate a basic coefficient combination.
[0023] Based on the previous control variable method, the device execution parameters are adjusted to obtain at least one additional set of test raw values and test panel values. The basic coefficient combination is verified, and a high confidence coefficient combination is output after the verification is confirmed to be correct.
[0024] Retrieve the data association structure of the brand to which the target device PLC belongs, and use the multiplier and offset in the high confidence coefficient combination as deterministic constants to fill and substitute into the data association structure to generate customized parsing logic;
[0025] The customized parsing logic is programmed and solidified, and converted into an automated debugging script that can automatically capture and parse changes in HMI panel data.
[0026] Optionally, in a fifth implementation of the first aspect of the present invention, the method includes:
[0027] Based on the corresponding relationship and the accurate calculation formula, and combined with the edge communication protocol format of the target device, a dynamic parsing configuration file is generated;
[0028] Based on the dynamic parsing configuration file, the industrial gateway continuously accesses and extracts the real-time operating features of specific address bits in the PLC that are in the association relationship according to the collection and polling cycle set in the file, and packages them to generate the original data time sequence queue.
[0029] Extract the real-time running features from the original data time-series queue, call the accurate calculation formula embedded in the dynamic parsing configuration file, and synchronously perform numerical restoration calculations based on the multiplier and the offset for each real-time running feature to generate a real physical quantity data stream;
[0030] Based on the actual physical quantity data stream, the data is visually reconstructed and presented according to the actual operating logic of the device and the corresponding associated device parameter labels, thus constructing a virtual mirror monitoring panel in the data acquisition server.
[0031] The second aspect of this invention provides a device for parsing PLC data parameters, comprising: a link establishment module for connecting the device, PLC, industrial gateway, and data acquisition server to establish a data link from the device data to the server; an association relationship acquisition module for adjusting a single parameter of the device based on the data link while keeping other parameters unchanged, observing the numerical changes of the PLC register address bits, and acquiring the corresponding association relationship between the device parameters and the PLC address bits; a value acquisition module for confirming the correspondence between the original value in the address bit and the panel value based on the association relationship, continuously changing the device parameter twice, and acquiring the original value in the corresponding address bit and the parameter panel value on the device panel; an equation system construction module for obtaining a system of two linear equations based on the acquired original values and panel values; a formula calculation module for solving the system of two linear equations to obtain the multiplier and offset, and calculating the accurate calculation formula of the PLC; and a parameter parsing application module for obtaining information of a certain address bit in the PLC through the corresponding association relationship, and using the accurate calculation formula to calculate the actual panel value from the original value in the address bit information.
[0032] A third aspect of the present invention provides a device for parsing PLC data parameters, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory to cause the device for parsing PLC data parameters to execute the aforementioned reverse derivation algorithm for PLC data acquisition.
[0033] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to execute the aforementioned reverse derivation algorithm for device PLC data acquisition.
[0034] Beneficial effects: By controlling variables and algebraic deduction, technicians can accurately reconstruct the data mapping logic between equipment panel parameters and PLC internal register address bits. By solidifying this technology into a debugging script and combining it with an external camera to capture HMI panel images to automatically capture data changes, the complete automation of panel data parsing is achieved. This breaks the technological closure of equipment suppliers and greatly reduces the transformation cost and implementation difficulty of data acquisition for old and heterogeneous equipment. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the hardware topology architecture for PLC data acquisition in an embodiment of the present invention;
[0036] Figure 2 This is a schematic diagram illustrating the principle of determining the initial mapping relationship between device panel parameters and PLC address bits in an embodiment of the present invention.
[0037] Figure 3 This is a schematic diagram illustrating the final correspondence between multiple parameters and multiple address bits established by the control variable method in an embodiment of the present invention. Detailed Implementation
[0038] This invention provides a reverse derivation algorithm for PLC data acquisition, which overcomes the data barrier of equipment by combining the control variable method with algebraic equation solving. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0039] For ease of understanding, the specific process of the embodiments of the present invention is described below. One embodiment of the reverse derivation algorithm for PLC data acquisition in the present invention includes:
[0040] 101. Connect the equipment, PLC, industrial gateway, and data acquisition server to establish a data link from the equipment data to the server;
[0041] It is understood that the executing entity of this invention can be a device for parsing PLC data parameters, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as the executing entity as an example.
[0042] It should be noted that a physical connection between the PLC and the industrial gateway is established via Ethernet or serial port, and the industrial gateway performs port detection on the physical connection in the absence of original connection information to obtain the available communication port configuration of the PLC.
[0043] Based on the available communication port configuration, the industrial gateway calls the preset communication protocol such as MODBUS or S7 to send a handshake message to the PLC, and parses the response message returned by the PLC to determine the target communication protocol for successfully establishing a connection with the PLC.
[0044] According to the determined target communication protocol, the industrial gateway reads the equipment operation data stored in the address bits of the PLC's internal register and generates the raw value data stream.
[0045] The raw data stream is continuously sent to the data acquisition server through the industrial gateway, and a full data snapshot that is synchronized in real time with the PLC address is built in the data acquisition server to complete the data link from the device data to the server.
[0046] 102. Based on the data link, use the control variable method to adjust a single parameter of the device while keeping other parameters unchanged, observe the changes in the value of the PLC register address bits, and obtain the corresponding relationship between the device parameters and the PLC address bits;
[0047] It should be noted that a multi-frequency step debugging script for a single parameter of the device is generated and sent to the device via a data link, so as to perform multiple consecutive numerical adjustment actions on the single parameter while keeping other parameters unchanged.
[0048] During the synchronization cycle of executing the multi-frequency step debugging script, all address bits of the PLC register are read by polling through the data link, the target address bits whose values change are recorded and their changes are extracted, and the first jump value sequence belonging to the target address bits is generated.
[0049] During the synchronous cycle of executing the same multi-frequency step debugging script, the HMI panel of the device is captured by an external camera, and the data changes on the panel that follow the action are automatically analyzed to generate a second visual display sequence of a single parameter on the real physical panel.
[0050] The system receives the first jump value sequence and the second visual display sequence as comparison inputs, verifies the consistency and following attributes of the two over time, and if the verification is successful, it binds the target address bit with a single parameter and outputs the corresponding mapping table between the device parameter and the PLC address bit.
[0051] 103. Based on the association, confirm the correspondence between the original value in the address and the panel value, change the device parameter twice consecutively, and obtain the original value in the corresponding address and the parameter panel value on the device panel.
[0052] It should be noted that the PLC register address bits that are bound to the parameters of the device under test in the corresponding relationship are extracted, and a targeted monitoring and extraction strategy for the specific address bit and the specific device parameter is generated.
[0053] Based on the targeted monitoring and extraction strategy, the first drive change command is sent to the device parameters under test. The value change of a specific address is continuously polled and monitored. After the value change is determined to be stable, the first original value in the specific address at that stable moment and the first panel value on the device panel are captured simultaneously and combined to generate the first steady-state feature pair.
[0054] After confirming the successful generation of the first steady-state feature pair, a second drive change command is sent to the parameters of the device under test based on a preset step size. The value change of a specific address bit is monitored again. After determining that the value tends to stabilize again, the second original value in the specific address bit at that moment and the second panel value on the device panel are captured simultaneously and combined to generate the second steady-state feature pair.
[0055] Extract the first steady-state feature pair and the second steady-state feature pair, and encapsulate the extracted first original value, first panel value, second original value and second panel value in a structured manner to generate the basic solution parameter matrix, which is provided to subsequent steps as explicit numerical input for constructing a system of two linear equations.
[0056] 104. Substitute the two original values and the panel value into the calculation formula to obtain a system of two linear equations in two variables. The calculation formula is that the actual physical quantity is equal to the original value multiplied by the multiplier plus the offset.
[0057] It should be noted that the two original values and panel values obtained in the previous steps are extracted, and the two original values are subjected to byte order conversion and numerical base unification operation based on the underlying communication protocol to generate a standard solution dataset that eliminates hardware data format differences.
[0058] Based on the generated standard solution dataset, extract the two original values after transformation and calculate the absolute change difference between them. Compare the absolute change difference with the preset register dead zone threshold. When it is determined that the difference meets the calculation conditions, generate a validity mapping instruction that allows equation construction.
[0059] In response to the validity mapping instruction, the two original values and panel values in the standard solution dataset are taken as fixed constants. They are substituted into the linear algebra skeleton with the multiplier and offset as unknown variables according to the position of the panel value corresponding to the actual physical quantity and the position of the original value, respectively, and combined to construct an array of two linear analytical equations with a unique solution.
[0060] 105. Solve the system of two linear equations to obtain the multiplier and offset, and calculate the accurate calculation formula for the PLC.
[0061] It should be noted that the system of two linear equations in two variables constructed in the previous steps is received as the original input. Algebraic elimination is performed on the system of two linear equations in two variables to extract the corresponding multiplier values and offset values, and the two are combined to generate the basic coefficient combination.
[0062] To meet the computational constraints of sufficient samples, the device parameters are adjusted based on the previous control variable method to obtain at least one additional set of test raw values and test panel values. The additional values are used to verify the error consistency of the basic coefficient combination. After the verification is confirmed to be correct, a high-confidence coefficient combination that has been verified by multiple samples is output.
[0063] Retrieve the data association structure of the target device PLC brand, take the multiplier and offset in the high confidence coefficient combination as deterministic constants, fill and substitute them into the data association structure to generate customized parsing logic specific to that brand of PLC;
[0064] The generated custom parsing logic is programmed and solidified, converted into an automated debugging script that can automatically capture and parse changes in HMI panel data, and the automated debugging script is established as the accurate calculation formula for the final output of the PLC.
[0065] 106. Obtain information about a certain address bit in the PLC through the corresponding association relationship, and use an accurate calculation formula to calculate the original value in the address bit information to obtain the actual panel value, thereby realizing the parsing of the device PLC data parameters.
[0066] It should be noted that the corresponding relationships and accurate calculation formulas determined in the previous steps are extracted and structured by combining them with the edge communication protocol format of the target device to generate a dynamic parsing configuration file for all monitoring points of the device.
[0067] Based on the generated dynamic parsing configuration file, the industrial gateway continuously accesses and extracts the real-time operating characteristics of specific address bits in the PLC that are in the correlation relationship according to the collection and polling cycle set in the file, and packages them to generate a raw data time sequence queue with time sequence tags.
[0068] Extract various real-time operating features from the original data time-series queue as the input source for computation, call the accurate calculation formula embedded in the dynamic parsing configuration file, synchronously perform numerical restoration calculations based on magnification and offset on various real-time operating features, and generate a real physical quantity data stream that changes synchronously with the physical panel of the device;
[0069] The system receives the generated real physical quantity data stream, visualizes and reassembles it according to the actual operating logic of the equipment and the corresponding associated equipment parameter labels, and builds a virtual mirror monitoring panel in the data acquisition server that is independent of the original physical equipment, so as to complete the normalized automatic parsing and mapping monitoring of the equipment PLC data parameters.
[0070] The following provides further explanation:
[0071] Example 1: Establishment of the data acquisition link
[0072] like Figure 1 As shown in the architecture, the data acquisition link provided in this embodiment consists of a device, a PLC, an industrial gateway, and a data acquisition server. In physical implementation, the device's control terminal (PLC) is first connected to the industrial gateway via Ethernet or serial port. The industrial gateway handles the polling and conversion of the underlying protocol, and then forwards the read underlying data stream to the data acquisition server via standard industrial communication protocols such as MODBUS and S7. This architecture, as the hardware foundation for reverse engineering, physically establishes a data path from the device to the server in the absence of original manufacturer interface documentation.
[0073] Example 2: Address Bit Association Derivation Based on Control Variable Method
[0074] A PLC contains hundreds or even thousands of address bits (3x01, 3x02, etc.), which store equipment operating parameters (m1 to m5). However, due to the lack of a point table, the parameters and their corresponding address bits are unknown (e.g., ...). Figure 2 (As shown).
[0075] This embodiment uses the control variable method for reverse addressing. The specific steps are as follows:
[0076] Keep equipment parameters m2, m3, m4, and m5 stable, and adjust parameter m1 only on the HMI panel or operator terminal. While adjusting, the data acquisition engineer (or monitoring program) continuously observes the changes in the value of the address bits in the PLC register. If a change is found in the value of address bit 3x02, it is initially assumed that there is a mapping relationship between parameter m1 and address bit 3x02.
[0077] To eliminate randomness, the test sample was further expanded, and parameter m1 was repeatedly and independently adjusted multiple times to verify whether the 3x02 address bits consistently exhibited a strict following change. If the verification passed, the correspondence between m1 and 3x02 was determined. Similarly, if k parameters need to be collected, and each adjustment confirmation requires 5 state comparisons, then the total number of comparison iterations is... Second-rate.
[0078] Following the logic described above, parameters m2 through m5 are adjusted individually, and the remaining address bits are observed. Ultimately, the precise correspondence between all target parameters and specific address bits within the PLC can be exhaustively enumerated and derived (e.g., ...). Figure 3 (As shown in the connecting lines).
[0079] Example 3: Establishment of analytical formulas based on algebraic derivation
[0080] After knowing the mapping relationship between parameters and address bits, it is necessary to further derive the mathematical conversion formula from the original value (a) stored in the address bits to the actual physical quantity value (m) displayed on the panel.
[0081] Taking the Mitsubishi FX series PLC as an example, there is usually a linear relationship between its physical quantity parameters and the original values of the registers. Let the formula framework for calculating this linear transformation relationship be:
[0082]
[0083] in, This refers to the actual physical quantity (i.e., the value displayed on the device panel). The original value within the PLC address bits. For an unknown ratio constant, The offset constant is unknown.
[0084] To find the unknown and This involves performing two consecutive changes to a specific equipment parameter (m1).
[0085] After the first change: Record the current panel value as m1, and read the original value from the associated address. .
[0086] After the second change: Record the panel value as m2 at this time, and read the original value from the same associated address. .
[0087] Substituting the two obtained values into the calculation formula framework, we can obtain the following system of two linear equations in two variables:
[0088]
[0089]
[0090] The multiplier can be obtained by solving this system of equations. and offset The exact value. The solution will be... and Substituting back into the formula yields the accurate calculation formula f(x,y) for the PLC parameters. For other brands of PLCs, accurate data parsing and conversion formulas can also be calculated and fitted based on their underlying specific data storage mechanisms and protocol structures, provided sufficient sample conditions are extracted.
[0091] Example 4: Automated Capture and Parsing Script Based on Camera
[0092] In the traditional model, the above comparison process requires a large amount of manual intervention. After obtaining the above reverse derivation algorithm logic, this invention further applies it in engineering.
[0093] Technicians have formalized the steps of issuing control variable adjustment commands, real-time data polling and comparison, and automatic equation solving into an automated debugging script. Simultaneously, industrial cameras are deployed on-site, pointing at the equipment's HMI control panel. The cameras automatically capture real-time changes in panel data using optical character recognition (OCR) or machine vision algorithms; this, combined with the automated debugging script, reads register changes uploaded from the PLC gateway. This combination enables the system to automatically generate comparison samples and solve formulas, achieving fully automated, unmanned reverse engineering of panel data. This completely overcomes the data silos set by the original equipment manufacturer, perfectly achieving parameter acquisition even without original manufacturer support or a point table.
[0094] The reverse derivation algorithm for PLC data acquisition in this embodiment of the invention has been described above. The following describes the device for parsing PLC data parameters in this embodiment of the invention. One embodiment of the device for parsing PLC data parameters in this invention includes: a link establishment module, used to connect the device, PLC, industrial gateway, and data acquisition server to establish a data link from the device data to the server; an association relationship acquisition module, used to adjust a single parameter of the device while keeping other parameters unchanged based on the data link and using the control variable method; observe the numerical changes of the PLC register address bits to obtain the corresponding association relationship between the device parameters and the PLC address bits; and a value acquisition module, used to confirm the value of the address bits based on the association relationship. The system establishes a correspondence between the original values and panel values; it continuously changes the device parameters twice to obtain the original values in the corresponding address bits and the parameter panel values on the device panel; an equation construction module is used to substitute the two obtained original values and panel values into the calculation formula to obtain a system of two linear equations; the calculation formula is that the actual physical quantity equals the original value multiplied by the multiplier plus the offset; a formula calculation module is used to solve the system of two linear equations to obtain the multiplier and offset; and then calculate the accurate calculation formula for the PLC; a parameter parsing application module is used to obtain the information of a certain address bit in the PLC through the corresponding relationship; and use the accurate calculation formula to calculate the original value in the address bit information to obtain the real panel value, thus realizing the parsing of the device PLC data parameters.
[0095] The present invention also provides a device for parsing PLC data parameters of a device. The device for parsing PLC data parameters of a device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor performs the steps of the reverse derivation algorithm for PLC data acquisition in the above embodiments.
[0096] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the reverse derivation algorithm for PLC data acquisition of the device.
[0097] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0099] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A reverse derivation algorithm for PLC data acquisition in a device, characterized in that, The reverse derivation algorithm for PLC data acquisition of the device includes: Connect the equipment, PLC, industrial gateway and data acquisition server to establish a data link from the equipment data to the server; Adjust a single parameter of the device based on the data link while keeping other parameters unchanged, observe the changes in the value of the PLC register address bit, and obtain the corresponding relationship between the device parameter and the PLC address bit. Based on the aforementioned relationship, confirm the correspondence between the original value in the address bit and the panel value, and continuously change the device parameter twice to obtain the original value in the corresponding address bit and the parameter panel value on the device panel. Based on the two original values and the panel values obtained, a system of two linear equations in two variables is obtained; Solve the system of two linear equations to obtain the multiplier and offset, and calculate the accurate calculation formula for the PLC. Information about a certain address bit in the PLC is obtained through the corresponding association relationship, and the original value in the address bit information is calculated using the accurate calculation formula to obtain the actual panel value.
2. The reverse derivation algorithm for PLC data acquisition of equipment according to claim 1, characterized in that, include: A multi-frequency step-by-step debugging script for a single parameter of the device is generated, and the multi-frequency step-by-step debugging script is sent to the device through the data link to perform multiple consecutive numerical adjustment actions on the single parameter while keeping other parameters unchanged. During the synchronization cycle of executing the multi-frequency step debugging script, all address bits of the PLC register are polled and read through the data link, the target address bits whose values change are recorded and their changes are extracted, and a first jump value sequence belonging to the target address bits is generated. During the synchronization cycle of executing the same multi-frequency step debugging script, the HMI panel of the camera is captured, and the data changes on the panel that follow the action are automatically analyzed to generate a second visual display sequence of the single parameter on the real physical panel. The system receives the first jump value sequence and the second visual display sequence as comparison inputs, verifies the consistency and following attributes of the two over time, and if the verification is successful, it binds the target address bit with the single parameter and outputs the corresponding association mapping table between the device parameter and the PLC address bit.
3. The reverse derivation algorithm for PLC data acquisition of equipment according to claim 2, characterized in that, include: Extract the PLC register address bits that are bound to the parameters of the device under test in the corresponding association relationship, and generate a targeted monitoring and extraction strategy; According to the targeted monitoring and extraction strategy, a first drive change instruction is sent to the device parameters under test, and the value change of a specific address is continuously polled and monitored. After it is determined that the value change tends to be stable, the first original value in the specific address and the first panel value on the device panel are captured at the stable moment and combined to generate a first steady-state feature pair. After confirming the successful generation of the first steady-state feature pair, a second driving change instruction is issued to the parameters of the device under test based on a preset step size. The value change of the specific address bit is monitored again. After determining that the value tends to stabilize again, the second original value in the specific address bit at that moment and the second panel value on the device panel are captured simultaneously and combined to generate the second steady-state feature pair. Extract the first steady-state feature pair and the second steady-state feature pair, and obtain the basic solution parameter matrix based on the extracted first original value, first panel value, second original value and second panel value.
4. The reverse derivation algorithm for PLC data acquisition of equipment according to claim 3, characterized in that, include: Perform byte order conversion and numerical base unification operations based on the underlying communication protocol on the two original values to generate a standard solution dataset; Based on the standard solution dataset, extract the two original values after transformation and calculate the absolute difference between them. Compare the results, and if the difference meets the calculation conditions, generate a validity mapping instruction. In response to the validity mapping instruction, the two original values and the panel values in the standard solution dataset are taken as determined constant terms and substituted into the linear algebra skeleton with the multiplier and the offset as unknown variables, respectively, according to the position of the panel value corresponding to the actual physical quantity and the position of the original value, to construct an array of two linear analytical equations.
5. The reverse derivation algorithm for PLC data acquisition of equipment according to claim 4, characterized in that, include: The system of two linear equations in two variables is solved by algebraic elimination, and the corresponding multiplier and offset values are extracted and combined to generate a basic coefficient combination. Based on the previous control variable method, the device execution parameters are adjusted to obtain at least one additional set of test raw values and test panel values. The basic coefficient combination is verified, and a high confidence coefficient combination is output after the verification is confirmed to be correct. Retrieve the data association structure of the brand to which the target device PLC belongs, and use the multiplier and offset in the high confidence coefficient combination as deterministic constants to fill and substitute into the data association structure to generate customized parsing logic; The customized parsing logic is programmed and solidified, and converted into an automated debugging script that can automatically capture and parse changes in HMI panel data.
6. The reverse derivation algorithm for PLC data acquisition of equipment according to claim 5, characterized in that, include: Based on the corresponding relationship and the accurate calculation formula, and combined with the edge communication protocol format of the target device, a dynamic parsing configuration file is generated; Based on the dynamic parsing configuration file, the industrial gateway continuously accesses and extracts the real-time operating features of specific address bits in the PLC that are in the association relationship according to the collection and polling cycle set in the file, and packages them to generate the original data time sequence queue. Extract the real-time running features from the original data time-series queue, call the accurate calculation formula embedded in the dynamic parsing configuration file, and synchronously perform numerical restoration calculations based on the multiplier and the offset for each real-time running feature to generate a real physical quantity data stream; Based on the actual physical quantity data stream, the data is visually reconstructed and presented according to the actual operating logic of the device and the corresponding associated device parameter labels, thus constructing a virtual mirror monitoring panel in the data acquisition server.
7. A device for parsing PLC data parameters of an equipment, characterized in that, include: The data link connection module is used to connect the equipment, PLC, industrial gateway and data acquisition server to establish a data link from the equipment data to the server; The correlation acquisition module is used to adjust a single parameter of the device based on the data link while keeping other parameters unchanged, observe the value change of the PLC register address bit, and obtain the corresponding correlation between the device parameter and the PLC address bit. The value acquisition module is used to confirm the correspondence between the original value in the address position and the panel value according to the association relationship, and to continuously change the device parameter twice to obtain the original value in the corresponding address position and the parameter panel value on the device panel. The equation system construction module obtains a system of two linear equations in two variables based on the two original values and the panel value. The formula calculation module is used to solve the system of two linear equations in two variables to obtain the multiplier and offset, and to calculate the accurate calculation formula for the PLC. The parameter parsing application module is used to obtain information of a certain address bit in the PLC through the corresponding association relationship, and to calculate the real panel value from the original value in the address bit information using the accurate calculation formula.
8. A device for parsing PLC data parameters, characterized in that, The device for parsing PLC data parameters includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor calls the instructions in the memory to cause the device PLC data parameter parsing device to execute the device PLC data acquisition reverse derivation algorithm as described in any one of claims 1-6.
9. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the reverse derivation algorithm for device PLC data acquisition as described in any one of claims 1-6.