CN-121985059-A - Method, device, equipment and medium for downloading OPCUA protocol point table information increment in PLC system
Abstract
The invention discloses a method, a device, equipment and a medium for downloading OPCUA protocol point table information increment in a PLC system, and belongs to the technical field of industrial control systems. The method comprises the steps of obtaining OPCUA protocol increment and full data point table information through receiving and analyzing engineering files, analyzing the increment and full data point table information to obtain data point increment information and N data point information, wherein the N data point information is all data point information obtained by carrying out increment modification on the current M data points, the M data points are corresponding to first data storage buffer areas, the data corresponding to the N data points to be exchanged are configured according to the N data point information, OPCUA data pointers are updated according to the data point increment information, the hash table is updated, the first data storage buffer areas are closed and the second data storage buffer areas are started in the next IEC task period in response to the completion of data point increment information updating of an OPCUA protocol stack, and therefore updating of the data point information is achieved without causing disconnection and reconnection of an OPCUA client.
Inventors
- YUE XIANG
- Hou cang
- CHU BING
- CHEN YOUBAI
- YIN JUNJIE
Assignees
- 宁波和利时信息安全研究院有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251231
Claims (10)
- 1. A method for incremental downloading of OPCUA protocol point table information in a PLC system, the method comprising: Receiving and analyzing an engineering file to obtain OPCUA protocol increment data point table information and OPCUA protocol full data point table information, wherein the engineering file is issued in an increment downloading mode; Analyzing the OPCUA protocol increment data point table information and the OPCUA protocol total data point table information forwarded in the PLC system, and respectively obtaining data point increment information and N data point information, wherein the N data point information is all data point information obtained by carrying out increment modification on the current M data points, the M data points are corresponding to a first data storage buffer zone, and the first data storage buffer zone is used for storing data corresponding to the M data points to be exchanged; configuring a second data storage buffer according to the N data point information, wherein the second data storage buffer is used for storing data corresponding to the N data points to be exchanged; Updating an OPCUA data pointer of an OPCUA protocol stack in the PLC system according to the data point increment information, and updating a hash table, wherein the hash table is used for storing the OPCUA data pointer, and the OPCUA data pointer corresponds to the data point one by one; And closing the first data storage buffer zone and enabling the second data storage buffer zone at the next IEC task period in response to the data point increment information updating of the OPCUA protocol stack being completed.
- 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The length of the first data storage buffer is the sum of the lengths of the M data points, and the length of the second data storage buffer is the sum of the lengths of the N data points.
- 3. The method according to claim 1, wherein updating data point information of an OPCUA protocol stack in the PLC system according to the data point increment information and updating a hash table, the hash table being used for storing OPCUA data pointers, the OPCUA data pointers being in one-to-one correspondence with the data points, includes: Deleting corresponding data point information in a OCPUA protocol stack in the PLC system and deleting an OPCUA data pointer of the data point from the hash table in response to the data point increment information being characterized as deleted; in response to the data point increment information characterizing an increase, increasing corresponding data point information in a OCPUA protocol stack in the PLC system and adding an OPCUA data pointer for the data point to the hash table; In response to the data point increment information being characterized as a change, corresponding data point information in a OCPUA protocol stack in the PLC system is changed.
- 4. The method of claim 3, wherein said altering the corresponding data point information in the OCPUA protocol stack in the PLC system in response to the data point increment information being characterized as altered comprises: If the data point increment information is characterized as including modification of the read-write attribute, maintaining an original OPCUA data pointer of the data point; And if the data point increment information is characterized as not including the modification of the read-write attribute, re-acquiring the OPCUA data pointer of the data point, and re-adding the OPCUA data pointer into the hash table.
- 5. The method of claim 1, wherein updating the data point information of the OPCUA protocol stack in the PLC system according to the data point increment information and updating a hash table, the hash table being used for storing OPCUA data pointers, the OPCUA data pointers being in one-to-one correspondence with the data points, further comprising: acquiring OPCUA data pointers of each M data points; Setting a hash table, wherein the hash table comprises a first section and a second section which are adjacent, the lengths of the first section and the second section are l 1 and l 2 respectively, and the total length of the hash table is l 1 +l 2 ; Calculating a reference value, wherein the reference value comprises a hash value obtained by calculating the OPCUA protocol stack pointer through a hash algorithm, and a remainder is taken from the hash value pair l 1 to obtain the reference value; And if the reference value position of the hash table is not empty, the hash value is sequentially added to the rest length position of the hash table.
- 6. The method of claim 5, wherein the hashing algorithm is a djb string hashing algorithm.
- 7. The method of claim 5, wherein after updating the OPCUA data pointer for the corresponding data point according to the data point increment information and updating the hash table, further comprising: And numbering the OPCUA data pointers in the hash table according to the effectiveness of the OPCUA data pointers in the hash table.
- 8. An apparatus for incremental downloading of OPCUA protocol point table information in a PLC system, the apparatus comprising: The data obtaining module is used for receiving and analyzing the engineering file to obtain OPCUA protocol increment data point table information and OPCUA protocol full data point table information, wherein the engineering file is issued in an increment downloading mode; the analyzing module is used for analyzing the OPCUA protocol increment data point table information and the OPCUA protocol total data point table information forwarded in the PLC system to respectively obtain data point increment information and N data point information, wherein the N data point information is all data point information obtained by carrying out increment modification on the current M data points, the M data points are corresponding to first data storage buffer areas, and the first data storage buffer areas are used for storing data corresponding to the M data points to be exchanged; The configuration module is used for configuring a second data storage buffer area according to the N data point information, and the second data storage buffer area is used for storing data to be exchanged, which correspond to the N data points; the updating module is used for updating the OPCUA data pointers of the OPCUA protocol stack in the PLC system according to the data point increment information and updating a hash table, wherein the hash table is used for storing the OPCUA data pointers, and the OPCUA data pointers are in one-to-one correspondence with the data points; And the starting module is used for closing the first data storage buffer zone and starting the second data storage buffer zone when the next IEC task period is finished in response to the completion of updating the data point increment information of the OPCUA protocol stack.
- 9. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, at least one program, code set, or instruction set being loaded and executed by a processor to implement the OPCUA protocol point table information delta downloading method in a PLC system according to any one of claims 1 to 7.
- 10. A computer program product comprising instructions which, when run on a computer, cause the method of any of claims 1-7 to be performed by the computer.
Description
Method, device, equipment and medium for downloading OPCUA protocol point table information increment in PLC system Technical Field The invention relates to the technical field of industrial control systems, in particular to a method, a device, equipment and a medium for downloading OPCUA protocol point table information increment in a PLC system. Background At present, the downloading of the OPCUA protocol in the PLC system adopts a full downloading mode, and point table data and memory data in xmlbin formats are respectively generated after point table information and OPCUA protocol stack information are fully compiled through programming software. Then the OPCUA protocol in the PLC is reloaded, new point table data and protocol stack data are reconfigured, and a new protocol stack is started. In the process, the running protocol stack is required to be stopped, new data is loaded, and then the protocol stack is restarted, and the process can cause disconnection and reconnection of the OPCUA client to influence the current data interaction process. In view of the foregoing, there is a need for an OPCUA protocol stack data downloading scheme that does not disconnect the current data connection. Disclosure of Invention In order to solve the problems in the prior art, one aspect of the present invention provides a method for downloading OPCUA protocol point table information increment in a PLC system, which includes: Receiving and analyzing an engineering file to obtain OPCUA protocol increment data point table information and OPCUA protocol full data point table information, wherein the engineering file is issued in an increment downloading mode; Analyzing the OPCUA protocol increment data point table information and the OPCUA protocol total data point table information forwarded in the PLC system, and respectively obtaining data point increment information and N data point information, wherein the N data point information is all data point information obtained by carrying out increment modification on the current M data points, the M data points are corresponding to a first data storage buffer zone, and the first data storage buffer zone is used for storing data corresponding to the M data points to be exchanged; configuring a second data storage buffer according to the N data point information, wherein the second data storage buffer is used for storing data corresponding to the N data points to be exchanged; Updating an OPCUA data pointer of an OPCUA protocol stack in the PLC system according to the data point increment information, and updating a hash table, wherein the hash table is used for storing the OPCUA data pointer, and the OPCUA data pointer corresponds to the data point one by one; And closing the first data storage buffer zone and enabling the second data storage buffer zone at the next IEC task period in response to the data point increment information updating of the OPCUA protocol stack being completed. In another aspect of the present invention, there is provided an apparatus for incremental downloading of OPCUA protocol point table information in a PLC system, including: The data obtaining module is used for receiving and analyzing the engineering file to obtain OPCUA protocol increment data point table information and OPCUA protocol full data point table information, wherein the engineering file is issued in an increment downloading mode; the analyzing module is used for analyzing the OPCUA protocol increment data point table information and the OPCUA protocol total data point table information forwarded in the PLC system to respectively obtain data point increment information and N data point information, wherein the N data point information is all data point information obtained by carrying out increment modification on the current M data points, the M data points are corresponding to first data storage buffer areas, and the first data storage buffer areas are used for storing data corresponding to the M data points to be exchanged; The configuration module is used for configuring a second data storage buffer area according to the N data point information, and the second data storage buffer area is used for storing data to be exchanged, which correspond to the N data points; the updating module is used for updating the OPCUA data pointers of the OPCUA protocol stack in the PLC system according to the data point increment information and updating a hash table, wherein the hash table is used for storing the OPCUA data pointers, and the OPCUA data pointers are in one-to-one correspondence with the data points; And the starting module is used for closing the first data storage buffer zone and starting the second data storage buffer zone when the next IEC task period is finished in response to the completion of updating the data point increment information of the OPCUA protocol stack. In yet another aspect, the invention provides an electronic device comprising a processor and a memory for